s4-torture: Separate out the notify dir subtest
authorVolker Lendecke <vl@samba.org>
Wed, 18 Apr 2012 10:19:12 +0000 (12:19 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 18 Apr 2012 11:42:13 +0000 (13:42 +0200)
source4/torture/raw/notify.c

index 6375da7baa6254a19262833766eba33fc1583386..a41630cbde346e8222e1f9c83db5ed63fabf3831 100644 (file)
@@ -63,8 +63,9 @@ do { \
 /* 
    basic testing of change notify on directories
 */
-static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2, 
-                           TALLOC_CTX *mem_ctx)
+static bool test_notify_dir(struct torture_context *mem_ctx,
+                           struct smbcli_state *cli,
+                           struct smbcli_state *cli2)
 {
        bool ret = true;
        NTSTATUS status;
@@ -77,6 +78,10 @@ static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
 
        printf("TESTING CHANGE NOTIFY ON DIRECTORIES\n");
                
+       if (!torture_setup_dir(cli, BASEDIR)) {
+               return false;
+       }
+
        /*
          get a handle on the directory
        */
@@ -265,6 +270,7 @@ static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
 
 done:
        smb_raw_exit(cli->session);
+       smbcli_deltree(cli->tree, BASEDIR);
        return ret;
 }
 
@@ -1710,7 +1716,6 @@ static bool test_raw_notify_all(struct torture_context *torture,
                return false;
        }
 
-       ret &= test_notify_dir(cli, cli2, torture);
        ret &= test_notify_mask(cli, torture);
        ret &= test_notify_recursive(cli, torture);
        ret &= test_notify_mask_change(cli, torture);
@@ -1735,6 +1740,7 @@ struct torture_suite *torture_raw_notify(TALLOC_CTX *mem_ctx)
        struct torture_suite *suite = torture_suite_create(mem_ctx, "notify");
 
        torture_suite_add_1smb_test(suite, "tcon", test_notify_tcon);
+       torture_suite_add_2smb_test(suite, "dir", test_notify_dir);
        torture_suite_add_2smb_test(suite, "all", test_raw_notify_all);
 
        return suite;