The branch, master has been updated
       via  f994f0a Fix the local-memcache test for 64-bit
       via  c790b3c s3: Run the CLEANUP2 test
       via  f97216e s3: Add a test for proper brlock cleanup
       via  515dfe6 s3: Clarify what CLEANUP1 does
      from  5a8c881 Add some debug to vfs_aio_pthread so I can see when jobs 
start and stop.

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


- Log -----------------------------------------------------------------
commit f994f0a3424b235c48f68beef7817f245fc0a47c
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 5 13:12:26 2012 +0100

    Fix the local-memcache test for 64-bit
    
    The memcache test walks the purge functionality. The maximum memcache size 
also
    takes all memcache internal headers into account. Those headers contain
    pointers, so on 64-bit they take more space...
    
    Autobuild-User: Volker Lendecke <[email protected]>
    Autobuild-Date: Thu Jan  5 22:01:00 CET 2012 on sn-devel-104

commit c790b3c8a76542f06f3ced640500969aaa68a4fe
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 5 17:47:16 2012 +0100

    s3: Run the CLEANUP2 test

commit f97216eb4ae1052e435d83ce51a7067fa6697ff4
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 5 17:44:44 2012 +0100

    s3: Add a test for proper brlock cleanup
    
    We need to improve the server here.
    
    Maybe we should validate the brlock entry whenever we detect a read/write 
being
    blocked from locking? This is not our hot code path anyway, and it would 
gain
    us significant robustness. The code might become quite a bit simpler as 
well.

commit 515dfe6c7ff9f6aed94a51960bb26aabb6fb449b
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 5 15:46:22 2012 +0100

    s3: Clarify what CLEANUP1 does

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

Summary of changes:
 selftest/knownfail             |    1 -
 source3/selftest/tests.py      |    1 +
 source3/torture/proto.h        |    1 +
 source3/torture/test_cleanup.c |   90 +++++++++++++++++++++++++++++++++++++++-
 source3/torture/torture.c      |    3 +-
 5 files changed, 93 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/knownfail b/selftest/knownfail
index 220df1c..4a9f99e 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -6,7 +6,6 @@
 
 ^samba3.blackbox.failure.failure # this is designed to fail, for testing our 
test infrastructure
 .*driver.add_driver_timestamps # we only can store dates, not timestamps
-^samba3.smbtorture_s3.LOCAL-MEMCACHE #fails
 ^samba3.smbtorture_s3.LOCAL-TALLOC-DICT #fails
 ^samba3.posix_s3.nbt.dgram.*netlogon2
 ^samba3.*rap.sam.*.useradd # Not provided by Samba 3
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 61bd1bb..ea14cc6 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -63,6 +63,7 @@ tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", 
"LOCK5", "LOCK6", "LOCK7",
         "LOCAL-BASE64", "LOCAL-GENCACHE", "POSIX-APPEND",
         "CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", 
"SMB2-NEGPROT",
         "CLEANUP1",
+        "CLEANUP2",
         "BAD-NBT-SESSION"]
 
 for t in tests:
diff --git a/source3/torture/proto.h b/source3/torture/proto.h
index 19e7a72..8d661aa 100644
--- a/source3/torture/proto.h
+++ b/source3/torture/proto.h
@@ -102,5 +102,6 @@ bool run_smb2_session_reauth(int dummy);
 bool run_local_conv_auth_info(int dummy);
 bool run_local_sprintf_append(int dummy);
 bool run_cleanup1(int dummy);
+bool run_cleanup2(int dummy);
 
 #endif /* __TORTURE_H__ */
diff --git a/source3/torture/test_cleanup.c b/source3/torture/test_cleanup.c
index 7248676..2b4989e 100644
--- a/source3/torture/test_cleanup.c
+++ b/source3/torture/test_cleanup.c
@@ -22,6 +22,7 @@
 #include "system/filesys.h"
 #include "libsmb/libsmb.h"
 #include "libcli/smb/smbXcli_base.h"
