[PATCH] Some fixes for selftest

Andreas Schneider asn at samba.org
Fri Mar 2 15:24:33 UTC 2018


Hi,

attached are some patches to either fix some issues in selftest or improve it 
a bit.


Please review and if OK push if possible.


Thanks,


	Andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
>From 6515e7e11aea777c3647e6f6751c9ae0343cb387 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 1 Mar 2018 10:26:56 +0100
Subject: [PATCH 1/3] s3:tests: Skip smbd error test if we do not log to stdout

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source3/script/tests/test_smbd_error.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/source3/script/tests/test_smbd_error.sh b/source3/script/tests/test_smbd_error.sh
index e9af47aea51..e93dff2d6a7 100755
--- a/source3/script/tests/test_smbd_error.sh
+++ b/source3/script/tests/test_smbd_error.sh
@@ -9,6 +9,16 @@
 
 . $(dirname $0)/../../../testprogs/blackbox/subunit.sh
 failed=0
+
+if [ $SMBD_DONT_LOG_STDOUT -eq 1 ]; then
+	subunit_start_test "check_panic_0"
+	subunit_skip_test "check_panic_0" <<EOF
+logging to stdout disabled
+EOF
+
+	testok $0 $failed
+fi
+
 error_inject_conf=$(dirname $SMB_CONF_PATH)/error_inject.conf
 
 panic_count_0=$(grep -c PANIC $SMBD_TEST_LOG)
-- 
2.16.2


>From 6069ec8ef11c9900c9b3d33430296f7bed8d61bb Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 1 Mar 2018 10:54:52 +0100
Subject: [PATCH 2/3] testprogs: Return the correct error status code

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 testprogs/blackbox/common_test_fns.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testprogs/blackbox/common_test_fns.inc b/testprogs/blackbox/common_test_fns.inc
index 8d755a48847..a5611c63fa0 100755
--- a/testprogs/blackbox/common_test_fns.inc
+++ b/testprogs/blackbox/common_test_fns.inc
@@ -99,8 +99,11 @@ kerberos_kinit() {
 		kpassfile=$(mktemp)
 		echo $password > ${kpassfile}
 		$kinit_tool --password-file=${kpassfile} $principal $@
+		status=$?
 		rm -f ${kpassfile}
 	else
 		echo $password | $kinit_tool $principal $@
+		status=$?
 	fi
+	return $status
 }
-- 
2.16.2


>From 0f4e983a97b2754d41d9ee6069e5317fd828f3e6 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 2 Mar 2018 11:01:33 +0100
Subject: [PATCH 3/3] selftest: Impove test names for samba.wbinfo_simple

This simplifies selecting a specific test to run.

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 selftest/knownfail        | 20 ++++++++++----------
 source4/selftest/tests.py |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/selftest/knownfail b/selftest/knownfail
index 710fd33894e..a2aeed2690d 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -220,16 +220,16 @@
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -G against ad_member
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -U check for sane mapping
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -G check for sane mapping
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--allocate-uid
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--allocate-gid
-^samba.wbinfo_simple.\(s4member:local\).--allocate-uid
-^samba.wbinfo_simple.\(s4member:local\).--allocate-gid
-^samba.wbinfo_simple.\(ad_dc:local\).--allocate-uid
-^samba.wbinfo_simple.\(ad_dc:local\).--allocate-gid
-^samba.wbinfo_simple.\(chgdcpass:local\).--allocate-uid
-^samba.wbinfo_simple.\(chgdcpass:local\).--allocate-gid
-^samba.wbinfo_simple.\(rodc:local\).--allocate-uid
-^samba.wbinfo_simple.\(rodc:local\).--allocate-gid
+^samba.wbinfo_simple.allocate-uid.wbinfo\(ad_dc_ntvfs:local\)
+^samba.wbinfo_simple.allocate-gid.wbinfo\(ad_dc_ntvfs:local\)
+^samba.wbinfo_simple.allocate-uid.wbinfo\(s4member:local\)
+^samba.wbinfo_simple.allocate-gid.wbinfo\(s4member:local\)
+^samba.wbinfo_simple.allocate-uid.wbinfo\(ad_dc:local\)
+^samba.wbinfo_simple.allocate-gid.wbinfo\(ad_dc:local\)
+^samba.wbinfo_simple.allocate-uid.wbinfo\(chgdcpass:local\)
+^samba.wbinfo_simple.allocate-gid.wbinfo\(chgdcpass:local\)
+^samba.wbinfo_simple.allocate-uid.wbinfo\(rodc:local\)
+^samba.wbinfo_simple.allocate-gid.wbinfo\(rodc:local\)
 #
 # These do not work against winbindd in member mode for unknown reasons
 #
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 4e397a8f134..ef752a51cdf 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -523,7 +523,7 @@ for env in ["nt4_dc", "nt4_member", "ad_dc", "ad_member", "s4member", "chgdcpass
              "--allocate-gid"]
 
     for t in tests:
-        plantestsuite("samba.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
+        plantestsuite("samba.wbinfo_simple.%s" % (t.replace(" --", ".").replace("--", "")), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
 
     plantestsuite(
         "samba.wbinfo_sids2xids.(%s:local)" % env, "%s:local" % env,
-- 
2.16.2



More information about the samba-technical mailing list