[SCM] Samba Shared Repository - branch v3-6-test updated

Michael Adam obnox at samba.org
Wed Mar 9 04:53:43 MST 2011


The branch, v3-6-test has been updated
       via  a938c1c s3:test: ignore "setup directory" parameter in the net registry roundtrip test
       via  340f10c s3:test: the registry roundtrip test passes now
       via  eb88034 selftest the raw.mux test is flaky:
       via  bb7dbac s3:test: run the net.rpc.registry test under "dc" not "dc:local"
       via  2e2b0bb s3:test: rename samba3.blackbox.testparm_s3 -> samba3.blackbox.testparm
       via  e1b61ca s3:test: rename samba3.blackbox.net_s3_registry_roundtrip -> samba3.blackbox.net.local.registry.roundtrip
       via  17ff2bf s3:test: rename samba3.blackbox.net_s3_registry_rpc -> samba3.blackbox.net.rpc.registry
       via  fe68ea3 s3:test: rename samba3.blackbox.net_s3_registry -> samba3.blackbox.net.local.registry
       via  631e97d s3:test: rename samba3.blackbox.net_s3_misc --> samba3.blackbox.net.misc
       via  074a5a6 s3:test: mark the net_registry_roundtrip test as knownfail
       via  0689ad4 s3:test: add the registry roundtrip test as samba3.blackbox.net_s3_registry_roundtrip
       via  3ff5253 s3:test: mark vanished parameter "postscript" invalid in net registry roundtrip test
       via  30b7f62 s3:test: in net registry roundtrip test, mark "lock dir" as invalid parameter
       via  a743e5b s3:test: in net registry roundtrip test, exclude the files from exclude/logon
       via  0fa25b1 s3:test: correctly react to each failing step in the net registry roundtrip tests
       via  083808e s3:test: improve logging in the net registry roundtrip test steps
       via  fa95b9d s3:test: fix smbclient test on older systems (usage of mktemp)
       via  5c89c6e s3:test: fix registry roundtrip test on older systems (usage of mktemp)
       via  3ccccbd s3:tests: move the log directory of the smbclient_s3 test to st/
       via  6fea38d s3:tests: clean up old log directories of the registry.roundtrip test
       via  592a009 s3:tests: fix the smbclient_s3 test for multiple users running it.
       via  3c80743 s3:tests: remove unused script/tests/test_functions.sh
       via  065fd64 s3:tests: include subunit.sh instead of test_functions.sh in test_posix_s3.sh
       via  e91f5ed s3:tests: include subunit.sh instead of test_functions.sh in test_ntlm_auth_s3.sh
       via  3a03973 s3:tests: include subunit.sh instead of test_functions.sh in test_smbtorture_s3.sh
       via  5bc431c s3:tests: include subunit.sh instead of test_functions.sh in test_wbinfo_s3.sh
       via  79816dc s3:tests: use the blackbox subunit output formatter for the testparm_s3 test.
       via  aa68a47 s3:tests: include subunit.sh instead of test_functions.sh in test_local_s3.sh
       via  41a01b3 s3:tests: use the blackbox subunit output formatter for the smbclient_s3 test.
       via  564744e s3:test: remove the give/take admin rights code from the net(rpc)registry test
       via  5a12e0e s3:test: move the registry roundtrip test to a test script of its own
       via  e5f65c0 s3:test: add comment header to test_net_registry.sh
       via  094065f s3:test: use the blackbox subunit test driver in the net_registry tests.
       via  e6b4f33 s3:test: use the blackbox subunit test driver in the net_misc tests.
       via  7ad6467 s3:test: add a simple failing blackbox testsuite
       via  0bf864d s3:test: add a simple blackbox test that succeeds.
       via  b416cb8 testprogs/blackbox/subunit: add testok() for easier integration of s3 tests.
      from  698683c libsmbclient: Fix a typo

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit a938c1cf8f310512a2009207568c487e822b9cd1
Author: Michael Adam <obnox at samba.org>
Date:   Mon Mar 7 17:30:58 2011 +0100

    s3:test: ignore "setup directory" parameter in the net registry roundtrip test