+#include "libcli/security/security.h"
 
 bool run_cleanup1(int dummy)
 {
@@ -30,7 +31,8 @@ bool run_cleanup1(int dummy)
        uint16_t fnum;
        NTSTATUS status;
 
-       printf("Starting cleanup1 test\n");
+       printf("CLEANUP1: Checking that a conflicting share mode is cleaned "
+              "up\n");
 
        if (!torture_open_connection(&cli, 0)) {
                return false;
@@ -67,3 +69,89 @@ done:
        torture_close_connection(cli);
        return NT_STATUS_IS_OK(status);
 }
+
+bool run_cleanup2(int dummy)
+{
+       struct cli_state *cli1, *cli2;
+       const char *fname = "\\cleanup2";
+       uint16_t fnum1, fnum2;
+       NTSTATUS status;
+       char buf;
+
+       printf("CLEANUP2: Checking that a conflicting brlock is cleaned up\n");
+
+       if (!torture_open_connection(&cli1, 0)) {
+               return false;
+       }
+       status = cli_ntcreate(
+               cli1, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE,
+               FILE_ATTRIBUTE_NORMAL,
+               FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
+               FILE_OVERWRITE_IF, 0, 0, &fnum1);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("open of %s failed (%s)\n", fname, nt_errstr(status));
+               return false;
+       }
+       status = cli_lock32(cli1, fnum1, 0, 1, 0, WRITE_LOCK);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("lock failed (%s)\n", nt_errstr(status));
+               return false;
+       }
+
+       /*
+        * Check the file is indeed locked
+        */
+       if (!torture_open_connection(&cli2, 0)) {
+               return false;
+       }
+       status = cli_ntcreate(
+               cli2, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE,
+               FILE_ATTRIBUTE_NORMAL,
+               FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
+               FILE_OPEN, 0, 0, &fnum2);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("open of %s failed (%s)\n", fname, nt_errstr(status));
+               return false;
+       }
+       buf = 'x';
+       status = cli_smbwrite(cli2, fnum2, &buf, 0, 1, NULL);
+       if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_LOCK_CONFLICT)) {
+               printf("write succeeded\n");
+               return false;
+       }
+
+       /*
+        * Kill the lock holder
+        */
+       status = smbXcli_conn_samba_suicide(cli1->conn, 1);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("smbXcli_conn_samba_suicide failed: %s\n",
+                      nt_errstr(status));
+               return false;
+       }
+
+       /*
+        * Right now we don't clean up immediately. Re-open the 2nd connection.
+        */
+#if 1
+       cli_shutdown(cli2);
+       if (!torture_open_connection(&cli2, 0)) {
+               return false;
+       }
+       status = cli_ntcreate(
+               cli2, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE,
+               FILE_ATTRIBUTE_NORMAL,
+               FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
+               FILE_OPEN, 0, 0, &fnum2);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("open of %s failed (%s)\n", fname, nt_errstr(status));
+               return false;
+       }
+#endif
+       status = cli_smbwrite(cli2, fnum2, &buf, 0, 1, NULL);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("write failed: %s\n", nt_errstr(status));
+               return false;
+       }
+       return true;
+}
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 9d18f72..8bc9cef 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -8314,7 +8314,7 @@ static bool run_local_memcache(int dummy)
        size_t size1, size2;
        bool ret = false;
 
-       cache = memcache_init(NULL, 100);
+       cache = memcache_init(NULL, sizeof(void *) == 8 ? 200 : 100);
 
        if (cache == NULL) {
                printf("memcache_init failed\n");
@@ -8880,6 +8880,7 @@ static struct {
        { "SMB2-MULTI-CHANNEL", run_smb2_multi_channel },
        { "SMB2-SESSION-REAUTH", run_smb2_session_reauth },
        { "CLEANUP1", run_cleanup1 },
+       { "CLEANUP2", run_cleanup2 },
        { "LOCAL-SUBSTITUTE", run_local_substitute, 0},
        { "LOCAL-GENCACHE", run_local_gencache, 0},
        { "LOCAL-TALLOC-DICT", run_local_talloc_dict, 0},


-- 
Samba Shared Repository

Reply via email to