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: samba-4.7.10~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4eed27367822c1829778cb0599c962b54e17f6;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 --- diff --git a/selftest/knownfail.d/local-g-lock6 b/selftest/knownfail.d/local-g-lock6 new file mode 100644 index 00000000000..14fd5c869d6 --- /dev/null +++ b/selftest/knownfail.d/local-g-lock6 @@ -0,0 +1 @@ +^samba3.smbtorture_s3.LOCAL-G-LOCK6.smbtorture diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c index 1134e0d0716..b3b0d793fbd 100644 --- a/source3/torture/test_g_lock.c +++ b/source3/torture/test_g_lock.c @@ -779,6 +779,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]); @@ -792,5 +800,13 @@ 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; }