commit 340f10ce55fecbc04697cec421598845d37540b7
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 5 00:58:19 2011 +0100

    s3:test: the registry roundtrip test passes now
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Sat Mar  5 02:19:33 CET 2011 on sn-devel-104

commit eb88034be46a9fc45a7a8a1f4b90c42aa3a80d5d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Feb 22 13:37:06 2011 +1100

    selftest the raw.mux test is flaky:
    
    TESTING MULTIPLEXED LOCK/LOCK/UNLOCK
    establishing a lock
    the second lock will conflict with the first
    this will too, but we'll unlock while waiting
    unlock the first range
    recv the async reply
    async lock took 265.40 msec
    failed to trigger early lock retry
    UNEXPECTED(error): samba3.posix_s3.raw.mux.mux
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Tue Feb 22 07:09:07 CET 2011 on sn-devel-104

commit bb7dbac54af6e0f9f830d1ea20aad97d09c816cb
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:48:16 2011 +0100

    s3:test: run the net.rpc.registry test under "dc" not "dc:local"
    
    There is no need to run it on the rpc server, but it should
    be run from a remote host.
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Wed Feb 16 16:05:58 CET 2011 on sn-devel-104

commit 2e2b0bb7f5694eaa6b92de4b5b53a39ea2306c88
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:43:41 2011 +0100

    s3:test: rename samba3.blackbox.testparm_s3 -> samba3.blackbox.testparm

commit e1b61cad3efdf919f5201b4969afe4684f5e218e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:39:26 2011 +0100

    s3:test: rename samba3.blackbox.net_s3_registry_roundtrip -> samba3.blackbox.net.local.registry.roundtrip

commit 17ff2bfa1ae552319cd508fcffd52773d1a6598b
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:37:05 2011 +0100

    s3:test: rename samba3.blackbox.net_s3_registry_rpc -> samba3.blackbox.net.rpc.registry

commit fe68ea3931ea064fe5f8370464258733827ff480
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:37:05 2011 +0100

    s3:test: rename samba3.blackbox.net_s3_registry -> samba3.blackbox.net.local.registry

commit 631e97daddda8f58a30b5b6028b42f509257d466
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:35:53 2011 +0100

    s3:test: rename samba3.blackbox.net_s3_misc --> samba3.blackbox.net.misc

commit 074a5a64a9c5edecd46c13986ae5a31de9869c59
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 12:38:26 2011 +0100

    s3:test: mark the net_registry_roundtrip test as knownfail
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Wed Feb 16 13:45:09 CET 2011 on sn-devel-104

commit 0689ad403ccf680dd806773dfda2a23b70da9b82
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 11:54:58 2011 +0100

    s3:test: add the registry roundtrip test as samba3.blackbox.net_s3_registry_roundtrip

commit 3ff5253f95712aa1322029747f4e54165dbcf8fd
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 5 00:55:27 2011 +0100

    s3:test: mark vanished parameter "postscript" invalid in net registry roundtrip test

commit 30b7f626d0c863d41a6d594e877f8f8c2200efc3
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 5 00:54:28 2011 +0100

    s3:test: in net registry roundtrip test, mark "lock dir" as invalid parameter
    
    This is a synonym of lock directory which is already marked invalid.

commit a743e5b62c4723b0553bbb20d114caa337382407
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 5 00:50:21 2011 +0100

    s3:test: in net registry roundtrip test, exclude the files from exclude/logon
    
    These files are not samba config files...

commit 0fa25b147ee30e61298e197006564ae28f757eda
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 4 23:17:02 2011 +0100

    s3:test: correctly react to each failing step in the net registry roundtrip tests

commit 083808e05d1c3507de9f98d63aeff2a42bf85be8
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 4 23:12:08 2011 +0100

    s3:test: improve logging in the net registry roundtrip test steps

