The branch, master has been updated
       via  682fafe torture3: Extend the g_lock6 test to also cover upgrades
       via  8734970 torture3: Enhance g_lock6 to run without CLEAR_IF_FIRST
       via  fc41281 torture3: Simplify the g_lock6 test
      from  b0130fe docs smb.conf: Clarify that wreplsrv:periodic_interval is 
in seconds

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 682fafe2b3a7b196975897d6e162392d64bec4d1
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 14 13:54:56 2018 +0200

    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 <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>
    
    Autobuild-User(master): Volker Lendecke <v...@samba.org>
    Autobuild-Date(master): Fri Aug 17 10:34:53 CEST 2018 on sn-devel-144

commit 8734970c31d3e44d2b882c41bdfe5ff22186c9ea
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 14 13:53:11 2018 +0200

    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 <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit fc41281e4fe6f71692678a63a3287f25ba4787f3
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Aug 14 13:52:11 2018 +0200

    torture3: Simplify the g_lock6 test
    
    Do string_term_tdb_data just once, this is a leftover from a sweeping
    change from "char *" to TDB_DATA as g_lock key.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13195
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/torture/test_g_lock.c | 44 ++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c
index 43e699f..624f7cd 100644
--- a/source3/torture/test_g_lock.c
+++ b/source3/torture/test_g_lock.c
@@ -730,7 +730,7 @@ bool run_g_lock6(int dummy)
        struct tevent_context *ev = NULL;
        struct messaging_context *msg = NULL;
        struct g_lock_ctx *ctx = NULL;
-       const char *lockname = "lock6";
+       TDB_DATA lockname = string_term_tdb_data("lock6");
        pid_t child;
        int exit_pipe[2], ready_pipe[2];
        NTSTATUS status;
@@ -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<nprocs; i++) {
 
@@ -780,7 +798,7 @@ bool run_g_lock6(int dummy)
                                exit(1);
                        }
                        status = g_lock_lock(ctx,
-                                            string_term_tdb_data(lockname),
+                                            lockname,
                                             G_LOCK_READ,
                                             (struct timeval) { .tv_sec = 1 });
                        if (!NT_STATUS_IS_OK(status)) {
@@ -824,8 +842,7 @@ bool run_g_lock6(int dummy)
        {
                struct lock6_parser_state state;
 
-               status = g_lock_dump(ctx, string_term_tdb_data(lockname),
-                                    lock6_parser, &state);
+               status = g_lock_dump(ctx, lockname, lock6_parser, &state);
                if (!NT_STATUS_IS_OK(status)) {
                        fprintf(stderr, "g_lock_dump returned %s\n",
                                nt_errstr(status));
@@ -838,7 +855,8 @@ bool run_g_lock6(int dummy)
                        return false;
                }
 
-               status = g_lock_lock(ctx, string_term_tdb_data(lockname),
+               status = g_lock_lock(ctx,
+                                    lockname,
                                     G_LOCK_WRITE,
                                     (struct timeval) { .tv_sec = 1 });
                if (!NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
@@ -847,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]);
@@ -860,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;
 }
 


-- 
Samba Shared Repository

Reply via email to