diff options
author | Andreas Schneider <asn@samba.org> | 2015-10-20 15:54:39 +0200 |
---|---|---|
committer | Uri Simchoni <uri@samba.org> | 2015-11-04 15:35:56 +0100 |
commit | c474173a83f3200ce64379f96c1e2367061aa2ca (patch) | |
tree | f438d8eb25ae6eddff4a8a216d816680f28f4046 /testprogs/blackbox | |
parent | 23932d38dd2c83460a34030dcbad2d70a5e0157d (diff) | |
download | samba-c474173a83f3200ce64379f96c1e2367061aa2ca.tar.gz |
tests: Add tests for net ads (join|leave)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Nov 4 15:35:57 CET 2015 on sn-devel-104
Diffstat (limited to 'testprogs/blackbox')
-rwxr-xr-x | testprogs/blackbox/test_net_ads.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_net_ads.sh b/testprogs/blackbox/test_net_ads.sh new file mode 100755 index 00000000000..487014deea6 --- /dev/null +++ b/testprogs/blackbox/test_net_ads.sh @@ -0,0 +1,35 @@ +if [ $# -lt 3 ]; then +cat <<EOF +Usage: test_net.sh SERVER USERNAME PASSWORD +EOF +exit 1; +fi + +DC_SERVER=$1 +DC_USERNAME=$2 +DC_PASSWORD=$3 + +failed=0 + +net_tool="$BINDIR/net" + +# Load test functions +. `dirname $0`/subunit.sh + +testit "leave" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` + +testit "join+server" $VALGRIND $net_tool ads join -U$DC_USERNAME%$DC_PASSWORD -S$DC_SERVER || failed=`expr $failed + 1` + +testit "leave+server" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD -S$DC_SERVER || failed=`expr $failed + 1` + +testit_expect_failure "join+invalid_server" $VALGRIND $net_tool ads join -U$DC_USERNAME%$DC_PASSWORD -SINVALID && failed=`expr $failed + 1` + +testit "join+server" $VALGRIND $net_tool ads join -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` + +testit_expect_failure "leave+invalid_server" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD -SINVALID && failed=`expr $failed + 1` + +testit "testjoin" $VALGRIND $net_tool ads testjoin -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` + +testit "testjoin_machine_account" $VALGRIND $net_tool ads testjoin -kP || failed=`expr $failed + 1` + +exit $failed |