From 8025467bb3d3ee6998ccbe5d054454e9b951d0bd Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Thu, 28 Jun 2018 11:08:27 -0400 Subject: s3:libads: Add net ads keep-account test Add test for the new --keep-account net ads leave operation BUG: https://bugzilla.samba.org/show_bug.cgi?id=13498 Signed-off-by: Justin Stephenson Reviewed-by: Andrew Bartlett Reviewed-by: Alexander Bokovoy Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Mon Jul 30 10:22:59 CEST 2018 on sn-devel-144 --- testprogs/blackbox/test_net_ads.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'testprogs') diff --git a/testprogs/blackbox/test_net_ads.sh b/testprogs/blackbox/test_net_ads.sh index f83ce01aae6..d3c4de5b741 100755 --- a/testprogs/blackbox/test_net_ads.sh +++ b/testprogs/blackbox/test_net_ads.sh @@ -26,6 +26,11 @@ failed=0 net_tool="$BINDIR/net -s $BASEDIR/$WORKDIR/client.conf --option=security=ads" +ldbsearch="ldbsearch" +if [ -x "$BINDIR/ldbsearch" ]; then + ldbsearch="$BINDIR/ldbsearch" +fi + # Load test functions . `dirname $0`/subunit.sh @@ -181,6 +186,15 @@ testit_expect_failure "leave+invalid_server" $VALGRIND $net_tool ads leave -U$DC testit "testjoin user+password" $VALGRIND $net_tool ads testjoin -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` +testit "leave+keep_account" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD --keep-account || failed=`expr $failed + 1` + +computers_ldb_ou="CN=Computers,DC=addom,DC=samba,DC=example,DC=com" +testit "ldb check for existence of machine account" $ldbsearch -U$DC_USERNAME%$DC_PASSWORD -H ldap://$SERVER.$REALM -s base -b "cn=$HOSTNAME,$computers_ldb_ou" || failed=`expr $failed + 1` + +testit "join" $VALGRIND $net_tool ads join -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` + +testit "testjoin" $VALGRIND $net_tool ads testjoin || failed=`expr $failed + 1` + ##Goodbye... testit "leave" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` -- cgit v1.2.1