"wire_bad_flags"); \
} while (0)
+#define BASEDIR_CN1_DIR BASEDIR "_CN1_DIR"
+
/*
basic testing of change notify on directories
*/
torture_comment(tctx, "TESTING CHANGE NOTIFY ON DIRECTORIES\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_DIR),
+ "Failed to setup up test directory: " BASEDIR_CN1_DIR);
/*
get a handle on the directory
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_DIR;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify mkdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_mkdir(cli2->tree, BASEDIR "\\subdir-name");
+ smbcli_mkdir(cli2->tree, BASEDIR_CN1_DIR "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify rmdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_rmdir(cli2->tree, BASEDIR "\\subdir-name");
+ smbcli_rmdir(cli2->tree, BASEDIR_CN1_DIR "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify mkdir - rmdir - mkdir - rmdir\n");
- smbcli_mkdir(cli2->tree, BASEDIR "\\subdir-name");
- smbcli_rmdir(cli2->tree, BASEDIR "\\subdir-name");
- smbcli_mkdir(cli2->tree, BASEDIR "\\subdir-name");
- smbcli_rmdir(cli2->tree, BASEDIR "\\subdir-name");
+ smbcli_mkdir(cli2->tree, BASEDIR_CN1_DIR "\\subdir-name");
+ smbcli_rmdir(cli2->tree, BASEDIR_CN1_DIR "\\subdir-name");
+ smbcli_mkdir(cli2->tree, BASEDIR_CN1_DIR "\\subdir-name");
+ smbcli_rmdir(cli2->tree, BASEDIR_CN1_DIR "\\subdir-name");
smb_msleep(200);
req = smb_raw_changenotify_send(cli->tree, ¬ify);
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
count = torture_numops;
torture_comment(tctx, "Testing buffered notify on create of %d files\n", count);
for (i=0;i<count;i++) {
- char *fname = talloc_asprintf(cli, BASEDIR "\\test%d.txt", i);
+ char *fname = talloc_asprintf(cli,
+ BASEDIR_CN1_DIR "\\test%d.txt",
+ i);
int fnum3 = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE);
torture_assert_int_not_equal_goto(tctx, fnum3, -1, ret, done,
talloc_asprintf(tctx, "Failed to create %s - %s",
notify.nttrans.in.file.fnum = fnum;
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- status = smbcli_unlink(cli->tree, BASEDIR "\\nonexistent.txt");
+ status = smbcli_unlink(cli->tree, BASEDIR_CN1_DIR "\\nonexistent.txt");
torture_assert_ntstatus_equal_goto(tctx, status,
NT_STATUS_OBJECT_NAME_NOT_FOUND,
ret, done,
this unlink is only seen by the 1st notify and
the 3rd notify (later) */
torture_comment(tctx, "Testing notify on unlink for the first file\n");
- status = smbcli_unlink(cli2->tree, BASEDIR "\\test0.txt");
+ status = smbcli_unlink(cli2->tree, BASEDIR_CN1_DIR "\\test0.txt");
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smbcli_unlink");
torture_comment(tctx, "(3rd notify) this notify will only see the 1st unlink\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- status = smbcli_unlink(cli->tree, BASEDIR "\\nonexistent.txt");
+ status = smbcli_unlink(cli->tree, BASEDIR_CN1_DIR "\\nonexistent.txt");
torture_assert_ntstatus_equal_goto(tctx, status,
NT_STATUS_OBJECT_NAME_NOT_FOUND,
ret, done,
torture_comment(tctx, "Testing notify on wildcard unlink for %d files\n", count-1);
/* (2nd unlink) do a wildcard unlink */
- status = smbcli_unlink(cli2->tree, BASEDIR "\\test*.txt");
+ status = smbcli_unlink(cli2->tree, BASEDIR_CN1_DIR "\\test*.txt");
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb_raw_changenotify_recv");
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_DIR);
return ret;
}
/*
testing of recursive change notify
*/
+
+#define BASEDIR_CN1_RECUR BASEDIR "_CN1_RECUR"
+
static bool test_notify_recursive(struct torture_context *tctx,
struct smbcli_state *cli,
struct smbcli_state *cli2)
torture_comment(tctx, "TESTING CHANGE NOTIFY WITH RECURSION\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_RECUR),
+ "Failed to setup up test directory: " BASEDIR_CN1_RECUR);
/*
get a handle on the directory
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_RECUR;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
* 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(cli2->tree, BASEDIR "\\subdir-name\\subname1");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_RECUR "\\subdir-name");
+ smbcli_mkdir(cli2->tree, BASEDIR_CN1_RECUR "\\subdir-name\\subname1");
smbcli_close(cli->tree,
- smbcli_open(cli->tree, BASEDIR "\\subdir-name\\subname2", O_CREAT, 0));
- 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(cli2->tree, BASEDIR "\\subname2-r",
- BASEDIR "\\subname3-r");
+ smbcli_open(cli->tree,
+ BASEDIR_CN1_RECUR "\\subdir-name\\subname2",
+ O_CREAT, 0));
+ smbcli_rename(cli2->tree, BASEDIR_CN1_RECUR "\\subdir-name\\subname1",
+ BASEDIR_CN1_RECUR "\\subdir-name\\subname1-r");
+ smbcli_rename(cli->tree,
+ BASEDIR_CN1_RECUR "\\subdir-name\\subname2",
+ BASEDIR_CN1_RECUR "\\subname2-r");
+ smbcli_rename(cli2->tree, BASEDIR_CN1_RECUR "\\subname2-r",
+ BASEDIR_CN1_RECUR "\\subname3-r");
notify.nttrans.in.completion_filter = 0;
notify.nttrans.in.recursive = true;
smb_msleep(200);
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name\\subname1-r");
- smbcli_rmdir(cli2->tree, BASEDIR "\\subdir-name");
- smbcli_unlink(cli->tree, BASEDIR "\\subname3-r");
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_RECUR "\\subdir-name\\subname1-r");
+ smbcli_rmdir(cli2->tree, BASEDIR_CN1_RECUR "\\subdir-name");
+ smbcli_unlink(cli->tree, BASEDIR_CN1_RECUR "\\subname3-r");
smb_msleep(200);
notify.nttrans.in.recursive = false;
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_RECUR);
return ret;
}
/*
testing of change notify mask change
*/
+
+#define BASEDIR_CN1_CNMC BASEDIR "_CN1_CNMC"
+
static bool test_notify_mask_change(struct torture_context *tctx,
struct smbcli_state *cli)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY WITH MASK CHANGE\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_CNMC),
+ "Failed to setup up test directory: " BASEDIR_CN1_CNMC);
/*
get a handle on the directory
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_CNMC;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
/* Set to hidden then back again. */
- smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));
- smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);
- smbcli_unlink(cli->tree, BASEDIR "\\tname1");
+ smbcli_close(cli->tree,
+ smbcli_open(cli->tree,BASEDIR_CN1_CNMC "\\tname1", O_CREAT, 0));
+ smbcli_setatr(cli->tree, BASEDIR_CN1_CNMC "\\tname1",
+ FILE_ATTRIBUTE_HIDDEN, 0);
+ smbcli_unlink(cli->tree, BASEDIR_CN1_CNMC "\\tname1");
status = smb_raw_changenotify_recv(req1, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
notify.nttrans.in.recursive = false;
req2 = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name\\subname1");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_CNMC "\\subdir-name");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_CNMC "\\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(cli->tree, BASEDIR "\\subdir-name\\subname2", BASEDIR "\\subname2-r");
- smbcli_rename(cli->tree, BASEDIR "\\subname2-r", BASEDIR "\\subname3-r");
-
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name\\subname1-r");
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
- smbcli_unlink(cli->tree, BASEDIR "\\subname3-r");
+ smbcli_open(cli->tree,
+ BASEDIR_CN1_CNMC "\\subdir-name\\subname2",
+ O_CREAT, 0));
+ smbcli_rename(cli->tree,
+ BASEDIR_CN1_CNMC "\\subdir-name\\subname1",
+ BASEDIR_CN1_CNMC "\\subdir-name\\subname1-r");
+ smbcli_rename(cli->tree,
+ BASEDIR_CN1_CNMC "\\subdir-name\\subname2",
+ BASEDIR_CN1_CNMC "\\subname2-r");
+ smbcli_rename(cli->tree,
+ BASEDIR_CN1_CNMC "\\subname2-r",
+ BASEDIR_CN1_CNMC "\\subname3-r");
+
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_CNMC "\\subdir-name\\subname1-r");
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_CNMC "\\subdir-name");
+ smbcli_unlink(cli->tree, BASEDIR_CN1_CNMC "\\subname3-r");
status = smb_raw_changenotify_recv(req1, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_CNMC);
return ret;
}
/*
testing of mask bits for change notify
*/
+
+#define BASEDIR_CN1_NOTM BASEDIR "_CN1_NOTM"
+
static bool test_notify_mask(struct torture_context *tctx,
struct smbcli_state *cli,
struct smbcli_state *cli2)
torture_comment(tctx, "TESTING CHANGE NOTIFY COMPLETION FILTERS\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_NOTM),
+ "Failed to setup up test directory: " BASEDIR_CN1_NOTM);
tv = timeval_current_ofs(1000, 0);
t = timeval_to_nttime(&tv);
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_NOTM;
notify.nttrans.level = RAW_NOTIFY_NTTRANS;
notify.nttrans.in.buffer_size = 1000;
torture_comment(tctx, "Testing mkdir\n");
NOTIFY_MASK_TEST("Testing mkdir",;,
- smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
- smbcli_rmdir(cli2->tree, BASEDIR "\\tname1");,
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_NOTM "\\tname1");,
+ smbcli_rmdir(cli2->tree, BASEDIR_CN1_NOTM "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
torture_comment(tctx, "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(cli2->tree, BASEDIR "\\tname1");,
+ smbcli_close(cli->tree,
+ smbcli_open(cli->tree,
+ BASEDIR_CN1_NOTM "\\tname1",
+ O_CREAT, 0));,
+ smbcli_unlink(cli2->tree,
+ BASEDIR_CN1_NOTM "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
torture_comment(tctx, "Testing unlink\n");
NOTIFY_MASK_TEST("Testing unlink",
- smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
- smbcli_unlink(cli2->tree, BASEDIR "\\tname1");,
+ smbcli_close(cli->tree,
+ smbcli_open(cli->tree,
+ BASEDIR_CN1_NOTM "\\tname1",
+ O_CREAT, 0));,
+ smbcli_unlink(cli2->tree,
+ BASEDIR_CN1_NOTM "\\tname1");,
;,
NOTIFY_ACTION_REMOVED,
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
torture_comment(tctx, "Testing rmdir\n");
NOTIFY_MASK_TEST("Testing rmdir",
- smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
- smbcli_rmdir(cli2->tree, BASEDIR "\\tname1");,
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_NOTM "\\tname1");,
+ smbcli_rmdir(cli2->tree, BASEDIR_CN1_NOTM "\\tname1");,
;,
NOTIFY_ACTION_REMOVED,
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
torture_comment(tctx, "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(cli2->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
- smbcli_unlink(cli->tree, BASEDIR "\\tname2");,
+ smbcli_close(cli->tree,
+ smbcli_open(cli->tree,
+ BASEDIR_CN1_NOTM "\\tname1",
+ O_CREAT, 0));,
+ smbcli_rename(cli2->tree,
+ BASEDIR_CN1_NOTM "\\tname1",
+ BASEDIR_CN1_NOTM "\\tname2");,
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname2");,
NOTIFY_ACTION_OLD_NAME,
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION, 2);
torture_comment(tctx, "Testing rename dir\n");
NOTIFY_MASK_TEST("Testing rename dir",
- smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
- smbcli_rename(cli2->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
- smbcli_rmdir(cli->tree, BASEDIR "\\tname2");,
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_NOTM "\\tname1");,
+ smbcli_rename(cli2->tree,
+ BASEDIR_CN1_NOTM "\\tname1",
+ BASEDIR_CN1_NOTM "\\tname2");,
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_NOTM "\\tname2");,
NOTIFY_ACTION_OLD_NAME,
FILE_NOTIFY_CHANGE_DIR_NAME, 2);
torture_comment(tctx, "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(cli2->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);,
- smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
+ smbcli_close(cli->tree,
+ smbcli_open(cli->tree,
+ BASEDIR_CN1_NOTM "\\tname1", O_CREAT, 0));,
+ smbcli_setatr(cli2->tree,
+ BASEDIR_CN1_NOTM "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);,
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname1");,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
torture_comment(tctx, "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(cli2->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_NORMAL, 1000);,
- smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
+ smbcli_close(cli->tree, smbcli_open(cli->tree,
+ BASEDIR_CN1_NOTM "\\tname1", O_CREAT, 0));,
+ smbcli_setatr(cli2->tree,
+ BASEDIR_CN1_NOTM "\\tname1",
+ FILE_ATTRIBUTE_NORMAL, 1000);,
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname1");,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
torture_comment(tctx, "Testing set file attribute\n");
NOTIFY_MASK_TEST("Testing set file attribute",
- fnum2 = create_complex_file(cli2, tctx, BASEDIR "\\tname1");,
+ fnum2 = create_complex_file(cli2, tctx,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_fsetatr(cli2->tree, fnum2, FILE_ATTRIBUTE_HIDDEN, 0, 0, 0, 0);,
- (smbcli_close(cli2->tree, fnum2), smbcli_unlink(cli2->tree, BASEDIR "\\tname1"));,
+ (smbcli_close(cli2->tree, fnum2),
+ smbcli_unlink(cli2->tree, BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
torture_comment(tctx, "Testing set file create time\n");
NOTIFY_MASK_TEST("Testing set file create time",
fnum2 = create_complex_file(cli, tctx,
- BASEDIR "\\tname1");,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, t, 0, 0, 0);,
(smbcli_close(cli->tree, fnum2),
- smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ smbcli_unlink(cli->tree,
+ BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_CREATION, 1);
}
torture_comment(tctx, "Testing set file access time\n");
NOTIFY_MASK_TEST("Testing set file access time",
- fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
+ fnum2 = create_complex_file(cli, tctx,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, t, 0, 0);,
- (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ (smbcli_close(cli->tree, fnum2),
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_LAST_ACCESS, 1);
torture_comment(tctx, "Testing set file write time\n");
NOTIFY_MASK_TEST("Testing set file write time",
- fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
+ fnum2 = create_complex_file(cli, tctx,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, t, 0);,
- (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ (smbcli_close(cli->tree, fnum2),
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
torture_comment(tctx, "Testing set file change time\n");
NOTIFY_MASK_TEST("Testing set file change time",
- fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
+ fnum2 = create_complex_file(cli, tctx,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, 0, t);,
- (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ (smbcli_close(cli->tree, fnum2),
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
0, 1);
torture_comment(tctx, "Testing write\n");
NOTIFY_MASK_TEST("Testing write",
- fnum2 = create_complex_file(cli2, tctx, BASEDIR "\\tname1");,
+ fnum2 = create_complex_file(cli2, tctx,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_write(cli2->tree, fnum2, 1, &c, 10000, 1);,
- (smbcli_close(cli2->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ (smbcli_close(cli2->tree, fnum2),
+ smbcli_unlink(cli->tree, BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
0, 1);
torture_comment(tctx, "Testing truncate\n");
NOTIFY_MASK_TEST("Testing truncate",
- fnum2 = create_complex_file(cli2, tctx, BASEDIR "\\tname1");,
+ fnum2 = create_complex_file(cli2, tctx,
+ BASEDIR_CN1_NOTM "\\tname1");,
smbcli_ftruncate(cli2->tree, fnum2, 10000);,
- (smbcli_close(cli2->tree, fnum2), smbcli_unlink(cli2->tree, BASEDIR "\\tname1"));,
+ (smbcli_close(cli2->tree, fnum2),
+ smbcli_unlink(cli2->tree, BASEDIR_CN1_NOTM "\\tname1"));,
NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_NOTM);
return ret;
}
/*
basic testing of change notify on files
*/
+
+#define BASEDIR_CN1_FILE BASEDIR "_CN1_FILE"
+
static bool test_notify_file(struct torture_context *tctx,
struct smbcli_state *cli)
{
union smb_notify notify;
struct smbcli_request *req;
int fnum;
- const char *fname = BASEDIR "\\file.txt";
+ const char *fname = BASEDIR_CN1_FILE "\\file.txt";
torture_comment(tctx, "TESTING CHANGE NOTIFY ON FILES\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_FILE),
+ "Failed to setup up test directory: " BASEDIR_CN1_FILE);
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_FILE);
return ret;
}
/*
basic testing of change notifies followed by a tdis
*/
+#define BASEDIR_CN1_TDIS BASEDIR "_CN1_TDIS"
+
static bool test_notify_tdis(struct torture_context *tctx,
struct smbcli_state *cli1)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY FOLLOWED BY TDIS\n");
- torture_assert(tctx, torture_setup_dir(cli1, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli1, BASEDIR_CN1_TDIS),
+ "Failed to setup up test directory: " BASEDIR_CN1_TDIS);
torture_assert(tctx, torture_open_connection(&cli, tctx, 0),
"Failed to open connection.");
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_TDIS;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
done:
torture_close_connection(cli);
- smbcli_deltree(cli1->tree, BASEDIR);
+ smbcli_deltree(cli1->tree, BASEDIR_CN1_TDIS);
return ret;
}
/*
basic testing of change notifies followed by a exit
*/
+
+#define BASEDIR_CN1_EX BASEDIR "_CN1_EX"
+
static bool test_notify_exit(struct torture_context *tctx,
struct smbcli_state *cli1)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY FOLLOWED BY EXIT\n");
- torture_assert(tctx, torture_setup_dir(cli1, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli1, BASEDIR_CN1_EX),
+ "Failed to setup up test directory: " BASEDIR_CN1_EX);
torture_assert(tctx, torture_open_connection(&cli, tctx, 0),
"Failed to open connection.");
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_EX;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
done:
torture_close_connection(cli);
- smbcli_deltree(cli1->tree, BASEDIR);
+ smbcli_deltree(cli1->tree, BASEDIR_CN1_EX);
return ret;
}
/*
basic testing of change notifies followed by a ulogoff
*/
+
+#define BASEDIR_CN1_UL BASEDIR "_CN1_UL"
+
static bool test_notify_ulogoff(struct torture_context *tctx,
struct smbcli_state *cli1)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY FOLLOWED BY ULOGOFF\n");
- torture_assert(tctx, torture_setup_dir(cli1, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli1, BASEDIR_CN1_UL),
+ "Failed to setup up test directory: " BASEDIR_CN1_UL);
torture_assert(tctx, torture_open_connection(&cli, tctx, 0),
"Failed to open connection.");
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_UL;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
done:
torture_close_connection(cli);
- smbcli_deltree(cli1->tree, BASEDIR);
+ smbcli_deltree(cli1->tree, BASEDIR_CN1_UL);
return ret;
}
/*
basic testing of change notifies followed by tcp disconnect
*/
+
+#define BASEDIR_CN1_TCPDIS BASEDIR "_CN1_TCPDIS"
+
static bool test_notify_tcp_dis(struct torture_context *tctx,
struct smbcli_state *cli1)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY FOLLOWED BY TCP DISCONNECT\n");
- torture_assert(tctx, torture_setup_dir(cli1, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli1, BASEDIR_CN1_TCPDIS),
+ "Failed to setup up test directory: "
+ BASEDIR_CN1_TCPDIS);
torture_assert(tctx, torture_open_connection(&cli, tctx, 0),
"Failed to open connection.");
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_TCPDIS;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
done:
torture_close_connection(cli);
- smbcli_deltree(cli1->tree, BASEDIR);
+ smbcli_deltree(cli1->tree, BASEDIR_CN1_TCPDIS);
return ret;
}
/*
test setting up two change notify requests on one handle
*/
+
+#define BASEDIR_CN1_DBL BASEDIR "_CN1_DBL"
+
static bool test_notify_double(struct torture_context *tctx,
struct smbcli_state *cli)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY TWICE ON ONE DIRECTORY\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_DBL),
+ "Failed to setup up test directory: " BASEDIR_CN1_DBL);
/*
get a handle on the directory
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_DBL;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
req2 = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_DBL "\\subdir-name");
status = smb_raw_changenotify_recv(req1, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
CHECK_WSTR(tctx, notify.nttrans.out.changes[0].name, "subdir-name",
STR_UNICODE);
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name2");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_DBL "\\subdir-name2");
status = smb_raw_changenotify_recv(req2, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_DBL);
return ret;
}
/*
test multiple change notifies at different depths and with/without recursion
*/
+
+#define BASEDIR_CN1_TNT BASEDIR "_CN1_TNT"
+
static bool test_notify_tree(struct torture_context *tctx,
struct smbcli_state *cli,
struct smbcli_state *cli2)
int fnum;
int counted;
} dirs[] = {
- {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_NAME, 30 },
- {BASEDIR "\\zqy", true, FILE_NOTIFY_CHANGE_NAME, 8 },
- {BASEDIR "\\atsy", true, FILE_NOTIFY_CHANGE_NAME, 4 },
- {BASEDIR "\\abc\\foo", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\blah", true, FILE_NOTIFY_CHANGE_NAME, 13 },
- {BASEDIR "\\abc\\blah", false, FILE_NOTIFY_CHANGE_NAME, 7 },
- {BASEDIR "\\abc\\blah\\a", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\blah\\b", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\blah\\c", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\fooblah", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\zqy\\xx", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\zqy\\yyy", true, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\zqy\\..", true, FILE_NOTIFY_CHANGE_NAME, 40 },
- {BASEDIR, true, FILE_NOTIFY_CHANGE_NAME, 40 },
- {BASEDIR, false,FILE_NOTIFY_CHANGE_NAME, 6 },
- {BASEDIR "\\atsy", false,FILE_NOTIFY_CHANGE_NAME, 4 },
- {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_NAME, 24 },
- {BASEDIR "\\abc", false,FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
- {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
- {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_NAME, 24 },
+ {BASEDIR_CN1_TNT "\\abc",
+ true, FILE_NOTIFY_CHANGE_NAME, 30 },
+ {BASEDIR_CN1_TNT "\\zqy",
+ true, FILE_NOTIFY_CHANGE_NAME, 8 },
+ {BASEDIR_CN1_TNT "\\atsy",
+ true, FILE_NOTIFY_CHANGE_NAME, 4 },
+ {BASEDIR_CN1_TNT "\\abc\\foo",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\abc\\blah",
+ true, FILE_NOTIFY_CHANGE_NAME, 13 },
+ {BASEDIR_CN1_TNT "\\abc\\blah",
+ false, FILE_NOTIFY_CHANGE_NAME, 7 },
+ {BASEDIR_CN1_TNT "\\abc\\blah\\a",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\abc\\blah\\b",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\abc\\blah\\c",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\abc\\fooblah",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\zqy\\xx",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\zqy\\yyy",
+ true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR_CN1_TNT "\\zqy\\..",
+ true, FILE_NOTIFY_CHANGE_NAME, 40 },
+ {BASEDIR_CN1_TNT,
+ true, FILE_NOTIFY_CHANGE_NAME, 40 },
+ {BASEDIR_CN1_TNT,
+ false,FILE_NOTIFY_CHANGE_NAME, 6 },
+ {BASEDIR_CN1_TNT "\\atsy",
+ false,FILE_NOTIFY_CHANGE_NAME, 4 },
+ {BASEDIR_CN1_TNT "\\abc",
+ true, FILE_NOTIFY_CHANGE_NAME, 24 },
+ {BASEDIR_CN1_TNT "\\abc",
+ false,FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
+ {BASEDIR_CN1_TNT "\\abc",
+ true, FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
+ {BASEDIR_CN1_TNT "\\abc",
+ true, FILE_NOTIFY_CHANGE_NAME, 24 },
};
int i;
NTSTATUS status;
torture_comment(tctx, "TESTING CHANGE NOTIFY FOR DIFFERENT DEPTHS\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_TNT),
+ "Failed to setup up test directory: " BASEDIR_CN1_TNT);
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid.fnum = 0;
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_TNT);
return ret;
}
Test response when cached server events exceed single NT NOTFIY response
packet size.
*/
+
+#define BASEDIR_CN1_NO BASEDIR "_CN1_NO"
+
static bool test_notify_overflow(struct torture_context *tctx,
struct smbcli_state *cli)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY EVENT OVERFLOW\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_NO),
+ "Failed to setup up test directory: " BASEDIR_CN1_NO);
/* get a handle on the directory */
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_NO;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing overflowed buffer notify on create of %d files\n",
count);
for (i=0;i<count;i++) {
- char *fname = talloc_asprintf(cli, BASEDIR "\\test%d.txt", i);
+ char *fname = talloc_asprintf(cli,
+ BASEDIR_CN1_NO "\\test%d.txt", i);
int fnum2 = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR,
DENY_NONE);
torture_assert_int_not_equal_goto(tctx, fnum2, -1, ret, done,
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_NO);
return ret;
}
Test if notifications are returned for changes to the base directory.
They shouldn't be.
*/
+
+#define BASEDIR_CN1_NBASE BASEDIR "_CN1_NBASE"
+
static bool test_notify_basedir(struct torture_context *tctx,
struct smbcli_state *cli)
{
torture_comment(tctx, "TESTING CHANGE NOTIFY BASEDIR EVENTS\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_NBASE),
+ "Failed to setup up test directory: " BASEDIR_CN1_NBASE);
/* get a handle on the directory */
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_NBASE;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
fnum = io.ntcreatex.out.file.fnum;
/* create a test file that will also be modified */
- smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1",
+ smbcli_close(cli->tree, smbcli_open(cli->tree,
+ BASEDIR_CN1_NBASE "\\tname1",
O_CREAT, 0));
/* ask for a change notify, on attribute changes. */
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
/* set attribute on the base dir */
- smbcli_setatr(cli->tree, BASEDIR, FILE_ATTRIBUTE_HIDDEN, 0);
+ smbcli_setatr(cli->tree, BASEDIR_CN1_NBASE, FILE_ATTRIBUTE_HIDDEN, 0);
/* set attribute on a file to assure we receive a notification */
- smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);
+ smbcli_setatr(cli->tree, BASEDIR_CN1_NBASE "\\tname1",
+ FILE_ATTRIBUTE_HIDDEN, 0);
smb_msleep(200);
/* check how many responses were given, expect only 1 for the file */
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_NBASE);
return ret;
}
create a secondary tree connect - used to test for a bug in Samba3 messaging
with change notify
*/
+
static struct smbcli_tree *secondary_tcon(struct smbcli_state *cli,
struct torture_context *tctx)
{
/*
very simple change notify test
*/
+
+#define BASEDIR_CN1_NTCON BASEDIR "_CN1_NTCON"
+
static bool test_notify_tcon(struct torture_context *tctx,
struct smbcli_state *cli)
{
torture_comment(tctx, "TESTING SIMPLE CHANGE NOTIFY\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_NTCON),
+ "Failed to setup up test directory: " BASEDIR_CN1_NTCON);
/*
get a handle on the directory
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_NTCON;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify mkdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_NTCON "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify rmdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_NTCON "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify mkdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_NTCON "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify rmdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_NTCON "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify mkdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_mkdir(cli->tree, BASEDIR_CN1_NTCON "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "Testing notify rmdir\n");
req = smb_raw_changenotify_send(cli->tree, ¬ify);
- smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
+ smbcli_rmdir(cli->tree, BASEDIR_CN1_NTCON "\\subdir-name");
status = smb_raw_changenotify_recv(req, tctx, ¬ify);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
torture_comment(tctx, "CHANGE NOTIFY WITH TDIS OK\n");
done:
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_NTCON);
return ret;
}
/*
testing alignment of multiple change notify infos
*/
+
+#define BASEDIR_CN1_NALIGN BASEDIR "_CN1_NALIGN"
+
static bool test_notify_alignment(struct torture_context *tctx,
struct smbcli_state *cli)
{
union smb_open io;
int i, fnum, fnum2;
struct smbcli_request *req;
- const char *fname = BASEDIR "\\starter";
+ const char *fname = BASEDIR_CN1_NALIGN "\\starter";
const char *fnames[] = { "a",
"ab",
"abc",
torture_comment(tctx, "TESTING CHANGE NOTIFY REPLY ALIGNMENT\n");
- torture_assert(tctx, torture_setup_dir(cli, BASEDIR),
- "Failed to setup up test directory: " BASEDIR);
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR_CN1_NALIGN),
+ "Failed to setup up test directory: " BASEDIR_CN1_NALIGN);
/* get a handle on the directory */
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- io.ntcreatex.in.fname = BASEDIR;
+ io.ntcreatex.in.fname = BASEDIR_CN1_NALIGN;
status = smb_raw_open(cli->tree, tctx, &io);
torture_assert_ntstatus_ok(tctx, status, "smb_raw_open");
* 4-byte aligned. */
for (i = 0; i < num_names; i++) {
- fpath = talloc_asprintf(tctx, "%s\\%s", BASEDIR, fnames[i]);
+ fpath = talloc_asprintf(tctx, "%s\\%s",
+ BASEDIR_CN1_NALIGN, fnames[i]);
fnum2 = smbcli_open(cli->tree, fpath,
O_CREAT|O_RDWR, DENY_NONE);
torture_assert(tctx, fnum2 != -1, smbcli_errstr(cli->tree));
}
smb_raw_exit(cli->session);
- smbcli_deltree(cli->tree, BASEDIR);
+ smbcli_deltree(cli->tree, BASEDIR_CN1_NALIGN);
return true;
}