From: Volker Lendecke Date: Tue, 14 Aug 2018 11:54:56 +0000 (+0200) Subject: torture3: Extend the g_lock6 test to also cover upgrades X-Git-Tag: tdb-1.3.17~2119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=682fafe2b3a7b196975897d6e162392d64bec4d1;p=thirdparty%2Fsamba.git torture3: Extend the g_lock6 test to also cover upgrades The fixes for #13195 were incomplete and did not cover upgrades properly. It's all gone in master with the new code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13195 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Fri Aug 17 10:34:53 CEST 2018 on sn-devel-144 --- diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c index 6ad42194650..624f7cdd46e 100644 --- a/source3/torture/test_g_lock.c +++ b/source3/torture/test_g_lock.c @@ -865,6 +865,14 @@ bool run_g_lock6(int dummy) nt_errstr(status)); return false; } + + status = g_lock_lock(ctx, lockname, G_LOCK_READ, + (struct timeval) { .tv_sec = 1 }); + if (!NT_STATUS_IS_OK(status)) { + fprintf(stderr, "g_lock_lock failed: %s\n", + nt_errstr(status)); + return false; + } } close(exit_pipe[1]); @@ -878,6 +886,14 @@ bool run_g_lock6(int dummy) } } + 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; + } + return true; }