torture: Fix cleanup2 to utilize on-demand cleanup
[obnox/samba/samba-obnox.git] / source3 / torture / test_cleanup.c
index c5c53c3c4c40efccebb350e69746bc6908cc2319..8efdf35e080908334ea3c218e59ff8f1bede5ced 100644 (file)
@@ -157,23 +157,10 @@ bool run_cleanup2(int dummy)
        }
 
        /*
-        * Right now we don't clean up immediately. Re-open the 2nd connection.
+        * Give the suicidal smbd a bit of time to really pass away
         */
-#if 1
-       cli_shutdown(cli2);
-       if (!torture_open_connection(&cli2, 0)) {
-               return false;
-       }
-       status = cli_ntcreate(
-               cli2, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE,
-               FILE_ATTRIBUTE_NORMAL,
-               FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
-               FILE_OPEN, 0, 0, &fnum2, NULL);
-       if (!NT_STATUS_IS_OK(status)) {
-               printf("open of %s failed (%s)\n", fname, nt_errstr(status));
-               return false;
-       }
-#endif
+       smb_msleep(1000);
+
        status = cli_smbwrite(cli2, fnum2, &buf, 0, 1, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("write failed: %s\n", nt_errstr(status));