commit fa95b9d3667dc6c6bd33e1226003676dd3872da9
Author: Michael Adam <obnox at samba.org>
Date:   Mon Feb 28 17:06:01 2011 +0100

    s3:test: fix smbclient test on older systems (usage of mktemp)
    
    --tmpdir is not a valid option to mktemp on older systems
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Mon Feb 28 18:12:46 CET 2011 on sn-devel-104

commit 5c89c6e3bfc0244f807e82d574f99590258bb8ef
Author: Michael Adam <obnox at samba.org>
Date:   Mon Feb 28 17:06:01 2011 +0100

    s3:test: fix registry roundtrip test on older systems (usage of mktemp)
    
    --tmpdir is not a valid option to mktemp on older systems

commit 3ccccbd8d1dabdbaef28306f754ac64c75ecefae
Author: Michael Adam <obnox at samba.org>
Date:   Mon Feb 21 12:48:48 2011 +0100

    s3:tests: move the log directory of the smbclient_s3 test to st/
    
    And use a proper mktemp call to create a unique name.
    The old location under /tmp/ was bad.
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Mon Feb 21 13:39:06 CET 2011 on sn-devel-104

commit 6fea38da6182a11c1c9f59f0951d1c852231448f
Author: Michael Adam <obnox at samba.org>
Date:   Mon Feb 21 12:48:15 2011 +0100

    s3:tests: clean up old log directories of the registry.roundtrip test

commit 592a009c2e0576cafeed98d8c37e0eb1e072ff73
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 11:49:43 2011 +0100

    s3:tests: fix the smbclient_s3 test for multiple users running it.
    
    The test created /tmp/log.smbclient, which lets the test fail if
    two users are running the test simultaneously.
    
    Now /tmp/log.test_smbclient_s3.$$ is used.
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Sat Feb 19 13:06:57 CET 2011 on sn-devel-104

commit 3c807431d3bebad34abd0a405a769f26463fbb79
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 02:29:54 2011 +0100

    s3:tests: remove unused script/tests/test_functions.sh
    
    This is not used any more now with selftest.

commit 065fd643006027d149f23ef115455b577cbd6163
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 01:14:54 2011 +0100

    s3:tests: include subunit.sh instead of test_functions.sh in test_posix_s3.sh
    
    It would actually not be necessary at all to include a script providing
    testit() and so on, since this script snippet is currently only sourced
    in tests.sh to plan the included test.

commit e91f5ed3dd099ee56272d0499abd7398f2a1e7ec
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 01:14:54 2011 +0100

    s3:tests: include subunit.sh instead of test_functions.sh in test_ntlm_auth_s3.sh
    
    It would actually not be necessary at all to include a script providing
    testit() and so on, since this script snippet is currently only sourced
    in tests.sh to plan the included test.

commit 3a039738c1efa1e62d0e5e092550832198ef76e3
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 01:14:54 2011 +0100

    s3:tests: include subunit.sh instead of test_functions.sh in test_smbtorture_s3.sh
    
    It would actually not be necessary at all to include a script providing
    testit() and so on, since this script snippet is currently only sourced
    in tests.sh to plan the included test.

commit 5bc431c4d3f688d4cb12604bda15201d1cb56080
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 01:14:54 2011 +0100

    s3:tests: include subunit.sh instead of test_functions.sh in test_wbinfo_s3.sh
    
    It would actually not be necessary at all to include a script providing
    testit() and so on, since this script snippet is currently only sourced
    in tests.sh to plan the included test.

commit 79816dc809edb55390b42b70139b1b392a598787
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 00:32:06 2011 +0100

    s3:tests: use the blackbox subunit output formatter for the testparm_s3 test.
    
    With the old output, failures would go unnoticed by selftest.

commit aa68a4777bf504c50d12b2ce931683658c2bb7b6
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 01:14:54 2011 +0100

    s3:tests: include subunit.sh instead of test_functions.sh in test_local_s3.sh
    
    It would actually not be necessary at all to include a script providing
    testit() and so on, since this script snippet is currently only sourced
    in tests.sh to plan the included test.

