summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-04-06 11:09:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:00:21 -0500
commitb5ee277f1aa119e0acd498ab443e4eb990387af1 (patch)
tree761843c7ec64a7c0f1099cfa94b4405e2d028637 /source4/torture/raw
parent2b0537143c8e098da5638a6b4f8eeffd1cbef4d2 (diff)
downloadsamba-b5ee277f1aa119e0acd498ab443e4eb990387af1.tar.gz
samba-b5ee277f1aa119e0acd498ab443e4eb990387af1.tar.bz2
samba-b5ee277f1aa119e0acd498ab443e4eb990387af1.zip
r14948: add testing of truncate events, and add truncate support to inotify
backend (This used to be commit b80523a631ec57c7d19e9a23dca4594d71036138)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/notify.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index 8a982a7211..0e79a7ce07 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -205,7 +205,7 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smbcli_unlink(cli->tree, BASEDIR "\\test*.txt");
CHECK_STATUS(status, NT_STATUS_OK);
- /* recev the 3rd notify */
+ /* receive the 3rd notify */
status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(notify.out.num_changes, 1);
@@ -214,6 +214,7 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/* and we now see the rest of the unlink calls on both directory handles */
notify.in.file.fnum = fnum;
+ msleep(10);
req = smb_raw_changenotify_send(cli->tree, &notify);
status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -578,6 +579,14 @@ static BOOL test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
NOTIFY_ACTION_MODIFIED,
0, 1);
+ printf("testing truncate\n");
+ NOTIFY_MASK_TEST(
+ fnum2 = create_complex_file(cli, mem_ctx, BASEDIR "\\tname1");,
+ smbcli_ftruncate(cli->tree, fnum2, 10000);,
+ (smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
+ NOTIFY_ACTION_MODIFIED,
+ FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
+
done:
smb_raw_exit(cli->session);
return ret;