torture3: In LOCAL-DBWRAP-WATCH1, open tdb with CLEAR_IF_FIRST
authorVolker Lendecke <vl@samba.org>
Fri, 28 Apr 2017 11:45:47 +0000 (13:45 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 1 May 2017 08:40:21 +0000 (10:40 +0200)
Also ensure we delete the temp tdb file on success.

Just make sure we start with fresh data

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
source3/torture/test_dbwrap_watch.c

index d3eac6f26f86c303644c5f01658e3b18a81a8298..88e0e1cd9fe3bacb94cf4490e3f293733e4f16bc 100644 (file)
@@ -48,7 +48,7 @@ bool run_dbwrap_watch1(int dummy)
                fprintf(stderr, "messaging_init failed\n");
                goto fail;
        }
-       backend = db_open(msg, "test_watch.tdb", 0, TDB_DEFAULT,
+       backend = db_open(msg, "test_watch.tdb", 0, TDB_CLEAR_IF_FIRST,
                          O_CREAT|O_RDWR, 0644, DBWRAP_LOCK_ORDER_1,
                          DBWRAP_FLAG_NONE);
        if (backend == NULL) {
@@ -98,6 +98,7 @@ bool run_dbwrap_watch1(int dummy)
                goto fail;
        }
 
+       (void)unlink("test_watch.tdb");
        ret = true;
 fail:
        TALLOC_FREE(req);