Revert "works on all."
authorStefan Metzmacher <metze@samba.org>
Fri, 15 Feb 2019 15:59:40 +0000 (16:59 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 15 Oct 2019 07:36:38 +0000 (09:36 +0200)
This reverts commit b00999116c493fb8fc0d65367c3ab4453a3086ce.

source4/torture/smb2/notify.c

index 950ee2b83a64e456f714c6dba93d43afbfcb0aac..9edc19087464fe64ce313ced21425a7f5dc29904 100644 (file)
@@ -114,7 +114,7 @@ static bool test_valid_request(struct torture_context *torture,
                }
        }
 
-       status = torture_setup_simple_file(torture, tree, FNAME);
+       status = torture_setup_complex_file(torture, tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
        status = smb2_notify_recv(req, torture, &n);
@@ -128,7 +128,6 @@ static bool test_valid_request(struct torture_context *torture,
         * NOTIFY_ENUM_DIR is returned.
         */
        n.in.buffer_size        = 0x00000000;
-       n.in.buffer_size        = max_buffer_size;
        req = smb2_notify_send(tree, &n);
 
        while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
@@ -137,27 +136,11 @@ static bool test_valid_request(struct torture_context *torture,
                }
        }
 
-       status = smb2_notify_recv(req, torture, &n);
-       //CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
+       status = torture_setup_complex_file(torture, tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
-       CHECK_VAL(n.out.num_changes, 1);
-       CHECK_VAL(n.out.changes[0].action, NOTIFY_ACTION_MODIFIED);
-       CHECK_WIRE_STR(n.out.changes[0].name, FNAME);
-
-//     n.in.buffer_size        = 0x00000000;
-//     req = smb2_notify_send(tree, &n);
-//
-//     while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
-//             if (tevent_loop_once(torture->ev) != 0) {
-//                     break;
-//             }
-//     }
-//
-//     status = smb2_notify_recv(req, torture, &n);
-//     CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
 
-       status = torture_setup_simple_file(torture, tree, FNAME);
-       CHECK_STATUS(status, NT_STATUS_OK);
+       status = smb2_notify_recv(req, torture, &n);
+       CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
 
        /*
         * if the change response fits in the buffer we get
@@ -172,7 +155,7 @@ static bool test_valid_request(struct torture_context *torture,
                }
        }
 
-       status = torture_setup_simple_file(torture, tree, FNAME);
+       status = torture_setup_complex_file(torture, tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
        status = smb2_notify_recv(req, torture, &n);
@@ -193,7 +176,6 @@ static bool test_valid_request(struct torture_context *torture,
 
        n.in.recursive          = 0x0000;
        n.in.buffer_size        = 0x00000001;
-       n.in.buffer_size        = max_buffer_size;
        n.in.file.handle        = dh;
        n.in.completion_filter  = FILE_NOTIFY_CHANGE_ALL;
        n.in.unknown            = 0x00000000;
@@ -205,15 +187,11 @@ static bool test_valid_request(struct torture_context *torture,
                }
        }
 
-       status = torture_setup_simple_file(torture, tree, FNAME);
+       status = torture_setup_complex_file(torture, tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
        status = smb2_notify_recv(req, torture, &n);
-       //CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
-       CHECK_STATUS(status, NT_STATUS_OK);
-       CHECK_VAL(n.out.num_changes, 1);
-       CHECK_VAL(n.out.changes[0].action, NOTIFY_ACTION_REMOVED);
-       CHECK_WIRE_STR(n.out.changes[0].name, FNAME);
+       CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
 
        n.in.buffer_size        = max_buffer_size;
        req = smb2_notify_send(tree, &n);
@@ -223,17 +201,11 @@ static bool test_valid_request(struct torture_context *torture,
                }
        }
 
-       status = torture_setup_simple_file(torture, tree, FNAME);
+       status = torture_setup_complex_file(torture, tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
        status = smb2_notify_recv(req, torture, &n);
-       //CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
-       CHECK_STATUS(status, NT_STATUS_OK);
-       CHECK_VAL(n.out.num_changes, 2);
-       CHECK_VAL(n.out.changes[0].action, NOTIFY_ACTION_ADDED);
-       CHECK_WIRE_STR(n.out.changes[0].name, FNAME);
-       CHECK_VAL(n.out.changes[1].action, NOTIFY_ACTION_MODIFIED);
-       CHECK_WIRE_STR(n.out.changes[1].name, FNAME);
+       CHECK_STATUS(status, STATUS_NOTIFY_ENUM_DIR);
 
        /* if the buffer size is too large, we get invalid parameter */
        n.in.recursive          = 0x0000;