[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-2920-gc65d425
Michael Adam
obnox at samba.org
Thu Jun 19 15:43:53 GMT 2008
The branch, v3-3-test has been updated
via c65d425fec964bc0b8778b596615a8bcce0378aa (commit)
via a8ef8870beb91fcd2745aa59de6c59b49ea00e39 (commit)
via 0f5c13e5735990f4325f98156a7dc410276372fe (commit)
via eb28146d40b8a8bc2c20b8d222abf191ea178d5a (commit)
via 73c17b630317b5019e5d5f2b989b8de081a73e07 (commit)
from fdc03c0a5ba0da4fbc4610880e06150c11d4c737 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit c65d425fec964bc0b8778b596615a8bcce0378aa
Author: Michael Adam <obnox at samba.org>
Date: Thu Jun 19 17:21:04 2008 +0200
loadparm: use the return value of the special handlers in lp_load().
Up to now, the bool return value was silently ignored.
Michael
commit a8ef8870beb91fcd2745aa59de6c59b49ea00e39
Author: Michael Adam <obnox at samba.org>
Date: Thu Jun 19 17:20:22 2008 +0200
loadparm: don't treat a missing include file as an error in handle_include().
Michael
commit 0f5c13e5735990f4325f98156a7dc410276372fe
Author: Michael Adam <obnox at samba.org>
Date: Thu Jun 19 17:19:21 2008 +0200
testsuite: enable the testparm_s3 tests.
Michael
commit eb28146d40b8a8bc2c20b8d222abf191ea178d5a
Author: Michael Adam <obnox at samba.org>
Date: Thu Jun 19 17:14:39 2008 +0200
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
commit 73c17b630317b5019e5d5f2b989b8de081a73e07
Author: Michael Adam <obnox at samba.org>
Date: Thu Jun 19 13:52:49 2008 +0200
testsuite: update introductory comment to test_net_regsistry.sh
This is now used to test rpc and local access depending on
command line parameters.
Michael
-----------------------------------------------------------------------
Summary of changes:
source/param/loadparm.c | 6 +-
source/script/tests/test_net_registry.sh | 3 +-
source/script/tests/test_testparm_s3.sh | 90 ++++++++++++++++++++++++++++++
source/script/tests/tests_all.sh | 7 ++
4 files changed, 102 insertions(+), 4 deletions(-)
create mode 100755 source/script/tests/test_testparm_s3.sh
Changeset truncated at 500 lines:
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index 1ce88df..8f6af68 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -6843,7 +6843,7 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr)
DEBUG(2, ("Can't find include file %s\n", fname));
SAFE_FREE(fname);
- return false;
+ return true;
}
/***************************************************************************
@@ -7208,8 +7208,8 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue
/* if it is a special case then go ahead */
if (parm_table[parmnum].special) {
- parm_table[parmnum].special(snum, pszParmValue, (char **)parm_ptr);
- return (True);
+ return parm_table[parmnum].special(snum, pszParmValue,
+ (char **)parm_ptr);
}
/* now switch on the type of variable it is */
diff --git a/source/script/tests/test_net_registry.sh b/source/script/tests/test_net_registry.sh
index 4fe6db4..b6d2797 100755
--- a/source/script/tests/test_net_registry.sh
+++ b/source/script/tests/test_net_registry.sh
@@ -1,6 +1,7 @@
#!/bin/sh
-# tests for the "net registry" command - local access to the registry db
+# Tests for the "net registry" and "net rpc registry" commands.
+# rpc tests are chose by specifying "rpc" as commandline parameter.
RPC="$1"
diff --git a/source/script/tests/test_testparm_s3.sh b/source/script/tests/test_testparm_s3.sh
new file mode 100755
index 0000000..f1316e9
--- /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}<<EOF
+[global]
+ include = ${TEMP_CONFFILE}.%${MACRO}
+EOF
+ ${TESTPARM} ${TEMP_CONFFILE}
+}
+
+test_one_global_option()
+{
+ OPTION=$1
+ rm -f ${TEMP_CONFFILE}
+ cat > ${TEMP_CONFFILE}<<EOF
+[global]
+ ${OPTION}
+EOF
+ ${TESTPARM} ${TEMP_CONFFILE}
+}
+
+test_copy()
+{
+ rm -f ${TEMP_CONFFILE}
+ cat > ${TEMP_CONFFILE}<<EOF
+[share1]
+ path = /tmp
+ read only = no
+
+[share2]
+ copy = share1
+EOF
+ ${TESTPARM} ${TEMP_CONFFILE}
+}
+
+
+testit "netbios name" \
+ test_one_global_option "netbios name = funky" || \
+ failed=`expr ${failed} + 1`
+
+testit "netbios aliases" \
+ test_one_global_option "netbios aliases = funky1 funky2 funky3" || \
+ failed=`expr ${failed} + 1`
+
+testit "netbios scope" \
+ test_one_global_option "netbios scope = abc" || \
+ failed=`expr ${failed} + 1`
+
+testit "workgroup" \
+ test_one_global_option "workgroup = samba" || \
+ failed=`expr ${failed} + 1`
+
+testit "display charset" \
+ test_one_global_option "display charset = UTF8" || \
+ failed=`expr ${failed} + 1`
+
+testit "ldap debug level" \
+ test_one_global_option "ldap debug level = 7" || \
+ failed=`expr ${failed} + 1`
+
+for LETTER in U G D I i L N M R T a d h m v w V ; do
+testit "include with %${LETTER} macro expansion" \
+ test_include_expand_macro "${LETTER}" || \
+ failed=`expr ${failed} + 1`
+done
+
+testit "copy" \
+ test_copy || \
+ failed=`expr ${failed} + 1`
+
+rm -f ${TEMP_CONFFILE}
+
+testok $0 ${failed}
+
diff --git a/source/script/tests/tests_all.sh b/source/script/tests/tests_all.sh
index fa62a51..e44ec8b 100755
--- a/source/script/tests/tests_all.sh
+++ b/source/script/tests/tests_all.sh
@@ -48,6 +48,12 @@ net_s3() {
|| failed=`expr $failed + $?`
}
+testparm_s3() {
+ echo "RUNNING TESTS testparm_s3"
+ $SCRIPTDIR/test_testparm_s3.sh \
+ || failed=`expr $failed +$?`
+}
+
posix_s3() {
echo "RUNNING TESTS posix_s3"
eval "$LIB_PATH_VAR="\$SAMBA4SHAREDDIR:\$$LIB_PATH_VAR"; export $LIB_PATH_VAR"
@@ -76,6 +82,7 @@ if test "x$TESTS" = "x" ; then
wbinfo_s3
ntlm_auth_s3
net_s3
+ testparm_s3
posix_s3
else
for THIS_TEST in $TESTS; do
--
Samba Shared Repository
More information about the samba-cvs
mailing list