From 8734970c31d3e44d2b882c41bdfe5ff22186c9ea Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 14 Aug 2018 13:53:11 +0200 Subject: [PATCH] torture3: Enhance g_lock6 to run without CLEAR_IF_FIRST CLEAR_IF_FIRST doesn't really work in the cluster. This needs to be applied to all tests, but lock6 is what I care about right now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13195 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- source3/torture/test_g_lock.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c index ed1cd180f54..6ad42194650 100644 --- a/source3/torture/test_g_lock.c +++ b/source3/torture/test_g_lock.c @@ -751,6 +751,24 @@ bool run_g_lock6(int dummy) return false; } + /* + * Wipe all stale locks -- in clustered mode there's no + * CLEAR_IF_FIRST + */ + status = g_lock_lock(ctx, lockname, G_LOCK_WRITE, + (struct timeval) { .tv_sec = 1 }); + if (!NT_STATUS_IS_OK(status)) { + fprintf(stderr, "g_lock_lock failed: %s\n", + nt_errstr(status)); + return false; + } + status = g_lock_unlock(ctx, lockname); + if (!NT_STATUS_IS_OK(status)) { + fprintf(stderr, "g_lock_unlock failed: %s\n", + nt_errstr(status)); + return false; + } + nprocs = 2; for (i=0; i