[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-267-gc96534c

Stefan Metzmacher metze at samba.org
Fri Jan 30 19:07:56 GMT 2009


The branch, master has been updated
       via  c96534cd6e3eb3bef88ee538838519437870a085 (commit)
       via  c0fdc71ecdf437c978ade36603f0280afb1addb5 (commit)
       via  50db8ede23dd9bf28a4f329edebb9105be215d3e (commit)
      from  2fe137e7bce425adf9cc64664eb493dfa8a7e885 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c96534cd6e3eb3bef88ee538838519437870a085
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 30 14:00:32 2009 +0100

    s3:selftest: run the same tests as 'make test'
    
    Only the tests with samba4's smbtorture are missing.
    
    metze

commit c0fdc71ecdf437c978ade36603f0280afb1addb5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 30 13:57:24 2009 +0100

    s3:tests: add a guard arround . $incdir/test_functions.sh
    
    So that caller can overwrite the functions.
    
    metze

commit 50db8ede23dd9bf28a4f329edebb9105be215d3e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 30 14:36:48 2009 +0100

    s3:smbconftort: don't use reserved words ('test:', 'failure:', 'success:')
    
    Temporary results printfs should not contain reserved subunit words.
    
    metze

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

Summary of changes:
 source3/lib/smbconf/testsuite.c            |   60 ++++++++---------
 source3/script/tests/test_functions.sh     |    1 +
 source3/script/tests/test_local_s3.sh      |    2 +
 source3/script/tests/test_net_misc.sh      |    2 +
 source3/script/tests/test_net_registry.sh  |    2 +
 source3/script/tests/test_net_s3.sh        |    2 +
 source3/script/tests/test_ntlm_auth_s3.sh  |    2 +
 source3/script/tests/test_posix_s3.sh      |    2 +
 source3/script/tests/test_smbclient_s3.sh  |    2 +
 source3/script/tests/test_smbtorture_s3.sh |    2 +
 source3/script/tests/test_testparm_s3.sh   |    2 +
 source3/script/tests/test_wbinfo_s3.sh     |    2 +
 source3/selftest/tests.sh                  |  102 ++++++++++++++++++++--------
 13 files changed, 123 insertions(+), 60 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c
index 3d3c2d0..b31dec0 100644
--- a/source3/lib/smbconf/testsuite.c
+++ b/source3/lib/smbconf/testsuite.c
@@ -41,11 +41,11 @@ static bool test_get_includes(struct smbconf_ctx *ctx)
 	char **includes = NULL;
 	TALLOC_CTX *mem_ctx = talloc_stackframe();
 
-	printf("test: get_includes\n");
+	printf("TEST: get_includes\n");
 	werr = smbconf_get_global_includes(ctx, mem_ctx,
 					   &num_includes, &includes);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: get_includes - %s\n", win_errstr(werr));
+		printf("FAIL: get_includes - %s\n", win_errstr(werr));
 		goto done;
 	}
 
@@ -53,7 +53,7 @@ static bool test_get_includes(struct smbconf_ctx *ctx)
 	       (num_includes > 0) ? ":" : ".");
 	print_strings("", num_includes, (const char **)includes);
 
-	printf("success: get_includes\n");
+	printf("OK: get_includes\n");
 	ret = true;
 
 done:
@@ -75,11 +75,11 @@ static bool test_set_get_includes(struct smbconf_ctx *ctx)
 	uint32_t get_num_includes = 0;
 	TALLOC_CTX *mem_ctx = talloc_stackframe();
 
-	printf("test: set_get_includes\n");
+	printf("TEST: set_get_includes\n");
 
 	werr = smbconf_set_global_includes(ctx, set_num_includes, set_includes);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: get_set_includes (setting includes) - %s\n",
+		printf("FAIL: get_set_includes (setting includes) - %s\n",
 		       win_errstr(werr));
 		goto done;
 	}
@@ -87,13 +87,13 @@ static bool test_set_get_includes(struct smbconf_ctx *ctx)
 	werr = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes,
 					   &get_includes);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: get_set_includes (getting includes) - %s\n",
+		printf("FAIL: get_set_includes (getting includes) - %s\n",
 		       win_errstr(werr));
 		goto done;
 	}
 
 	if (get_num_includes != set_num_includes) {
-		printf("failure: get_set_includes - set %d includes, got %d\n",
+		printf("FAIL: get_set_includes - set %d includes, got %d\n",
 		       set_num_includes, get_num_includes);
 		goto done;
 	}
@@ -105,12 +105,12 @@ static bool test_set_get_includes(struct smbconf_ctx *ctx)
 			printf("got: \n");
 			print_strings("* ", get_num_includes,
 				      (const char **)get_includes);
-			printf("failure: get_set_includes - data mismatch:\n");
+			printf("FAIL: get_set_includes - data mismatch:\n");
 			goto done;
 		}
 	}
 
