]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbtorture: adjust "smb2.timestamps.delayed-2write" for modern SMB delayed write
authorRalph Boehme <slow@samba.org>
Tue, 4 Mar 2025 15:32:11 +0000 (16:32 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 27 Mar 2025 05:37:44 +0000 (05:37 +0000)
The adjusted test passes against Windows Server 2022.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/samba3.base.delaywrite
source4/torture/smb2/timestamps.c

index 89e1adf0e3233cee7a1af69a6a99d4f000d0e2d7..22d37ff1c52d74f0d06b138041572d9d89458ea9 100644 (file)
@@ -15,3 +15,4 @@
 ^samba3.smb2.timestamps.delayed-write-vs-seteof\(.*\)
 ^samba3.smb2.timestamps.delayed-write-vs-flush\(.*\)
 ^samba3.smb2.timestamps.delayed-write-vs-setbasic\(.*\)
+^samba3.smb2.timestamps.delayed-2write\(.*\)
index 9149926de2042f756d901a4b65d583b35f4d426f..303c3e544983afa35647bf41a6a877cac3395a47 100644 (file)
@@ -1110,7 +1110,7 @@ static bool test_delayed_2write(struct torture_context *tctx,
                                        "write failed\n");
        sleep(3);
 
-       torture_comment(tctx, "Check writetime has NOT been updated\n");
+       torture_comment(tctx, "Check writetime has also been updated\n");
 
        finfo = (union smb_fileinfo) {
                .generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
@@ -1121,13 +1121,13 @@ static bool test_delayed_2write(struct torture_context *tctx,
                                        "getinfo failed\n");
        write_time2 = finfo.all_info.out.write_time;
 
-       torture_assert_nttime_equal(tctx, write_time2, write_time,
-                                   "second write updated write-time (wrong!)\n");
+       torture_assert_nttime_not_equal(tctx, write_time2, write_time,
+                                       "second write updated write-time (wrong!)\n");
 
        torture_comment(tctx, "Close file-handle 1\n");
        sleep(2);
 
-       torture_comment(tctx, "Check writetime has been updated\n");
+       torture_comment(tctx, "Check writetime has not been updated\n");
 
        c = (struct smb2_close) {
                .in.file.handle = h1,
@@ -1140,10 +1140,10 @@ static bool test_delayed_2write(struct torture_context *tctx,
        ZERO_STRUCT(h1);
        close_time = c.out.write_time;
 
-       if (!(close_time > write_time)) {
+       if (close_time != write_time2) {
                ret = false;
                torture_fail_goto(tctx, done,
-                                 "Write-time not updated (wrong!)\n");
+                                 "Write-time updated (wrong!)\n");
        }
 
 done: