[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Wed Apr 18 11:48:02 MDT 2012
The branch, master has been updated
via b0aaa49 s4-torture: Fix the raw.notify mask test
via 0329127 s4-torture: Use 2 client connections for raw.notify.mask
via 5607f91 s4-torture: Use 2 client connections for raw.notify.tree
via 1bb7d25 s4-torture: Use 2 client connections for raw.notify.recursive
via 0021fc1 s3-dbwrap: Fix an unused var warning
from 2085c20 s4:torture:smb2: add a session.reauth2 test.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b0aaa49e3fd25261500c9367fd59ff02d20af2f0
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 18:05:24 2012 +0200
s4-torture: Fix the raw.notify mask test
When we do the notify triggers via a different client connection, adding the
notify record becomes subject to a race. Add a dummy operation after the
initial changenotify request was sent to make sure the notify record actually
arrived.
Autobuild-User: Volker Lendecke <vl at samba.org>
Autobuild-Date: Wed Apr 18 19:47:53 CEST 2012 on sn-devel-104
commit 03291270a6fc1ccc9cdd67700dcc2da46b33429c
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 14:45:20 2012 +0200
s4-torture: Use 2 client connections for raw.notify.mask
This makes the test more interesting in a cluster
commit 5607f91796965459ad17fd6fc5e5a6d19601e8bc
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 14:45:20 2012 +0200
s4-torture: Use 2 client connections for raw.notify.tree
This makes the test more interesting in a cluster
commit 1bb7d251763b8b2e87ed6401d638bb9109ceeb26
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 14:45:20 2012 +0200
s4-torture: Use 2 client connections for raw.notify.recursive
This makes the test more interesting in a cluster
commit 0021fc17e4660eee8df98c5a5810a55e5e5effee
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 14:23:06 2012 +0200
s3-dbwrap: Fix an unused var warning
-----------------------------------------------------------------------
Summary of changes:
source3/lib/dbwrap/dbwrap_ctdb.c | 2 +
source4/torture/raw/notify.c | 74 +++++++++++++++++++++++--------------
2 files changed, 48 insertions(+), 28 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index fe2af36..3d08d1c 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1004,7 +1004,9 @@ static int db_ctdb_record_destr(struct db_record* data)
/* Do I own this record? */
static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only)
{
+#ifdef HAVE_CTDB_WANT_READONLY_DECL
struct ctdb_ltdb_header *hdr;
+#endif
if (ctdb_data.dptr == NULL)
return false;
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index e569000..2a16d6e 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -310,7 +310,8 @@ static bool check_rename_reply(struct smbcli_state *cli,
testing of recursive change notify
*/
static bool test_notify_recursive(struct torture_context *mem_ctx,
- struct smbcli_state *cli)
+ struct smbcli_state *cli,
+ struct smbcli_state *cli2)
{
bool ret = true;
NTSTATUS status;
@@ -367,13 +368,19 @@ static bool test_notify_recursive(struct torture_context *mem_ctx,
status = smb_raw_changenotify_recv(req2, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_CANCELLED);
+ /*
+ * Make notifies a bit more interesting in a cluster by doing
+ * the changes against different nodes with --unclist
+ */
smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name\\subname1");
+ smbcli_mkdir(cli2->tree, BASEDIR "\\subdir-name\\subname1");
smbcli_close(cli->tree,
smbcli_open(cli->tree, BASEDIR "\\subdir-name\\subname2", O_CREAT, 0));
- smbcli_rename(cli->tree, BASEDIR "\\subdir-name\\subname1", BASEDIR "\\subdir-name\\subname1-r");
+ smbcli_rename(cli2->tree, BASEDIR "\\subdir-name\\subname1",
+ BASEDIR "\\subdir-name\\subname1-r");
smbcli_rename(cli->tree, BASEDIR "\\subdir-name\\subname2", BASEDIR "\\subname2-r");
- smbcli_rename(cli->tree, BASEDIR "\\subname2-r", BASEDIR "\\subname3-r");
+ smbcli_rename(cli2->tree, BASEDIR "\\subname2-r",
+ BASEDIR "\\subname3-r");
notify.nttrans.in.completion_filter = 0;
notify.nttrans.in.recursive = true;
@@ -381,7 +388,7 @@ static bool test_notify_recursive(struct torture_context *mem_ctx,
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name\\subname1-r");
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_rmdir(cli2->tree, BASEDIR "\\subdir-name");
smbcli_unlink(cli->tree, BASEDIR "\\subname3-r");
notify.nttrans.in.recursive = false;
@@ -571,12 +578,14 @@ done:
testing of mask bits for change notify
*/
static bool test_notify_mask(struct torture_context *tctx,
- struct smbcli_state *cli)
+ struct smbcli_state *cli,
+ struct smbcli_state *cli2)
{
bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
+ union smb_chkpath chkpath;
int fnum, fnum2;
uint32_t mask;
int i;
@@ -613,6 +622,8 @@ static bool test_notify_mask(struct torture_context *tctx,
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.recursive = true;
+ chkpath.chkpath.in.path = "\\";
+
#define NOTIFY_MASK_TEST(test_name, setup, op, cleanup, Action, expected, nchanges) \
do { \
smbcli_getatr(cli->tree, test_name, NULL, NULL, NULL); \
@@ -625,6 +636,7 @@ static bool test_notify_mask(struct torture_context *tctx,
notify.nttrans.in.file.fnum = fnum; \
notify.nttrans.in.completion_filter = (1<<i); \
req = smb_raw_changenotify_send(cli->tree, ¬ify); \
+ smb_raw_chkpath(cli->tree, &chkpath); \
op \
smb_msleep(200); smb_raw_ntcancel(req); \
status = smb_raw_changenotify_recv(req, tctx, ¬ify); \
@@ -678,21 +690,21 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing mkdir\n");
NOTIFY_MASK_TEST("Testing mkdir",;,
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
- smbcli_rmdir(cli->tree, BASEDIR "\\tname1");,
+ smbcli_rmdir(cli2->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
printf("Testing create file\n");
NOTIFY_MASK_TEST("Testing create file",;,
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
- smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
+ smbcli_unlink(cli2->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
printf("Testing unlink\n");
NOTIFY_MASK_TEST("Testing unlink",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
- smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
+ smbcli_unlink(cli2->tree, BASEDIR "\\tname1");,
;,
NOTIFY_ACTION_REMOVED,
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
@@ -700,7 +712,7 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing rmdir\n");
NOTIFY_MASK_TEST("Testing rmdir",
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
- smbcli_rmdir(cli->tree, BASEDIR "\\tname1");,
+ smbcli_rmdir(cli2->tree, BASEDIR "\\tname1");,
;,
NOTIFY_ACTION_REMOVED,
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
@@ -708,7 +720,7 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing rename file\n");
NOTIFY_MASK_TEST("Testing rename file",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
- smbcli_rename(cli->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
+ smbcli_rename(cli2->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
smbcli_unlink(cli->tree, BASEDIR "\\tname2");,
NOTIFY_ACTION_OLD_NAME,
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION, 2);
@@ -716,7 +728,7 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing rename dir\n");
NOTIFY_MASK_TEST("Testing rename dir",
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
- smbcli_rename(cli->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
+ smbcli_rename(cli2->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname2");,
NOTIFY_ACTION_OLD_NAME,
FILE_NOTIFY_CHANGE_DIR_NAME, 2);
@@ -724,7 +736,7 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing set path attribute\n");
NOTIFY_MASK_TEST("Testing set path attribute",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
- smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);,
+ smbcli_setatr(cli2->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
@@ -732,16 +744,16 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing set path write time\n");
NOTIFY_MASK_TEST("Testing set path write time",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
- smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_NORMAL, 1000);,
+ smbcli_setatr(cli2->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_NORMAL, 1000);,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
printf("Testing set file attribute\n");
NOTIFY_MASK_TEST("Testing set file attribute",
- fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
- smbcli_fsetatr(cli->tree, fnum2, FILE_ATTRIBUTE_HIDDEN, 0, 0, 0, 0);,
- (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ fnum2 = create_complex_file(cli2, tctx, BASEDIR "\\tname1");,
+ smbcli_fsetatr(cli2->tree, fnum2, FILE_ATTRIBUTE_HIDDEN, 0, 0, 0, 0);,
+ (smbcli_close(cli2->tree, fnum2), smbcli_unlink(cli2->tree, BASEDIR "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
@@ -788,17 +800,17 @@ static bool test_notify_mask(struct torture_context *tctx,
printf("Testing write\n");
NOTIFY_MASK_TEST("Testing write",
- fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
- smbcli_write(cli->tree, fnum2, 1, &c, 10000, 1);,
- (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ fnum2 = create_complex_file(cli2, tctx, BASEDIR "\\tname1");,
+ smbcli_write(cli2->tree, fnum2, 1, &c, 10000, 1);,
+ (smbcli_close(cli2->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
0, 1);
printf("Testing truncate\n");
NOTIFY_MASK_TEST("Testing truncate",
- fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
- smbcli_ftruncate(cli->tree, fnum2, 10000);,
- (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ fnum2 = create_complex_file(cli2, tctx, BASEDIR "\\tname1");,
+ smbcli_ftruncate(cli2->tree, fnum2, 10000);,
+ (smbcli_close(cli2->tree, fnum2), smbcli_unlink(cli2->tree, BASEDIR "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
@@ -1222,7 +1234,8 @@ done:
test multiple change notifies at different depths and with/without recursion
*/
static bool test_notify_tree(struct torture_context *mem_ctx,
- struct smbcli_state *cli)
+ struct smbcli_state *cli,
+ struct smbcli_state *cli2)
{
bool ret = true;
union smb_notify notify;
@@ -1304,8 +1317,13 @@ static bool test_notify_tree(struct torture_context *mem_ctx,
/* trigger 2 events in each dir */
for (i=0;i<ARRAY_SIZE(dirs);i++) {
char *path = talloc_asprintf(mem_ctx, "%s\\test.dir", dirs[i].path);
+ /*
+ * Make notifies a bit more interesting in a cluster
+ * by doing the changes against different nodes with
+ * --unclist
+ */
smbcli_mkdir(cli->tree, path);
- smbcli_rmdir(cli->tree, path);
+ smbcli_rmdir(cli2->tree, path);
talloc_free(path);
}
@@ -1786,8 +1804,8 @@ struct torture_suite *torture_raw_notify(TALLOC_CTX *mem_ctx)
torture_suite_add_1smb_test(suite, "tcon", test_notify_tcon);
torture_suite_add_2smb_test(suite, "dir", test_notify_dir);
- torture_suite_add_1smb_test(suite, "mask", test_notify_mask);
- torture_suite_add_1smb_test(suite, "recursive", test_notify_recursive);
+ torture_suite_add_2smb_test(suite, "mask", test_notify_mask);
+ torture_suite_add_2smb_test(suite, "recursive", test_notify_recursive);
torture_suite_add_1smb_test(suite, "mask_change",
test_notify_mask_change);
torture_suite_add_1smb_test(suite, "file", test_notify_file);
@@ -1796,7 +1814,7 @@ struct torture_suite *torture_raw_notify(TALLOC_CTX *mem_ctx)
torture_suite_add_1smb_test(suite, "ulogoff", test_notify_ulogoff);
torture_suite_add_1smb_test(suite, "tcp_dis", test_notify_tcp_dis);
torture_suite_add_1smb_test(suite, "double", test_notify_double);
- torture_suite_add_1smb_test(suite, "tree", test_notify_tree);
+ torture_suite_add_2smb_test(suite, "tree", test_notify_tree);
torture_suite_add_1smb_test(suite, "overflow", test_notify_overflow);
torture_suite_add_1smb_test(suite, "basedir", test_notify_basedir);
torture_suite_add_1smb_test(suite, "alignment", test_notify_alignment);
--
Samba Shared Repository
More information about the samba-cvs
mailing list