-	printf("success: set_includes\n");
+	printf("OK: set_includes\n");
 	ret = true;
 
 done:
@@ -130,18 +130,18 @@ static bool test_delete_includes(struct smbconf_ctx *ctx)
 	uint32_t get_num_includes = 0;
 	TALLOC_CTX *mem_ctx = talloc_stackframe();
 
-	printf("test: delete_includes\n");
+	printf("TEST: delete_includes\n");
 
 	werr = smbconf_set_global_includes(ctx, set_num_includes, set_includes);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: delete_includes (setting includes) - %s\n",
+		printf("FAIL: delete_includes (setting includes) - %s\n",
 		       win_errstr(werr));
 		goto done;
 	}
 
 	werr = smbconf_delete_global_includes(ctx);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: delete_includes (deleting includes) - %s\n",
+		printf("FAIL: delete_includes (deleting includes) - %s\n",
 		       win_errstr(werr));
 		goto done;
 	}
@@ -149,24 +149,24 @@ static bool test_delete_includes(struct smbconf_ctx *ctx)
 	werr = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes,
 					   &get_includes);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: delete_includes (getting includes) - %s\n",
+		printf("FAIL: delete_includes (getting includes) - %s\n",
 		       win_errstr(werr));
 		goto done;
 	}
 
 	if (get_num_includes != 0) {
-		printf("failure: delete_includes (not empty after delete)\n");
+		printf("FAIL: delete_includes (not empty after delete)\n");
 		goto done;
 	}
 
 	werr = smbconf_delete_global_includes(ctx);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failuer: delete_includes (delete empty includes) - "
+		printf("FAIL: delete_includes (delete empty includes) - "
 		       "%s\n", win_errstr(werr));
 		goto done;
 	}
 
-	printf("success: delete_includes\n");
+	printf("OK: delete_includes\n");
 	ret = true;
 
 done:
@@ -177,7 +177,7 @@ static bool create_conf_file(const char *filename)
 {
 	FILE *f;
 
-	printf("creating file\n");
+	printf("TEST: creating file\n");
 	f = sys_fopen(filename, "w");
 	if (!f) {
 		printf("failure: failed to open %s for writing: %s\n",
@@ -192,7 +192,7 @@ static bool create_conf_file(const char *filename)
 
 	fclose(f);
 
-	printf("success: create file\n");
+	printf("OK: create file\n");
 	return true;
 }
 
@@ -211,30 +211,29 @@ static bool torture_smbconf_txt(void)
 		goto done;
 	}
 
-	printf("test: init\n");
+	printf("TEST: init\n");
 	werr = smbconf_init_txt(mem_ctx, &conf_ctx, filename);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: init failed: %s\n", win_errstr(werr));
+		printf("FAIL: text backend\[ failed: %s\n", win_errstr(werr));
 		ret = false;
 		goto done;
 	}
-	printf("success: init\n");
+	printf("OK: init\n");
 
 	ret &= test_get_includes(conf_ctx);
 
 	smbconf_shutdown(conf_ctx);
 
-	printf("unlinking file\n");
+	printf("TEST: unlink file\n");
 	if (unlink(filename) != 0) {
-		printf("failure: unlink failed: %s\n", strerror(errno));
+		printf("OK: unlink failed: %s\n", strerror(errno));
 		ret = false;
 		goto done;
 	}
-	printf("success: unlink file\n");
-
-	printf("%s: text backend\n", ret ? "success" : "failure");
+	printf("OK: unlink file\n");
 
 done:
+	printf("%s: text backend\n", ret ? "success" : "failure");
 	talloc_free(mem_ctx);
 	return ret;
 }
@@ -248,14 +247,14 @@ static bool torture_smbconf_reg(void)
 
 	printf("test: registry backend\n");
 
-	printf("test: init\n");
+	printf("TEST: init\n");
 	werr = smbconf_init_reg(mem_ctx, &conf_ctx, NULL);
 	if (!W_ERROR_IS_OK(werr)) {
-		printf("failure: init failed: %s\n", win_errstr(werr));
+		printf("FAIL: init failed: %s\n", win_errstr(werr));
 		ret = false;
 		goto done;
 	}
-	printf("success: init\n");
+	printf("OK: init\n");
 
 	ret &= test_get_includes(conf_ctx);
 	ret &= test_set_get_includes(conf_ctx);
@@ -263,9 +262,8 @@ static bool torture_smbconf_reg(void)
 
 	smbconf_shutdown(conf_ctx);
 
-	printf("%s: registry backend\n", ret ? "success" : "failure");
-
 done:
