svn commit: samba r21215 - in branches/SAMBA_4_0/source/torture/raw: .

tridge at samba.org tridge at samba.org
Wed Feb 7 07:10:24 GMT 2007


Author: tridge
Date: 2007-02-07 07:10:23 +0000 (Wed, 07 Feb 2007)
New Revision: 21215

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21215

Log:

extend the RAW-MUX test to test cancelling a async lock request using
a SMBexit

Modified:
   branches/SAMBA_4_0/source/torture/raw/mux.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/mux.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/mux.c	2007-02-07 07:06:28 UTC (rev 21214)
+++ branches/SAMBA_4_0/source/torture/raw/mux.c	2007-02-07 07:10:23 UTC (rev 21215)
@@ -290,10 +290,13 @@
 	/* cancel the blocking lock */
 	smb_raw_ntcancel(req);
 
+	printf("sending 2nd cancel\n");
 	/* the 2nd cancel is totally harmless, but tests the server trying to 
 	   cancel an already cancelled request */
 	smb_raw_ntcancel(req);
 
+	printf("sent 2nd cancel\n");
+
 	lock[0].pid = 1;
 	io.lockx.in.ulock_cnt = 1;
 	io.lockx.in.lock_cnt = 0;
@@ -304,8 +307,33 @@
 	status = smbcli_request_simple_recv(req);
 	CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT);	
 
-	smbcli_close(cli->tree, fnum);
+	printf("cancel a lock using exit to close file\n");
+	lock[0].pid = 1;
+	io.lockx.in.ulock_cnt = 0;
+	io.lockx.in.lock_cnt = 1;
+	io.lockx.in.timeout = 1000;
 
+	status = smb_raw_lock(cli->tree, &io);
+	CHECK_STATUS(status, NT_STATUS_OK);
+
+	t = timeval_current();
+	lock[0].pid = 2;
+	req = smb_raw_lock_send(cli->tree, &io);
+
+	smb_raw_exit(cli->session);
+	smb_raw_exit(cli->session);
+	smb_raw_exit(cli->session);
+	smb_raw_exit(cli->session);
+
+	printf("recv the async reply\n");
+	status = smbcli_request_simple_recv(req);
+	CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
+	printf("async lock exit took %.2f msec\n", timeval_elapsed(&t) * 1000);
+	if (timeval_elapsed(&t) > 0.1) {
+		printf("failed to trigger early lock failure\n");
+		return False;		
+	}
+
 done:
 	return ret;
 }



More information about the samba-cvs mailing list