mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
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>
This commit is contained in:
parent
546a0f99e8
commit
d3ff49f485
1
selftest/knownfail.d/testparm
Normal file
1
selftest/knownfail.d/testparm
Normal file
@ -0,0 +1 @@
|
||||
^samba3.blackbox.testparm.test_deprecated_warning_suppressed
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user