+	printf("%s: registry backend\n", ret ? "success" : "failure");
 	talloc_free(mem_ctx);
 	return ret;
 }
diff --git a/source3/script/tests/test_functions.sh b/source3/script/tests/test_functions.sh
index 79642e0..bddae18 100644
--- a/source3/script/tests/test_functions.sh
+++ b/source3/script/tests/test_functions.sh
@@ -1,3 +1,4 @@
+TEST_FUNCTIONS_SH="INCLUDED"
 
 samba3_stop_sig_term() {
 	RET=0
diff --git a/source3/script/tests/test_local_s3.sh b/source3/script/tests/test_local_s3.sh
index aed8637..1840779 100755
--- a/source3/script/tests/test_local_s3.sh
+++ b/source3/script/tests/test_local_s3.sh
@@ -9,8 +9,10 @@ EOF
 exit 1;
 fi
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_net_misc.sh b/source3/script/tests/test_net_misc.sh
index 9f5fdfe..8d092f4 100755
--- a/source3/script/tests/test_net_misc.sh
+++ b/source3/script/tests/test_net_misc.sh
@@ -7,8 +7,10 @@ NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
 NETTIME="${NET} time"
 NETLOOKUP="${NET} lookup"
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh
index 22081ec..a3d1a24 100755
--- a/source3/script/tests/test_net_registry.sh
+++ b/source3/script/tests/test_net_registry.sh
@@ -15,8 +15,10 @@ else
 	NETREG="${NET} registry"
 fi
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_net_s3.sh b/source3/script/tests/test_net_s3.sh
index f7dc2b7..a0e83a6 100755
--- a/source3/script/tests/test_net_s3.sh
+++ b/source3/script/tests/test_net_s3.sh
@@ -2,8 +2,10 @@
 
 # tests for the "net" command
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_ntlm_auth_s3.sh b/source3/script/tests/test_ntlm_auth_s3.sh
index 6c97f2e..c7ebc03 100755
--- a/source3/script/tests/test_ntlm_auth_s3.sh
+++ b/source3/script/tests/test_ntlm_auth_s3.sh
@@ -1,7 +1,9 @@
 #!/bin/sh
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh
index 3e99986..0885b13 100755
--- a/source3/script/tests/test_posix_s3.sh
+++ b/source3/script/tests/test_posix_s3.sh
@@ -16,8 +16,10 @@ start="$4"
 shift 4
 ADDARGS="$*"
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 base="BASE-ATTR BASE-CHARSET BASE-CHKPATH BASE-DEFER_OPEN BASE-DELAYWRITE BASE-DELETE"
 base="$base BASE-DENY1 BASE-DENY2 BASE-DENY3 BASE-DENYDOS BASE-DIR1 BASE-DIR2"
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 1d55087..f60c7d7 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -17,8 +17,10 @@ SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
 shift 4
 ADDARGS="$*"
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh
index 2ec20dc..842277b 100755
--- a/source3/script/tests/test_smbtorture_s3.sh
+++ b/source3/script/tests/test_smbtorture_s3.sh
@@ -16,8 +16,10 @@ start="$4"
 shift 4
 ADDARGS="$*"
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7"
 #tests="$tests UNLINK BROWSE ATTR TRANS2 MAXFID TORTURE "
diff --git a/source3/script/tests/test_testparm_s3.sh b/source3/script/tests/test_testparm_s3.sh
index 6ea2794..c88fc2d 100755
--- a/source3/script/tests/test_testparm_s3.sh
+++ b/source3/script/tests/test_testparm_s3.sh
@@ -8,8 +8,10 @@
 TEMP_CONFFILE=${LIBDIR}/smb.conf.tmp
 TESTPARM="$VALGRIND ${TESTPARM:-$BINDIR/testparm} --suppress-prompt --skip-logic-checks"
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 failed=0
 
diff --git a/source3/script/tests/test_wbinfo_s3.sh b/source3/script/tests/test_wbinfo_s3.sh
index e3bf1b9..fa6e20f 100755
--- a/source3/script/tests/test_wbinfo_s3.sh
+++ b/source3/script/tests/test_wbinfo_s3.sh
@@ -14,8 +14,10 @@ password="$4"
 shift 4
 ADDARGS="$*"
 
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
 incdir=`dirname $0`
 . $incdir/test_functions.sh
+}
 
 OLDIFS=$IFS;
 
diff --git a/source3/selftest/tests.sh b/source3/selftest/tests.sh
index e07dee6..c4907a1 100755
--- a/source3/selftest/tests.sh
+++ b/source3/selftest/tests.sh
@@ -44,44 +44,88 @@ normalize_testname() {
 	echo $name | tr "A-Z-" "a-z."
 }
 
