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)
committerVolker Lendecke <vl@samba.org>
Fri, 17 Aug 2018 08:34:53 +0000 (10:34 +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>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Aug 17 10:34:53 CEST 2018 on sn-devel-144

source3/torture/test_g_lock.c

index 6ad421946504de4277dd18eee57a5001b435661e..624f7cdd46e978855e67f3f69b9ca24155e775c6 100644 (file)
@@ -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;
 }