selftest: Rework samba4.blackbox.bogusdomain to use a temporary user
authorAndrew Bartlett <abartlet@samba.org>
Fri, 2 Mar 2012 11:28:59 +0000 (22:28 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 2 Mar 2012 13:44:36 +0000 (14:44 +0100)
This avoids leaving an account in the test environment after the test is run
and therefore avoids issues with interations with other tests.

Also, we now use the local administrator account in the member server to
add the test account.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Mar  2 14:44:36 CET 2012 on sn-devel-104

source4/selftest/tests.py
testprogs/blackbox/bogus.sh

index 5ad9861b9264576ee6974e2a112423788cb9ef99..18701c657d3f566abb02ea885e98febde011973e 100755 (executable)
@@ -358,7 +358,7 @@ for mech in [
     plansmbtorturetestsuite('base.xcopy', "plugin_s4_dc",
                             ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
 
-plantestsuite("samba4.blackbox.bogusdomain", "s3member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$DC_USERNAME', '$DC_PASSWORD'], allow_empty_output=True)
+plantestsuite("samba4.blackbox.bogusdomain", "s3member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$USERNAME', '$PASSWORD', '$DC_USERNAME', '$DC_PASSWORD'])
 for mech in [
     "-k no",
     "-k no --option=usespnego=no",
index 019957bf70f45ce4b4f00383e8bb2c43ba2149b1..68bab03f9cdc58813ab12a6abd6a9c84373aa179 100755 (executable)
@@ -13,8 +13,16 @@ SERVER=$1
 SHARE=$2
 USER=$3
 PWD=$4
+DC_USER=$5
+DC_PWD=$6
+shift 6
+
+TEST_USER=bogus_testuser
+TEST_PWD=bogus_pass3#@
 smbclient="$BINDIR/smbclient"
-testit_expect_failure "smbclient" $smbclient "//$SERVER/$SHARE" -W POUET -U$USER%$PWD -c "dir"&& failed=`expr $failed + 1`
-./bin/net rpc user add $USER $PWD -W $SERVER -U$USER%$PWD -S $SERVER
-testit "smbclient" $smbclient "//$SERVER/$SHARE" -W POUET -U$USER%$PWD -c "dir"|| failed=`expr $failed + 1`
+net="$BINDIR/net"
+testit_expect_failure "smbclient" $smbclient "//$SERVER/$SHARE" -W POUET -U$DC_USER%$DC_PWD -c "dir"&& failed=`expr $failed + 1`
+testit "net.user.add" $net rpc user add $TEST_USER $TEST_PWD -W $SERVER -U$SERVER\\$USER%$PWD -S $SERVER
+testit "smbclient" $smbclient "//$SERVER/$SHARE" -W POUET -U$TEST_USER%$TEST_PWD -c "dir"|| failed=`expr $failed + 1`
+testit "net.user.delete" $net rpc user delete $TEST_USER -W $SERVER -U$SERVER\\$USER%$PWD -S $SERVER
 exit $failed