3 Usage: test_net.sh DC_SERVER DC_USERNAME DC_PASSWORD PREFIX_ABS
13 HOSTNAME
=$
(dd if=/dev
/urandom bs
=1 count
=32 2>/dev
/null |
sha1sum | cut
-b 1-10)
17 WORKDIR
=$
(mktemp
-d -p .
)
18 WORKDIR
=$
(basename $WORKDIR)
19 ODJFILE
="$BASEDIR/$WORKDIR/odj_provision.txt"
21 cp -a client
/* $WORKDIR/
22 sed -ri "s@(dir|directory) = (.*)/client/@\1 = \2/$WORKDIR/@" $WORKDIR/client.conf
23 sed -ri "s/netbios name = .*/netbios name = $HOSTNAME/" $WORKDIR/client.conf
24 rm -f $WORKDIR/private
/secrets.tdb
29 net_tool
="$BINDIR/net --configfile=$BASEDIR/$WORKDIR/client.conf --option=security=ads"
32 . $
(dirname $0)/subunit.sh
34 netbios
=$
(grep "netbios name" $BASEDIR/$WORKDIR/client.conf | cut
-f2 -d= |
awk '{$1=$1};1')
38 testit
"provision without dcname" $VALGRIND $net_tool offlinejoin provision domain
=$REALM machine_name
=$netbios savefile
=$ODJFILE -U$DC_USERNAME%$DC_PASSWORD || failed
=$
(expr $failed + 1)
40 testit
"requestodj" $VALGRIND $net_tool offlinejoin requestodj loadfile
=$ODJFILE || failed
=$
(expr $failed + 1)
42 testit
"testjoin" $VALGRIND $net_tool ads testjoin
-P --use-kerberos=required || failed
=$
(expr $failed + 1)
48 testit
"provision with dcname" $VALGRIND $net_tool offlinejoin provision domain
=$REALM machine_name
=$netbios savefile
=$ODJFILE dcname
=$DC_SERVER -U$DC_USERNAME%$DC_PASSWORD || failed
=$
(expr $failed + 1)
50 testit
"requestodj" $VALGRIND $net_tool offlinejoin requestodj loadfile
=$ODJFILE || failed
=$
(expr $failed + 1)
52 testit
"testjoin" $VALGRIND $net_tool ads testjoin
-P --use-kerberos=required || failed
=$
(expr $failed + 1)
58 testit
"provision with dcname and default password" $VALGRIND $net_tool offlinejoin provision domain
=$REALM machine_name
=$netbios savefile
=$ODJFILE dcname
=$DC_SERVER defpwd
-U$DC_USERNAME%$DC_PASSWORD || failed
=$
(expr $failed + 1)
60 testit
"requestodj" $VALGRIND $net_tool offlinejoin requestodj loadfile
=$ODJFILE || failed
=$
(expr $failed + 1)
62 testit
"testjoin" $VALGRIND $net_tool ads testjoin
-P --use-kerberos=required || failed
=$
(expr $failed + 1)
66 rm -rf $BASEDIR/$WORKDIR