commit 41a01b3ddb91253ad6227086f0de1f191da346fc
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 19 00:32:06 2011 +0100

    s3:tests: use the blackbox subunit output formatter for the smbclient_s3 test.
    
    With the old output, failures would go unnoticed by selftest.

commit 564744e86caceedcf2f2da9a4fbb0c4e4291e1e5
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 14:47:02 2011 +0100

    s3:test: remove the give/take admin rights code from the net(rpc)registry test
    
    This is not neede any more.
    The token has been fixed at the lower level on the dc.

commit 5a12e0e19e550e92f01bcb2cf7cfe9eb1f0b3cdd
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 11:52:39 2011 +0100

    s3:test: move the registry roundtrip test to a test script of its own

commit e5f65c0aea6f264789d073a5729b5d8661608eb3
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 16 11:50:57 2011 +0100

    s3:test: add comment header to test_net_registry.sh

commit 094065fdd46461a84f14d90a34a197318ccec1f3
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 15 22:54:06 2011 +0100

    s3:test: use the blackbox subunit test driver in the net_registry tests.

commit e6b4f3387450641774f9bfc2cd332ba8c5895361
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 15 22:54:06 2011 +0100

    s3:test: use the blackbox subunit test driver in the net_misc tests.

commit 7ad6467b8c9b96b52d3bf76d2a9ad480f56ef19a
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 15 16:08:49 2011 +0100

    s3:test: add a simple failing blackbox testsuite

commit 0bf864d75ea43a88ae86b70b8c42066c99c304f5
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 15 16:05:06 2011 +0100

    s3:test: add a simple blackbox test that succeeds.

commit b416cb84b313a0806540450867ab3a6e18b0526a
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 15 16:03:58 2011 +0100

    testprogs/blackbox/subunit: add testok() for easier integration of s3 tests.

-----------------------------------------------------------------------

Summary of changes:
 source3/script/tests/test_failure.sh               |   39 ++++
 source3/script/tests/test_functions.sh             |  202 --------------------
 source3/script/tests/test_local_s3.sh              |    4 +-
 source3/script/tests/test_net_misc.sh              |    4 +-
 source3/script/tests/test_net_registry.sh          |  142 +-------------
 .../script/tests/test_net_registry_roundtrip.sh    |  155 +++++++++++++++
 source3/script/tests/test_ntlm_auth_s3.sh          |    4 +-
 source3/script/tests/test_posix_s3.sh              |    4 +-
 source3/script/tests/test_smbclient_s3.sh          |   23 ++-
 source3/script/tests/test_smbtorture_s3.sh         |    4 +-
 source3/script/tests/test_success.sh               |   26 +++
 source3/script/tests/test_testparm_s3.sh           |    4 +-
 source3/script/tests/test_wbinfo_s3.sh             |    4 +-
 source3/selftest/knownfail                         |    1 +
 source3/selftest/tests.sh                          |    9 +-
 testprogs/blackbox/subunit.sh                      |   10 +
 16 files changed, 277 insertions(+), 358 deletions(-)
 create mode 100755 source3/script/tests/test_failure.sh
 delete mode 100644 source3/script/tests/test_functions.sh
 create mode 100755 source3/script/tests/test_net_registry_roundtrip.sh
 create mode 100755 source3/script/tests/test_success.sh


Changeset truncated at 500 lines:

