struct smb2_flush f;
struct smb2_close c;
NTTIME create_time;
- NTTIME flush_time;
+ NTTIME write_time;
NTSTATUS status;
bool ret = true;
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"write failed\n");
- torture_comment(tctx, "Check writetime hasn't been updated\n");
+ torture_comment(tctx, "Check writetime has been updated\n");
finfo = (union smb_fileinfo) {
.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"getinfo failed\n");
- torture_assert_nttime_equal(tctx,
- finfo.all_info.out.write_time,
- create_time,
- "Writetime != create_time (wrong!)\n");
+ torture_assert_nttime_not_equal(tctx,
+ finfo.all_info.out.write_time,
+ create_time,
+ "Writetime not updated\n");
+ write_time = finfo.all_info.out.write_time;
torture_comment(tctx, "Flush file, "
- "should flush pending writetime update\n");
+ "there should be no pending writetime update\n");
f = (struct smb2_flush) {
.in.file.handle = h1,
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"flush failed\n");
- torture_comment(tctx, "Check writetime has been updated "
- "by the setinfo EOF\n");
+ torture_comment(tctx, "Check writetime has not been updated "
+ "by the flush\n");
finfo = (union smb_fileinfo) {
.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"getinfo failed\n");
- flush_time = finfo.all_info.out.write_time;
- if (!(flush_time > create_time)) {
- ret = false;
- torture_fail_goto(tctx, done, "flush hasn't updated writetime\n");
- }
+ torture_assert_nttime_equal(tctx,
+ finfo.all_info.out.write_time,
+ write_time,
+ "Writetime updated\n");
torture_comment(tctx, "Close file-handle 1, write-time should not be updated\n");
torture_assert_nttime_equal(tctx,
c.out.write_time,
- flush_time,
- "writetime != flushtime (wrong!)\n");
+ write_time,
+ "writetime updated\n");
done:
if (!smb2_util_handle_empty(h1)) {