From: Michael Adam Date: Thu, 19 Jun 2008 15:14:39 +0000 (+0200) Subject: testsuite: add a testparm_s3 test script. X-Git-Tag: samba-3.3.0pre1~842 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb28146d40b8a8bc2c20b8d222abf191ea178d5a;p=thirdparty%2Fsamba.git testsuite: add a testparm_s3 test script. This is a first testparm/lp_load test that runs testparm on a couple of configuration files. The main purpose for now is to test the options that have special handlers (to check whether the handlers succeed). In particular, all the Macro expansions that are available via alloc_sub_basic() are tested with the include handler. This is to catch such crashbugs as #5548 where %m expansion led to a segfault. The tests now are very simple. Just check if testparm completes successfully on the given config files. This can (and should) be elaborated in the future. Michael --- diff --git a/source/script/tests/test_testparm_s3.sh b/source/script/tests/test_testparm_s3.sh new file mode 100755 index 00000000000..f1316e922c2 --- /dev/null +++ b/source/script/tests/test_testparm_s3.sh @@ -0,0 +1,90 @@ +#!/bin/sh + +# Tests for lp_load() via testparm. +# +# The main purpose (for now) is to test all the special handlers +# and the macro expansions. + +TEMP_CONFFILE=${LIBDIR}/smb.conf.tmp +TESTPARM="$VALGRIND ${TESTPARM:-$BINDIR/testparm} --suppress-prompt" + +incdir=`dirname $0` +. $incdir/test_functions.sh + +failed=0 + +test_include_expand_macro() +{ + MACRO=$1 + rm -f ${TEMP_CONFFILE} + cat >${TEMP_CONFFILE}< ${TEMP_CONFFILE}< ${TEMP_CONFFILE}<