-BINDIR=`dirname $0`/../bin
-SCRIPTDIR=`dirname $0`/../script/tests
-export SCRIPTDIR
+TEST_FUNCTIONS_SH="INCLUDED"
+testit() {
+	name=$1
+	shift 1
+	cmdline="$*"
 
-plantest "talloctort3" none $VALGRIND $BINDIR/talloctort
-plantest "replacetort3" none $VALGRIND $BINDIR/replacetort
-plantest "tdbtorture3" none $VALGRIND $BINDIR/tdbtorture
-plantest "smbconftort3" none $VALGRIND $BINDIR/smbconftort -s \$SMB_CONF_PATH
+	plantest "`normalize_testname $testitprefix$name`" $testitenv $cmdline
+	return
+}
+
+testok() {
+	true
+	return
+}
 
-tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7"
-tests="$tests UNLINK BROWSE ATTR TRANS2 TORTURE "
-tests="$tests OPLOCK1 OPLOCK2 OPLOCK3"
-tests="$tests DIR DIR1 TCON TCONDEV RW1 RW2 RW3"
-tests="$tests OPEN XCOPY RENAME DELETE PROPERTIES W2K"
-tests="$tests TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE"
+BINDIR=`dirname $0`/../bin
+export BINDIR
 
-for t in $tests; do
-    name=`normalize_testname smbtorture3.plain.$t`
-    plantest "$name" dc $VALGRIND $BINDIR/smbtorture //\$SERVER/tmp -U\$USERNAME%\$PASSWORD $t
-done
+SCRIPTDIR=`dirname $0`/../script/tests
+export SCRIPTDIR
 
-for t in $tests; do
-    name=`normalize_testname smbtorture3.crypt.$t`
-    plantest "$name" dc $VALGRIND $BINDIR/smbtorture //\$SERVER/tmp -U\$USERNAME%\$PASSWORD $t
-done
+CONFIGURATION="--configfile \$SMB_CONF_PATH"
+export CONFIGURATION
+
+CONFFILE="\$SMB_CONF_PATH"
+export CONFFILE
+
+SERVER="\$SERVER"
+export SERVER
+
+USERNAME="\$USERNAME"
+export USERNAME
+
+PASSWORD="\$PASSWORD"
+export PASSWORD
+
+(
+	shift $#
+	testitprefix="local_s3."
+	testitenv="none"
+	. $SCRIPTDIR/test_local_s3.sh
+)
+
+(
+	shift $#
+	testitprefix="smbtorture_s3.plain."
+	testitenv="dc"
+	. $SCRIPTDIR/test_smbtorture_s3.sh //\$SERVER_IP/tmp \$USERNAME \$PASSWORD ""
+)
+
+(
+	shift $#
+	testitprefix="smbtorture_s3.crypt."
+	testitenv="dc"
+	. $SCRIPTDIR/test_smbtorture_s3.sh //\$SERVER_IP/tmp \$USERNAME \$PASSWORD "-e"
+)
+
+(
+	shift $#
+	testitprefix="wbinfo_s3."
+	testitenv="dc:local"
+	. $SCRIPTDIR/test_wbinfo_s3.sh \$WORKGROUP \$SERVER \$USERNAME \$PASSWORD
+)
+
+(
+	shift $#
+	testitprefix="ntlm_auth_s3."
+	testitenv="dc:local"
+	. $SCRIPTDIR/test_ntlm_auth_s3.sh
+)
 
 # plain
-plantest "blackbox.smbclient3.plain" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD
-plantest "blackbox.smbclient3.plain member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD
-plantest "blackbox.smbclient3.plain domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD
+plantest "blackbox.smbclient_s3.plain" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD
+plantest "blackbox.smbclient_s3.plain member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD
+plantest "blackbox.smbclient_s3.plain domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD
 
 # encrypted
-plantest "blackbox.smbclient3.crypt" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD "-e"
+plantest "blackbox.smbclient_s3.crypt" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD "-e"
 
 # these don't work yet
-#plantest "blackbox.smbclient3.crypt member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD "-e"
-#plantest "blackbox.smbclient3.crypt domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD "-e"
+#plantest "blackbox.smbclient_s3.crypt member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD "-e"
+#plantest "blackbox.smbclient_s3.crypt domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD "-e"
 
-plantest "blackbox.wbinfo3" dc BINDIR="$BINDIR" script/tests/test_wbinfo_s3.sh \$DOMAIN \$SERVER \$USERNAME \$PASSWORD
-plantest "blackbox.net3" dc BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" script/tests/test_net_s3.sh
+plantest "blackbox.net_s3" dc BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" script/tests/test_net_s3.sh
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list