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 cp -a client
/* $WORKDIR/
20 sed -ri "s@(dir|directory) = (.*)/client/@\1 = \2/$WORKDIR/@" $WORKDIR/client.conf
21 sed -ri "s/netbios name = .*/netbios name = $HOSTNAME/" $WORKDIR/client.conf
22 rm -f $WORKDIR/private
/secrets.tdb
27 net_tool
="$BINDIR/net -s $BASEDIR/$WORKDIR/client.conf --option=security=ads"
30 .
`dirname $0`/subunit.sh
32 testit
"join" $VALGRIND $net_tool ads
join -U$DC_USERNAME%$DC_PASSWORD || failed
=`expr $failed + 1`
34 testit
"testjoin" $VALGRIND $net_tool ads testjoin
-kP || failed
=`expr $failed + 1`
36 testit
"leave" $VALGRIND $net_tool ads leave
-U$DC_USERNAME%$DC_PASSWORD || failed
=`expr $failed + 1`
38 testit_expect_failure
"testjoin(not joined)" $VALGRIND $net_tool ads testjoin
-kP || failed
=`expr $failed + 1`
40 testit
"join+server" $VALGRIND $net_tool ads
join -U$DC_USERNAME%$DC_PASSWORD -S$DC_SERVER || failed
=`expr $failed + 1`
42 testit
"leave+server" $VALGRIND $net_tool ads leave
-U$DC_USERNAME%$DC_PASSWORD -S$DC_SERVER || failed
=`expr $failed + 1`
44 testit_expect_failure
"join+invalid_server" $VALGRIND $net_tool ads
join -U$DC_USERNAME%$DC_PASSWORD -SINVALID && failed
=`expr $failed + 1`
46 testit
"join+server" $VALGRIND $net_tool ads
join -U$DC_USERNAME%$DC_PASSWORD || failed
=`expr $failed + 1`
48 testit_expect_failure
"leave+invalid_server" $VALGRIND $net_tool ads leave
-U$DC_USERNAME%$DC_PASSWORD -SINVALID && failed
=`expr $failed + 1`
50 testit
"testjoin user+password" $VALGRIND $net_tool ads testjoin
-U$DC_USERNAME%$DC_PASSWORD || failed
=`expr $failed + 1`
53 testit
"leave" $VALGRIND $net_tool ads leave
-U$DC_USERNAME%$DC_PASSWORD || failed
=`expr $failed + 1`
55 rm -rf $BASEDIR/$WORKDIR