[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Wed Apr 18 07:17:03 MDT 2012
The branch, master has been updated
via 26b9ab2 s4-torture: notify all is empty now
via bd3ceb8 s4-torture: Separate out the notify alignment subtest
via 6b445cd s4-torture: Separate out the notify basedir subtest
via 98f8f42 s4-torture: Separate out the notify overflow subtest
via a7cff2b s4-torture: Separate out the notify tree subtest
via d1a898a s4-torture: Separate out the notify double subtest
via c180cd0 s4-torture: Separate out the notify tcp_dis subtest
via e5181d0 s4-torture: Separate out the notify ulogoff subtest
via 07def32 s4-torture: Separate out the notify exit subtest
via f864b93 s4-torture: Separate out the notify tdis subtest
via b570668 s4-torture: Separate out the notify file subtest
via 6f6192b s4-torture: Separate out the notify mask_change subtest
via 5429593 s4-torture: Separate out the notify recursive subtest
via 87e2a54 s4-torture: Separate out the notify mask subtest
via 74f134d s4-torture: Separate out the notify dir subtest
via 1366685 s4-torture: Separate out the notify tcon subtest
via 8e41c2f s4-torture: Make notify a suite
from 536c4a4 libsmb: Actually use an introduced variable
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 26b9ab2780615863b0fc2105e899e64682862d1d
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:57:06 2012 +0200
s4-torture: notify all is empty now
Autobuild-User: Volker Lendecke <vl at samba.org>
Autobuild-Date: Wed Apr 18 15:16:13 CEST 2012 on sn-devel-104
commit bd3ceb879252b5992be5d88c8d2694a7e3d36ff4
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:56:39 2012 +0200
s4-torture: Separate out the notify alignment subtest
commit 6b445cdfc6c8767f8e09ee847f5840ab0e20031b
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:54:25 2012 +0200
s4-torture: Separate out the notify basedir subtest
commit 98f8f4236c363fe9f97fd4fca154be9258b1652a
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:53:08 2012 +0200
s4-torture: Separate out the notify overflow subtest
commit a7cff2b72e85b2bc919f1dcb30bd009a54d47354
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:51:26 2012 +0200
s4-torture: Separate out the notify tree subtest
commit d1a898a76b0305f89a29fcbb8d026ddbd346b77c
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:49:55 2012 +0200
s4-torture: Separate out the notify double subtest
commit c180cd04685d180d849e507ce5f2411f89b04d4a
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:47:39 2012 +0200
s4-torture: Separate out the notify tcp_dis subtest
commit e5181d0460425abe6b1d06c783f4c225581e1acc
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:44:21 2012 +0200
s4-torture: Separate out the notify ulogoff subtest
commit 07def3221e02fce95465217b83c65c76298e4e3d
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:42:13 2012 +0200
s4-torture: Separate out the notify exit subtest
commit f864b93b317b73dfc6b183f5ab59c7a23ce0e9ca
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:39:08 2012 +0200
s4-torture: Separate out the notify tdis subtest
commit b570668f5583a3eea3d2bf0755617f8d2e9ee4a4
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:31:12 2012 +0200
s4-torture: Separate out the notify file subtest
commit 6f6192b9980c11c7fed98c2f038fd2803a6ab92b
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:27:38 2012 +0200
s4-torture: Separate out the notify mask_change subtest
commit 5429593eed1244315d1f9edef4051d32cb34cb91
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:24:59 2012 +0200
s4-torture: Separate out the notify recursive subtest
commit 87e2a549e961c720b4dca98ad2d495d61944f251
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:22:31 2012 +0200
s4-torture: Separate out the notify mask subtest
commit 74f134df721b323a5b26bfa813528b32520785a6
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 12:19:12 2012 +0200
s4-torture: Separate out the notify dir subtest
commit 13666857f20d4bfe57ae40fda575075811d9653f
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 11:47:48 2012 +0200
s4-torture: Separate out the notify tcon subtest
commit 8e41c2f81ceb7cccad888c9cd6a459c79c48dc9e
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 18 11:43:12 2012 +0200
s4-torture: Make notify a suite
-----------------------------------------------------------------------
Summary of changes:
source4/torture/raw/notify.c | 175 ++++++++++++++++++++++++++++++------------
source4/torture/raw/raw.c | 2 +-
2 files changed, 128 insertions(+), 49 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index 402974c..e569000 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -63,8 +63,9 @@ do { \
/*
basic testing of change notify on directories
*/
-static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
- TALLOC_CTX *mem_ctx)
+static bool test_notify_dir(struct torture_context *mem_ctx,
+ struct smbcli_state *cli,
+ struct smbcli_state *cli2)
{
bool ret = true;
NTSTATUS status;
@@ -77,6 +78,10 @@ static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
printf("TESTING CHANGE NOTIFY ON DIRECTORIES\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/*
get a handle on the directory
*/
@@ -265,6 +270,7 @@ static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -303,7 +309,8 @@ static bool check_rename_reply(struct smbcli_state *cli,
/*
testing of recursive change notify
*/
-static bool test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_recursive(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -314,6 +321,10 @@ static bool test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY WITH RECURSION\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/*
get a handle on the directory
*/
@@ -428,13 +439,15 @@ static bool test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
/*
testing of change notify mask change
*/
-static bool test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_mask_change(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -445,6 +458,10 @@ static bool test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ct
printf("TESTING CHANGE NOTIFY WITH MASK CHANGE\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/*
get a handle on the directory
*/
@@ -545,6 +562,7 @@ static bool test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ct
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -552,7 +570,8 @@ done:
/*
testing of mask bits for change notify
*/
-static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *tctx)
+static bool test_notify_mask(struct torture_context *tctx,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -567,6 +586,10 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
printf("TESTING CHANGE NOTIFY COMPLETION FILTERS\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
tv = timeval_current_ofs(1000, 0);
t = timeval_to_nttime(&tv);
@@ -781,13 +804,15 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
/*
basic testing of change notify on files
*/
-static bool test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_file(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
NTSTATUS status;
bool ret = true;
@@ -800,6 +825,10 @@ static bool test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY ON FILES\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
io.ntcreatex.in.flags = 0;
@@ -841,13 +870,15 @@ static bool test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
/*
basic testing of change notifies followed by a tdis
*/
-static bool test_notify_tdis(struct torture_context *tctx)
+static bool test_notify_tdis(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
bool ret = true;
NTSTATUS status;
@@ -859,6 +890,10 @@ static bool test_notify_tdis(struct torture_context *tctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY TDIS\n");
+ if (!torture_setup_dir(cli1, BASEDIR)) {
+ return false;
+ }
+
if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -903,13 +938,15 @@ static bool test_notify_tdis(struct torture_context *tctx)
done:
torture_close_connection(cli);
+ smbcli_deltree(cli1->tree, BASEDIR);
return ret;
}
/*
basic testing of change notifies followed by a exit
*/
-static bool test_notify_exit(struct torture_context *tctx)
+static bool test_notify_exit(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
bool ret = true;
NTSTATUS status;
@@ -921,6 +958,10 @@ static bool test_notify_exit(struct torture_context *tctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY EXIT\n");
+ if (!torture_setup_dir(cli1, BASEDIR)) {
+ return false;
+ }
+
if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -964,13 +1005,15 @@ static bool test_notify_exit(struct torture_context *tctx)
done:
torture_close_connection(cli);
+ smbcli_deltree(cli1->tree, BASEDIR);
return ret;
}
/*
basic testing of change notifies followed by a ulogoff
*/
-static bool test_notify_ulogoff(struct torture_context *tctx)
+static bool test_notify_ulogoff(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
bool ret = true;
NTSTATUS status;
@@ -982,6 +1025,10 @@ static bool test_notify_ulogoff(struct torture_context *tctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY ULOGOFF\n");
+ if (!torture_setup_dir(cli1, BASEDIR)) {
+ return false;
+ }
+
if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -1025,6 +1072,7 @@ static bool test_notify_ulogoff(struct torture_context *tctx)
done:
torture_close_connection(cli);
+ smbcli_deltree(cli1->tree, BASEDIR);
return ret;
}
@@ -1038,7 +1086,8 @@ static void tcp_dis_handler(struct smbcli_transport *t, void *p)
/*
basic testing of change notifies followed by tcp disconnect
*/
-static bool test_notify_tcp_dis(struct torture_context *tctx)
+static bool test_notify_tcp_dis(struct torture_context *tctx,
+ struct smbcli_state *cli1)
{
bool ret = true;
NTSTATUS status;
@@ -1050,6 +1099,10 @@ static bool test_notify_tcp_dis(struct torture_context *tctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY TCP DISCONNECT\n");
+ if (!torture_setup_dir(cli1, BASEDIR)) {
+ return false;
+ }
+
if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -1091,13 +1144,15 @@ static bool test_notify_tcp_dis(struct torture_context *tctx)
done:
torture_close_connection(cli);
+ smbcli_deltree(cli1->tree, BASEDIR);
return ret;
}
/*
test setting up two change notify requests on one handle
*/
-static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_double(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -1108,6 +1163,9 @@ static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY TWICE ON ONE DIRECTORY\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
/*
get a handle on the directory
*/
@@ -1155,6 +1213,7 @@ static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -1162,7 +1221,8 @@ done:
/*
test multiple change notifies at different depths and with/without recursion
*/
-static bool test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_tree(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
bool ret = true;
union smb_notify notify;
@@ -1204,6 +1264,10 @@ static bool test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOR DIFFERENT DEPTHS\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
io.ntcreatex.in.flags = 0;
@@ -1288,6 +1352,7 @@ static bool test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -1295,7 +1360,8 @@ done:
Test response when cached server events exceed single NT NOTFIY response
packet size.
*/
-static bool test_notify_overflow(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_overflow(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -1308,6 +1374,10 @@ static bool test_notify_overflow(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY EVENT OVERFLOW\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/* get a handle on the directory */
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
@@ -1366,6 +1436,7 @@ static bool test_notify_overflow(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -1373,7 +1444,8 @@ done:
Test if notifications are returned for changes to the base directory.
They shouldn't be.
*/
-static bool test_notify_basedir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_basedir(struct torture_context *mem_ctx,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -1384,6 +1456,10 @@ static bool test_notify_basedir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY BASEDIR EVENTS\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/* get a handle on the directory */
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
@@ -1432,6 +1508,7 @@ static bool test_notify_basedir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -1476,7 +1553,8 @@ static struct smbcli_tree *secondary_tcon(struct smbcli_state *cli,
/*
very simple change notify test
*/
-static bool test_notify_tcon(struct smbcli_state *cli, struct torture_context *torture)
+static bool test_notify_tcon(struct torture_context *torture,
+ struct smbcli_state *cli)
{
bool ret = true;
NTSTATUS status;
@@ -1489,6 +1567,10 @@ static bool test_notify_tcon(struct smbcli_state *cli, struct torture_context *t
printf("TESTING SIMPLE CHANGE NOTIFY\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/*
get a handle on the directory
*/
@@ -1598,6 +1680,7 @@ static bool test_notify_tcon(struct smbcli_state *cli, struct torture_context *t
printf("CHANGE NOTIFY WITH TDIS OK\n");
done:
smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return ret;
}
@@ -1605,8 +1688,8 @@ done:
/*
testing alignment of multiple change notify infos
*/
-static bool test_notify_alignment(struct smbcli_state *cli,
- struct torture_context *tctx)
+static bool test_notify_alignment(struct torture_context *tctx,
+ struct smbcli_state *cli)
{
NTSTATUS status;
union smb_notify notify;
@@ -1623,6 +1706,10 @@ static bool test_notify_alignment(struct smbcli_state *cli,
torture_comment(tctx, "TESTING CHANGE NOTIFY REPLY ALIGNMENT\n");
+ if (!torture_setup_dir(cli, BASEDIR)) {
+ return false;
+ }
+
/* get a handle on the directory */
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
@@ -1688,39 +1775,31 @@ static bool test_notify_alignment(struct smbcli_state *cli,
STR_UNICODE);
}
+ smb_raw_exit(cli->session);
+ smbcli_deltree(cli->tree, BASEDIR);
return true;
}
-/*
- basic testing of change notify
-*/
-bool torture_raw_notify(struct torture_context *torture,
- struct smbcli_state *cli,
- struct smbcli_state *cli2)
+struct torture_suite *torture_raw_notify(TALLOC_CTX *mem_ctx)
{
- bool ret = true;
-
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
-
- ret &= test_notify_tcon(cli, torture);
- ret &= test_notify_dir(cli, cli2, torture);
- ret &= test_notify_mask(cli, torture);
- ret &= test_notify_recursive(cli, torture);
- ret &= test_notify_mask_change(cli, torture);
- ret &= test_notify_file(cli, torture);
- ret &= test_notify_tdis(torture);
- ret &= test_notify_exit(torture);
- ret &= test_notify_ulogoff(torture);
- ret &= test_notify_tcp_dis(torture);
- ret &= test_notify_double(cli, torture);
- ret &= test_notify_tree(cli, torture);
- ret &= test_notify_overflow(cli, torture);
- ret &= test_notify_basedir(cli, torture);
- ret &= test_notify_alignment(cli, torture);
-
- smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
- return ret;
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "notify");
+
+ 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_1smb_test(suite, "mask_change",
+ test_notify_mask_change);
+ torture_suite_add_1smb_test(suite, "file", test_notify_file);
+ torture_suite_add_1smb_test(suite, "tdis", test_notify_tdis);
+ torture_suite_add_1smb_test(suite, "exit", test_notify_exit);
+ 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_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);
+
+ return suite;
}
diff --git a/source4/torture/raw/raw.c b/source4/torture/raw/raw.c
index 88cb1c5..39698dc 100644
--- a/source4/torture/raw/raw.c
+++ b/source4/torture/raw/raw.c
@@ -47,7 +47,7 @@ NTSTATUS torture_raw_init(void)
torture_suite_add_1smb_test(suite, "mkdir", torture_raw_mkdir);
torture_suite_add_suite(suite, torture_raw_oplock(suite));
torture_suite_add_1smb_test(suite, "hold-oplock", torture_hold_oplock);
- torture_suite_add_2smb_test(suite, "notify", torture_raw_notify);
+ torture_suite_add_suite(suite, torture_raw_notify(suite));
--
Samba Shared Repository
More information about the samba-cvs
mailing list