summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-05-23 19:11:59 +0200
committerJeremy Allison <jra@samba.org>2014-05-23 22:42:24 +0200
commit04cddfc739164aba6ee1466792ae542040604a07 (patch)
tree1ca2f58de119680ab157e046ef02e3b9a7c5d70a /source4
parentf739480862373444e9cc8e3790dc052a7ecb271e (diff)
downloadsamba-04cddfc739164aba6ee1466792ae542040604a07.tar.gz
samba-04cddfc739164aba6ee1466792ae542040604a07.tar.xz
samba-04cddfc739164aba6ee1466792ae542040604a07.zip
torture/smb2/dir: check create time match find
This adds a check to ensure that the create time returned in the SMB2 create response matches the value found in the find response. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 23 22:42:24 CEST 2014 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smb2/dir.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source4/torture/smb2/dir.c b/source4/torture/smb2/dir.c
index 9cb85d7d570..0e409f2b70a 100644
--- a/source4/torture/smb2/dir.c
+++ b/source4/torture/smb2/dir.c
@@ -41,6 +41,7 @@
struct file_elem {
char *name;
+ NTTIME create_time;
bool found;
};
@@ -89,6 +90,7 @@ static NTSTATUS populate_tree(struct torture_context *tctx,
DNAME, files[i].name);
status = smb2_create(tree, mem_ctx, &create);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "");
+ files[i].create_time = create.out.create_time;
smb2_util_close(tree, create.out.file.handle);
}
done:
@@ -130,17 +132,27 @@ static bool test_find(struct torture_context *tctx,
for (i = 0; i < count; i++) {
bool expected;
const char *found = d[i].both_directory_info.name.s;
+ NTTIME ctime = d[i].both_directory_info.create_time;
if (!strcmp(found, ".") || !strcmp(found, ".."))
continue;
expected = false;
for (j = 0; j < NFILES; j++) {
- if (!strcmp(files[j].name, found)) {
- files[j].found = true;
- expected = true;
- break;
+ if (strcmp(files[j].name, found) != 0) {
+ continue;
}
+
+ if (files[j].create_time != ctime) {
+ torture_result(tctx, TORTURE_FAIL,
+ "(%s): create_time mismatch for %s"
+ "\n", __location__, found);
+ ret = false;
+ goto done;
+ }
+ files[j].found = true;
+ expected = true;
+ break;
}
if (expected)