diff --git a/source3/script/tests/test_failure.sh b/source3/script/tests/test_failure.sh
new file mode 100755
index 0000000..8af0f3a
--- /dev/null
+++ b/source3/script/tests/test_failure.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Blackbox test that should fail one of three subtests.
+#
+# Copyright (C) 2011 Michael Adam <obnox at samba.org>
+
+# include the blackbox subunit infrastructure
+# if not run from classical s3 test script:
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
+	incdir=`dirname $0`/../../../testprogs/blackbox
+	. $incdir/subunit.sh
+}
+
+failed=0
+
+test_failure()
+{
+	false
+}
+
+test_success()
+{
+	true
+}
+
+testit "success" \
+	test_success || \
+	failed=`expr $failed + 1`
+
+testit "failure" \
+	test_failure || \
+	failed=`expr $failed + 1`
+
+testit "success" \
+	test_success || \
+	failed=`expr $failed + 1`
+
+testok $0 $failed
+
diff --git a/source3/script/tests/test_functions.sh b/source3/script/tests/test_functions.sh
deleted file mode 100644
index 4e80266..0000000
--- a/source3/script/tests/test_functions.sh
+++ /dev/null
@@ -1,202 +0,0 @@
-TEST_FUNCTIONS_SH="INCLUDED"
-
-samba3_stop_sig_term() {
-	RET=0
-	kill -USR1 `cat $PIDDIR/timelimit.nmbd.pid` >/dev/null 2>&1 || \
-		kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` || RET=$?
-
-	kill -USR1 `cat $PIDDIR/timelimit.winbindd.pid` >/dev/null 2>&1 || \
-		kill -ALRM `cat $PIDDIR/timelimit.winbindd.pid` || RET=$?
-
-	kill -USR1 `cat $PIDDIR/timelimit.smbd.pid` >/dev/null 2>&1 || \
-		kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` || RET=$?
-
-	return $RET;
-}
-
-samba3_stop_sig_kill() {
-	kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` >/dev/null 2>&1
-	kill -ALRM `cat $PIDDIR/timelimit.winbindd.pid` >/dev/null 2>&1
-	kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` >/dev/null 2>&1
-	return 0;
-}
-
-samba3_nmbd_test_log() {
-	if [ -n "$NMBD_TEST_LOG" ];then
-		if [ -r "$NMBD_TEST_LOG" ];then
-			return 0;
-		fi
-	fi
-	return 1;
-}
-
-samba3_winbindd_test_log() {
-	if [ -n "$WINBINDD_TEST_LOG" ];then
-		if [ -r "$WINBINDD_TEST_LOG" ];then
-			return 0;
-		fi
-	fi
-	return 1;
-}
-
-samba3_smbd_test_log() {
-	if [ -n "$SMBD_TEST_LOG" ];then
-		if [ -r "$SMBD_TEST_LOG" ];then
-			return 0;
-		fi
-	fi
-	return 1;
-}
-
-samba3_check_only() {
-	if [ -n "$SERVER_TEST_FIFO" ];then
-		if [ -p "$SERVER_TEST_FIFO" ];then
-			return 0;
-		fi
-		return 1;
-	fi
-	return 0;
-}
-
-testit() {
-	if [ -z "$PREFIX" ]; then
-	    PREFIX=test_prefix
-	    mkdir -p $PREFIX
-	fi
-	name=$1
-	shift 1
-	binary=$1
-	cmdline="$*"
-
-	SERVERS_ARE_UP="no"
-
-	shname=`echo $name | \
-	sed -e 's%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\-]%_%g'`
-
-	UNIQUE_PID=`/bin/sh -c 'echo $$'`
-	TEST_LOG="$PREFIX/test_log.${UNIQUE_PID}"
-	TEST_PCAP="$PREFIX/test_${shname}_${UNIQUE_PID}.pcap"
-	trap "rm -f $TEST_LOG $TEST_PCAP" EXIT
-
-	samba3_nmbd_test_log && if [ -z "$nmbd_log_size" ]; then
-		nmbd_log_size=`wc -l < $NMBD_TEST_LOG`;
-	fi
-	samba3_winbindd_test_log && if [ -z "$winbindd_log_size" ]; then
-		winbindd_log_size=`wc -l < $WINBINDD_TEST_LOG`;
-	fi
-	samba3_smbd_test_log && if [ -z "$smbd_log_size" ]; then
-		smbd_log_size=`wc -l < $SMBD_TEST_LOG`;
-	fi
-
-	if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
-		echo "--==--==--==--==--==--==--==--==--==--==--"
-		echo "Running test $name (level 0 stdout)"
-		echo "--==--==--==--==--==--==--==--==--==--==--"
-		date
-		echo "Testing $name"
-	else
-		echo "Testing $name ($failed)"
-	fi
-
-	samba3_check_only && SERVERS_ARE_UP="yes"
-	if [ x"$SERVERS_ARE_UP" != x"yes" ];then
-		if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
-			echo "SERVERS are down! Skipping: $cmdline"
-			echo "=========================================="
-			echo "TEST SKIPPED: $name (reason SERVERS are down)"
-			echo "=========================================="
-   		else
-			echo "TEST SKIPPED: $name (reason SERVERS are down)"
-		fi
-		return 1
-	fi
-
-	if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then
-		SOCKET_WRAPPER_PCAP_FILE=$TEST_PCAP
-		export SOCKET_WRAPPER_PCAP_FILE
-	fi
-
-	MAKE_TEST_BINARY=$binary
-	export MAKE_TEST_BINARY
-	( $cmdline > $TEST_LOG 2>&1 )
-	status=$?
-	MAKE_TEST_BINARY=
-	# show any additional output from smbd that has happened in this test
-	samba3_nmbd_test_log && {
-		new_log_size=`wc -l < $NMBD_TEST_LOG`;
-		test "$new_log_size" = "$nmbd_log_size" || {
-			echo "NMBD OUTPUT:";
-			incr_log_size=`expr $new_log_size - $nmbd_log_size`;
-			tail -$incr_log_size $NMBD_TEST_LOG;
-			nmbd_log_size=$new_log_size;
-		}
-	}
-	samba3_winbindd_test_log && {
-		new_log_size=`wc -l < $WINBINDD_TEST_LOG`;
-		test "$new_log_size" = "$winbindd_log_size" || {
-			echo "WINBINDD OUTPUT:";
-			incr_log_size=`expr $new_log_size - $winbindd_log_size`;
-			tail -$incr_log_size $WINBINDD_TEST_LOG;
-			winbindd_log_size=$new_log_size;
-		}
-	}
-	samba3_smbd_test_log && {
-		new_log_size=`wc -l < $SMBD_TEST_LOG`;
-		test "$new_log_size" = "$smbd_log_size" || {
-			echo "SMBD OUTPUT:";
-			incr_log_size=`expr $new_log_size - $smbd_log_size`;
-			tail -$incr_log_size $SMBD_TEST_LOG;
-			smbd_log_size=$new_log_size;
-		}
-	}
-
-	if [ x"$status" != x"0" ]; then
-		echo "TEST OUTPUT:"
-		cat $TEST_LOG;
-		rm -f $TEST_LOG;
-		if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then
-			echo "TEST PCAP: $TEST_PCAP"
-		fi
-		if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
-			echo "=========================================="
-			echo "TEST FAILED: $name (status $status)"
-			echo "=========================================="
-   		else
-			echo "TEST FAILED: $cmdline (status $status)"
-		fi
-		trap "" EXIT
-		return 1;
-	fi
-	rm -f $TEST_LOG;
-	if [ x"$MAKE_TEST_KEEP_PCAP" = x"yes" ];then
-		echo "TEST PCAP: $TEST_PCAP"
-	else
-		rm -f $TEST_PCAP;
-	fi
-	if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
-		echo "ALL OK: $cmdline"
-		echo "=========================================="
-		echo "TEST PASSED: $name"
-		echo "=========================================="
-	fi
-	trap "" EXIT
-	return 0;
-}
-
-testok() {
-	name=`basename $1`
-	failed=$2
-
-	if [ x"$failed" = x"0" ];then
-		:
-	else
-		echo "$failed TESTS FAILED or SKIPPED ($name)";
-	fi
-	exit $failed
-}
-
-if [ -z "$VALGRIND" ]; then
-    MALLOC_CHECK_=2
-    export MALLOC_CHECK_
-fi
-
diff --git a/source3/script/tests/test_local_s3.sh b/source3/script/tests/test_local_s3.sh
index 0c94871..de867c9 100755
--- a/source3/script/tests/test_local_s3.sh
+++ b/source3/script/tests/test_local_s3.sh
@@ -10,8 +10,8 @@ exit 1;
 fi
 
 test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
