[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-990-g3b78dc7

Stefan Metzmacher metze at samba.org
Mon Feb 25 06:44:58 GMT 2008


The branch, v4-0-test has been updated
       via  3b78dc7ab2f8e3faffa2eb3ae2462c133e368be3 (commit)
       via  877cc375d0523cb31324a5d611e73d666e7a9a78 (commit)
      from  ba29219ea243cc217ab3522b036a82ff8dfeedc8 (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 3b78dc7ab2f8e3faffa2eb3ae2462c133e368be3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 25 07:42:38 2008 +0100

    selftest: we pass the BASE-DEFER_OPEN test
    
    We just need to pass the same sharedelay time
    to smbtorture as we use for smbd.
    
    metze

commit 877cc375d0523cb31324a5d611e73d666e7a9a78
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Feb 24 00:13:36 2008 +0100

    BASE-DEFER_OPEN: add torture:sharedelays option to run this test faster
    
    metze

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

Summary of changes:
 source/samba4-skip              |    2 --
 source/selftest/samba4_tests.sh |    5 +++--
 source/torture/basic/base.c     |   18 +++++++++++++-----
 3 files changed, 16 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/samba4-skip b/source/samba4-skip
index e3d2b18..541738e 100644
--- a/source/samba4-skip
+++ b/source/samba4-skip
@@ -1,4 +1,3 @@
-base.defer_open
 base.delaywrite
 raw.composite
 raw.oplock
@@ -18,7 +17,6 @@ base.smb
 smb2.notify
 smb2.scan
 ntvfs.cifs.base.charset
-ntvfs.cifs.base.defer_open
 ntvfs.cifs.base.delaywrite
 ntvfs.cifs.base.iometer
 ntvfs.cifs.base.casetable
diff --git a/source/selftest/samba4_tests.sh b/source/selftest/samba4_tests.sh
index c57ec4d..32386e5 100755
--- a/source/selftest/samba4_tests.sh
+++ b/source/selftest/samba4_tests.sh
@@ -216,12 +216,13 @@ done
 plantest "rpc.echo on ncacn_np over smb2" dc $smb4torture ncacn_np:"\$SERVER[smb2]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*"
 
 # Tests against the NTVFS POSIX backend
+NTVFSARGS="--option=torture:sharedelay=100000"
 smb2=`$smb4torture --list | grep "^SMB2-" | xargs`
 raw=`$smb4torture --list | grep "^RAW-" | xargs`
 base=`$smb4torture --list | grep "^BASE-" | xargs`
 
 for t in $base $raw $smb2; do
-    plansmbtorturetest "$t" dc $ADDARGS //\$SERVER/tmp -U"\$USERNAME"%"\$PASSWORD"
+    plansmbtorturetest "$t" dc $ADDARGS //\$SERVER/tmp -U"\$USERNAME"%"\$PASSWORD" $NTVFSARGS
 done
 
 rap=`$smb4torture --list | grep "^RAP-" | xargs`
@@ -231,7 +232,7 @@ done
 
 # Tests against the NTVFS CIFS backend
 for t in $base $raw; do
-    plantest "ntvfs.cifs.`normalize_testname $t`" dc $VALGRIND $smb4torture //\$NETBIOSNAME/cifs -U"\$USERNAME"%"\$PASSWORD" $t
+    plantest "ntvfs.cifs.`normalize_testname $t`" dc $VALGRIND $smb4torture //\$NETBIOSNAME/cifs -U"\$USERNAME"%"\$PASSWORD" $NTVFSARGS $t
 done
 
 # Local tests
diff --git a/source/torture/basic/base.c b/source/torture/basic/base.c
index aa729ec..42d7dda 100644
--- a/source/torture/basic/base.c
+++ b/source/torture/basic/base.c
@@ -633,6 +633,13 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli
 	int retries=4;
 	int i = 0;
 	bool correct = true;
+	int nsec;
+	int msec;
+	double sec;
+
+	nsec = torture_setting_int(tctx, "sharedelay", 1000000);
+	msec = nsec / 1000;
+	sec = ((double)nsec) / ((double) 1000000);
 
 	if (retries <= 0) {
 		torture_comment(tctx, "failed to connect\n");
@@ -657,9 +664,10 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli
 			}
 			if (NT_STATUS_EQUAL(smbcli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION)) {
 				double e = timeval_elapsed(&tv);
-				if (e < 0.5 || e > 1.5) {
-					torture_comment(tctx,"Timing incorrect %.2f violation\n",
-						e);
+				if (e < (0.5 * sec) || e > (1.5 * sec)) {
+					torture_comment(tctx,"Timing incorrect %.2f violation 1 sec == %.2f\n",
+						e, sec);
+					return false;
 				}
 			}
 		} while (NT_STATUS_EQUAL(smbcli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION));
@@ -671,13 +679,13 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli
 
 		torture_comment(tctx, "pid %u open %d\n", (unsigned)getpid(), i);
 
-		sleep(10);
+		msleep(10 * msec);
 		i++;
 		if (NT_STATUS_IS_ERR(smbcli_close(cli->tree, fnum))) {
 			torture_comment(tctx,"Failed to close %s, error=%s\n", fname, smbcli_errstr(cli->tree));
 			return false;
 		}
-		sleep(2);
+		msleep(2 * msec);
 	}
 
 	if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, fname))) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list