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

index dc6a4a7a9787e4a66bf368f2b2b020ae3eefbe38..b85ff5b782d8db065a84ad5eeda2fc78479f0c7d 100644 (file)
@@ -1151,7 +1151,8 @@ done:
 /* 
    test setting up two change notify requests on one handle
 */
-static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_double(struct torture_context *mem_ctx,
+                              struct smbcli_state *cli)
 {
        bool ret = true;
        NTSTATUS status;
@@ -1162,6 +1163,9 @@ static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        printf("TESTING CHANGE NOTIFY TWICE ON ONE DIRECTORY\n");
                
+       if (!torture_setup_dir(cli, BASEDIR)) {
+               return false;
+       }
        /*
          get a handle on the directory
        */
@@ -1209,6 +1213,7 @@ static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
 done:
        smb_raw_exit(cli->session);
+       smbcli_deltree(cli->tree, BASEDIR);
        return ret;
 }
 
@@ -1764,7 +1769,6 @@ static bool test_raw_notify_all(struct torture_context *torture,
                return false;
        }
 
-       ret &= test_notify_double(cli, torture);
        ret &= test_notify_tree(cli, torture);
        ret &= test_notify_overflow(cli, torture);
        ret &= test_notify_basedir(cli, torture);
@@ -1790,6 +1794,7 @@ struct torture_suite *torture_raw_notify(TALLOC_CTX *mem_ctx)
        torture_suite_add_1smb_test(suite, "exit", test_notify_exit);
        torture_suite_add_1smb_test(suite, "ulogoff", test_notify_ulogoff);
        torture_suite_add_1smb_test(suite, "tcp_dis", test_notify_tcp_dis);
+       torture_suite_add_1smb_test(suite, "double", test_notify_double);
        torture_suite_add_2smb_test(suite, "all", test_raw_notify_all);
 
        return suite;