-incdir=`dirname $0`
-. $incdir/test_functions.sh
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
 }
 
 failed=0
diff --git a/source3/script/tests/test_net_misc.sh b/source3/script/tests/test_net_misc.sh
index 8d092f4..5257830 100755
--- a/source3/script/tests/test_net_misc.sh
+++ b/source3/script/tests/test_net_misc.sh
@@ -8,8 +8,8 @@ NETTIME="${NET} time"
 NETLOOKUP="${NET} lookup"
 
 test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
-incdir=`dirname $0`
-. $incdir/test_functions.sh
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
 }
 
 failed=0
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh
index 525e13a..45f4dd0 100755
--- a/source3/script/tests/test_net_registry.sh
+++ b/source3/script/tests/test_net_registry.sh
@@ -1,6 +1,10 @@
 #!/bin/sh
-
-# Tests for the "net registry" and "net rpc registry" commands.
+#
+# Blackbox tests for the "net registry" and "net rpc registry" commands.
+#
+# Copyright (C) 2010-2011 Michael Adam <obnox at samba.org>
+# Copyright (C) 2010 Gregor Beck <gbeck at sernet.de>
+#
 # rpc tests are chose by specifying "rpc" as commandline parameter.
 
 RPC="$1"
@@ -14,8 +18,8 @@ else
 fi
 
 test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
