svn commit: samba r16981 - in branches/SAMBA_4_0/source/torture/smb2: .

metze at samba.org metze at samba.org
Wed Jul 12 14:32:21 GMT 2006


Author: metze
Date: 2006-07-12 14:32:21 +0000 (Wed, 12 Jul 2006)
New Revision: 16981

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

Log:
check the returned values

metze
Modified:
   branches/SAMBA_4_0/source/torture/smb2/notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/smb2/notify.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smb2/notify.c	2006-07-12 14:25:50 UTC (rev 16980)
+++ branches/SAMBA_4_0/source/torture/smb2/notify.c	2006-07-12 14:32:21 UTC (rev 16981)
@@ -43,6 +43,14 @@
 		goto done; \
 	}} while (0)
 
+#define CHECK_WIRE_STR(field, value) do { \
+	if (!field.s || strcmp(field.s, value)) { \
+		printf("(%s) %s [%s] != %s\n", \
+			  __location__, #field, field.s, value); \
+		ret = False; \
+		goto done; \
+	}} while (0)
+
 #define FNAME "smb2-notify01.dat"
 
 static BOOL test_valid_request(TALLOC_CTX *mem_ctx, struct smb2_tree *tree)
@@ -68,6 +76,9 @@
 
 	status = smb2_notify_recv(req, mem_ctx, &n);
 	CHECK_STATUS(status, NT_STATUS_OK);
+	CHECK_VALUE(n.out.num_changes, 1);
+	CHECK_VALUE(n.out.changes[0].action, NOTIFY_ACTION_REMOVED);
+	CHECK_WIRE_STR(n.out.changes[0].name, FNAME);
 
 	/* 
 	 * if the change response doesn't fit in the buffer
@@ -94,10 +105,17 @@
 
 	status = smb2_notify_recv(req, mem_ctx, &n);
 	CHECK_STATUS(status, NT_STATUS_OK);
+	CHECK_VALUE(n.out.num_changes, 3);
+	CHECK_VALUE(n.out.changes[0].action, NOTIFY_ACTION_REMOVED);
+	CHECK_WIRE_STR(n.out.changes[0].name, FNAME);
+	CHECK_VALUE(n.out.changes[1].action, NOTIFY_ACTION_ADDED);
+	CHECK_WIRE_STR(n.out.changes[1].name, FNAME);
+	CHECK_VALUE(n.out.changes[2].action, NOTIFY_ACTION_MODIFIED);
+	CHECK_WIRE_STR(n.out.changes[2].name, FNAME);
 
 	/* if the first notify returns NOTIFY_ENUM_DIR, all do */
 	status = smb2_util_close(tree, dh);
-	CHECK_STATUS(status, NT_STATUS_OK);	
+	CHECK_STATUS(status, NT_STATUS_OK);
 	status = smb2_util_roothandle(tree, &dh);
 	CHECK_STATUS(status, NT_STATUS_OK);
 



More information about the samba-cvs mailing list