summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2020-08-10 12:18:07 +1200
committerStefan Metzmacher <metze@samba.org>2020-08-24 13:52:19 +0000
commitb44b26b9cd2a06326a0744d1a79f0458aefac7d9 (patch)
treeb6196333285bd22d1ea925303e74898230666628
parent97d3c93e31e85f6c69231949aa482554c6351a61 (diff)
downloadsamba-b44b26b9cd2a06326a0744d1a79f0458aefac7d9.tar.gz
selftest: Add test for suppression of deprecation warnings
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14460 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit d3ff49f48507d8a64b9c4847f79d7939f647e6f0)
-rw-r--r--selftest/knownfail.d/testparm1
-rwxr-xr-xsource3/script/tests/test_testparm_s3.sh33
2 files changed, 34 insertions, 0 deletions
diff --git a/selftest/knownfail.d/testparm b/selftest/knownfail.d/testparm
new file mode 100644
index 00000000000..c3adb529940
--- /dev/null
+++ b/selftest/knownfail.d/testparm
@@ -0,0 +1 @@
+^samba3.blackbox.testparm.test_deprecated_warning_suppressed \ No newline at end of file
diff --git a/source3/script/tests/test_testparm_s3.sh b/source3/script/tests/test_testparm_s3.sh
index 6dcdeff07d7..9ef3f7e0097 100755
--- a/source3/script/tests/test_testparm_s3.sh
+++ b/source3/script/tests/test_testparm_s3.sh
@@ -58,6 +58,36 @@ EOF
${TESTPARM} ${TEMP_CONFFILE}
}
+test_testparm_deprecated()
+{
+ name=$1
+ old_SAMBA_DEPRECATED_SUPPRESS=$SAMBA_DEPRECATED_SUPPRESS
+ SAMBA_DEPRECATED_SUPPRESS=
+ export SAMBA_DEPRECATED_SUPPRESS
+ testit_grep $name 'WARNING: The "lsaovernetlogon" option is deprecated' $VALGRIND ${TESTPARM} ${TEMP_CONFFILE} --option='lsaovernetlogon=true'
+ SAMBA_DEPRECATED_SUPPRESS=$old_SAMBA_DEPRECATED_SUPPRESS
+ export SAMBA_DEPRECATED_SUPPRESS
+}
+
+test_testparm_deprecated_suppress()
+{
+ name=$1
+ subunit_start_test "$name"
+ output=$(SAMBA_DEPRECATED_SUPPRESS=1 $VALGRIND ${TESTPARM} ${TEMP_CONFFILE} --option='lsa over netlogon = true' 2>&1)
+ status=$?
+ if [ "$status" = "0" ]; then
+ echo "$output" | grep --quiet 'WARNING: The "lsa over netlogon " option is deprecated'
+ status=$?
+ if [ "$status" = "1" ]; then
+ subunit_pass_test "$name"
+ else
+ echo $output | subunit_fail_test "$name"
+ fi
+ else
+ echo $output | subunit_fail_test "$name"
+ fi
+}
+
testit "name resolve order = lmhosts wins host bcast"\
test_one_global_option "name resolve order = lmhosts wins host bcast" || \
failed=`expr ${failed} + 1`
@@ -112,6 +142,9 @@ testit "copy" \
test_copy || \
failed=`expr ${failed} + 1`
+test_testparm_deprecated "test_deprecated_warning_printed"
+test_testparm_deprecated_suppress "test_deprecated_warning_suppressed"
+
rm -f ${TEMP_CONFFILE}
testok $0 ${failed}