-incdir=`dirname $0`
-. $incdir/test_functions.sh
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
 }
 
 failed=0
@@ -316,130 +320,6 @@ test_setvalue_twice()
 	${NETREG} setvalue ${KEY} "${VALNAME}" ${VALTYPE2} ${VALVALUE2}
 }
 
-give_administrative_rights()
-{
-	bin/net -s $SERVERCONFFILE sam createbuiltingroup Administrators
-	if test "x$?" != "x0" ; then
-		echo "ERROR: creating builtin group Administrators"
-		false
-		return
-	fi
-
-	bin/net -s $SERVERCONFFILE sam addmem BUILTIN\\Administrators $USERNAME
-	if test "x$?" != "x0" ; then
-		echo "ERROR: adding user $USERNAME to BUILTIN\\Administrators"
-		false
-	else
-		true
-	fi
-}
-
-take_administrative_rights()
-{
-	bin/net -s $SERVERCONFFILE sam delmem BUILTIN\\Administrators $USERNAME
-	if test "x$?" != "x0" ; then
-		echo "ERROR: removing user $USERNAME from BUILTIN\\Administrators"
-		false
-	else
-		true
-	fi
-}
-
-SED_INVALID_PARAMS="{
-s/lock directory/;&/g
-s/modules dir/;&/g
-s/logging/;&/g
-s/status/;&/g
-s/logdir/;&/g
-s/read prediction/;&/g
-s/mkprofile/;&/g
-s/valid chars/;&/g
-s/timesync/;&/g
-s/sambaconf/;&/g
-s/logtype/;&/g
-s/servername/;&/g
-}"
-
-REGPATH="HKLM\Software\Samba"
-
-conf_roundtrip_step() {
-    echo $* >>$LOG
-    $@ 2>>$LOG
-#    echo -n .
-}
-
-conf_roundtrip()
-{
-    local DIR=$(mktemp -d --tmpdir=$PREFIX conf_roundtrip_XXXX)
-    local LOG=$DIR/log
-
-    echo conf_roundtrip $1 > $LOG
-
-    sed -e "$SED_INVALID_PARAMS" $1 >$DIR/conf_in
-
-    conf_roundtrip_step $NET conf drop
-    test -z "$($NET conf list)" 2>>$LOG
-    if [ "$?" = "1" ]; then
-	echo "ERROR: conf drop failed" | tee -a $LOG
-	return 1
-    fi
-
-    conf_roundtrip_step $NET conf import $DIR/conf_in
-    conf_roundtrip_step $NET conf list > $DIR/conf_exp
-
-    grep "\[global\]" $DIR/conf_exp >/dev/null 2>>$LOG
-    if [ "$?" = "1" ]; then
-	echo "ERROR: conf import => conf export failed" | tee -a $LOG
-	return 1
-    fi
-
-    conf_roundtrip_step $NET -d10 registry export $REGPATH $DIR/conf_exp.reg
-
-    conf_roundtrip_step $NET conf drop
-    test -z "$($NET conf list)" 2>>$LOG
-    if [ "$?" = "1" ]; then
-	echo "ERROR: conf drop failed" | tee -a $LOG
-	return 1
-    fi
-
-    conf_roundtrip_step $NET registry import $DIR/conf_exp.reg
-
-    conf_roundtrip_step $NET conf list >$DIR/conf_out
-    diff -q $DIR/conf_out $DIR/conf_exp  >> $LOG
-    if [ "$?" = "1" ]; then
-	echo "ERROR: registry import => conf export failed"  | tee -a $LOG
-	return 1
-    fi
-
-    conf_roundtrip_step $NET registry export $REGPATH $DIR/conf_out.reg
-    diff -q $DIR/conf_out.reg $DIR/conf_exp.reg >>$LOG
-    if [ "$?" = "1" ]; then
-	echo "Error: registry import => registry export failed" | tee -a $LOG
-	return 1
-    fi
-    rm -r $DIR
-}
-
-CONF_FILES=${CONF_FILES:-$(find $SRCDIR/.. -name *.conf | xargs grep -l "\[global\]")}
-
-for conf_file in $CONF_FILES
-do
-    conf_file=${conf_file#$SRCDIR/}
-    testit "conf_roundtrip $conf_file" \
-	conf_roundtrip $conf_file \
-	|| failed=`expr $failed + 1`
-done
-
-
-
-if test "x${RPC}" = "xrpc" ; then
-testit "giving user ${USERNAME} administrative rights" \
-	give_administrative_rights
-	if [ "x$?" != "x0" ] ; then
-		failed=`expr $failed + 1`
-		testok $0 $failed
-	fi
-fi
 
 testit "enumerate HKLM" \
 	test_enumerate HKLM || \
@@ -520,12 +400,6 @@ testit "delete key with value" \
 	test_deletekey HKLM/testkey || \
 	failed=`expr $failed + 1`
 
-if test "x${RPC}" = "xrpc" ; then
-testit "taking administrative rights from user ${USERNAME}" \
-	take_administrative_rights || \
-	failed=`expr $failed + 1`
-fi
-
 
 testok $0 $failed
 
diff --git a/source3/script/tests/test_net_registry_roundtrip.sh b/source3/script/tests/test_net_registry_roundtrip.sh
new file mode 100755
index 0000000..df79de0
--- /dev/null
+++ b/source3/script/tests/test_net_registry_roundtrip.sh
@@ -0,0 +1,155 @@
+#!/bin/sh
+#
+# Blackbox test for net conf/registry roundtrips.
+#
+# Copyright (C) 2010 Gregor Beck <gbeck at sernet.de>
+# Copyright (C) 2011 Michael Adam <obnox at samba.org>
+
+NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
+
+
+if test "x${RPC}" = "xrpc" ; then
+	NETREG="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc registry"
+else
+	NETREG="${NET} registry"
+fi
+
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+}
+
+failed=0
+
+SED_INVALID_PARAMS="{
+s/lock directory/;&/g
+s/lock dir/;&/g
+s/modules dir/;&/g
+s/logging/;&/g
+s/status/;&/g
+s/logdir/;&/g
+s/read prediction/;&/g
+s/mkprofile/;&/g
+s/valid chars/;&/g
+s/timesync/;&/g
+s/sambaconf/;&/g
+s/logtype/;&/g
+s/servername/;&/g
+s/postscript/;&/g
+s/setup directory/;&/g


-- 
Samba Shared Repository


More information about the samba-cvs mailing list