diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-12-06 13:17:34 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:48:19 +0100 |
commit | 8036dbcf7fbd19bd5f8ad3fd2d29010442e43f29 (patch) | |
tree | 566e4597f2e0865ee80c480e23d31f4795528c42 /source4 | |
parent | 8edcbc847452b8e95c99427f94dde1fa968089a6 (diff) | |
download | samba-8036dbcf7fbd19bd5f8ad3fd2d29010442e43f29.tar.gz samba-8036dbcf7fbd19bd5f8ad3fd2d29010442e43f29.tar.bz2 samba-8036dbcf7fbd19bd5f8ad3fd2d29010442e43f29.zip |
r26306: BASE-DELAYWRITE: print access time stamps and test fileinfo and pathinfo match
metze
(This used to be commit 58bc21a3f849ef7200733450dbd68f15658ff8f6)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/basic/delaywrite.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c index 9043e499a8..94e322c800 100644 --- a/source4/torture/basic/delaywrite.c +++ b/source4/torture/basic/delaywrite.c @@ -629,6 +629,37 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s #define COMPARE_WRITE_TIME_LESS(given,correct) \ COMPARE_WRITE_TIME_CMP(given,correct,>=) +#define COMPARE_ACCESS_TIME_CMP(given, correct, cmp) do { \ + NTTIME g = (given).basic_info.out.access_time; \ + NTTIME c = (correct).basic_info.out.access_time; \ + if (g cmp c) { \ + torture_result(tctx, TORTURE_FAIL, __location__": wrong access_time (%s)%s %s (%s)%s", \ + #given, nt_time_string(tctx, g), \ + #cmp, #correct, nt_time_string(tctx, c)); \ + ret = false; \ + goto done; \ + } \ +} while (0) +#define COMPARE_ACCESS_TIME_EQUAL(given,correct) \ + COMPARE_ACCESS_TIME_CMP(given,correct,!=) +#define COMPARE_ACCESS_TIME_GREATER(given,correct) \ + COMPARE_ACCESS_TIME_CMP(given,correct,<=) +#define COMPARE_ACCESS_TIME_LESS(given,correct) \ + COMPARE_ACCESS_TIME_CMP(given,correct,>=) + +#define COMPARE_BOTH_TIMES_EQUAL(given,correct) do { \ + COMPARE_ACCESS_TIME_EQUAL(given,correct); \ + COMPARE_WRITE_TIME_EQUAL(given,correct); \ +} while (0) +#define COMPARE_BOTH_TIMES_GEATER(given,correct) do { \ + COMPARE_ACCESS_TIME_GREATER(given,correct); \ + COMPARE_WRITE_TIME_GREATER(given,correct); \ +} while (0) +#define COMPARE_BOTH_TIMES_LESS(given,correct) do { \ + COMPARE_ACCESS_TIME_LESS(given,correct); \ + COMPARE_WRITE_TIME_LESS(given,correct); \ +} while (0) + #define GET_INFO_FILE(finfo) do { \ NTSTATUS _status; \ _status = smb_raw_fileinfo(cli->tree, tctx, &finfo); \ @@ -638,7 +669,8 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s nt_errstr(_status)); \ goto done; \ } \ - torture_comment(tctx, "fileinfo: Write time (%s)\n", \ + torture_comment(tctx, "fileinfo: Access(%s) Write(%s)\n", \ + nt_time_string(tctx, finfo.basic_info.out.access_time), \ nt_time_string(tctx, finfo.basic_info.out.write_time)); \ } while (0) #define GET_INFO_PATH(pinfo) do { \ @@ -650,13 +682,14 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s ret = false; \ goto done; \ } \ - torture_comment(tctx, "pathinfo: Write time (%s)\n", \ + torture_comment(tctx, "pathinfo: Access(%s) Write(%s)\n", \ + nt_time_string(tctx, pinfo.basic_info.out.access_time), \ nt_time_string(tctx, pinfo.basic_info.out.write_time)); \ } while (0) #define GET_INFO_BOTH(finfo,pinfo) do { \ GET_INFO_FILE(finfo); \ GET_INFO_PATH(pinfo); \ - COMPARE_WRITE_TIME_EQUAL(finfo,pinfo); \ + COMPARE_BOTH_TIMES_EQUAL(finfo,pinfo); \ } while (0) #define SET_INFO_FILE_EX(finfo, wrtime, tree, tfnum) do { \ |