summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorJustin Stephenson <jstephen@redhat.com>2018-06-28 11:08:27 -0400
committerAndrew Bartlett <abartlet@samba.org>2018-07-30 10:22:59 +0200
commit8025467bb3d3ee6998ccbe5d054454e9b951d0bd (patch)
tree40a81d1b9811afc4b242ce89da3bb81617c93063 /testprogs
parentd881f0c8a0ce2fc7cabf1966c5724e72c70d6694 (diff)
downloadsamba-8025467bb3d3ee6998ccbe5d054454e9b951d0bd.tar.gz
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 <jstephen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jul 30 10:22:59 CEST 2018 on sn-devel-144
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/test_net_ads.sh14
1 files changed, 14 insertions, 0 deletions
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`