]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture3: Extend the g_lock6 test to also cover upgrades
authorVolker Lendecke <vl@samba.org>
Tue, 14 Aug 2018 11:54:56 +0000 (13:54 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 23 Aug 2018 08:39:30 +0000 (10:39 +0200)
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 <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
selftest/knownfail.d/local-g-lock6 [new file with mode: 0644]
source3/torture/test_g_lock.c

diff --git a/selftest/knownfail.d/local-g-lock6 b/selftest/knownfail.d/local-g-lock6
new file mode 100644 (file)
index 0000000..14fd5c8
--- /dev/null
@@ -0,0 +1 @@
+^samba3.smbtorture_s3.LOCAL-G-LOCK6.smbtorture
index 1134e0d07162de1ca65848231587a5cdd9423405..b3b0d793fbd3bd09e3249ae5650152a0b78dcd9d 100644 (file)
@@ -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;
 }