]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture4: openattr always succeeds
authorDavid Mulder <dmulder@suse.com>
Fri, 13 Dec 2019 20:08:28 +0000 (13:08 -0700)
committerDavid Mulder <dmulder@samba.org>
Wed, 24 Jun 2020 22:13:10 +0000 (22:13 +0000)
Because this test returned true, it would always
succeed, despite failures in the test. Make it
return false if there are failures. Also, removed
a stray CHECK_MAX_FAILURES introduced by commit
8773e743 that caused the test to *always* fail
(but always be ignored).

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Wed Jun 24 22:13:11 UTC 2020 on sn-devel-184

source4/torture/basic/attr.c

index 9eb9ec877eec7551f0b0ee0db8b75fe46e0d6b5d..f2a554d776c5838539f549e1df3c86e981a5c948 100644 (file)
@@ -132,12 +132,13 @@ bool torture_openattrtest(struct torture_context *tctx,
                                                CHECK_MAX_FAILURES(error_exit);
                                        }
                                }
-                               torture_assert_ntstatus_equal(tctx, 
-                                       smbcli_nt_error(cli1->tree), NT_STATUS_ACCESS_DENIED, 
-                                       talloc_asprintf(tctx, "[%d] trunc open 0x%x -> 0x%x failed with wrong error code %s",
+                               if (!NT_STATUS_EQUAL(smbcli_nt_error(cli1->tree), NT_STATUS_ACCESS_DENIED)) {
+                                       torture_result(tctx, TORTURE_FAIL,
+                                                       "[%d] trunc open 0x%x -> 0x%x failed with wrong error code %s",
                                                        k, open_attrs_table[i], open_attrs_table[j],
-                                                       smbcli_errstr(cli1->tree)));
+                                                       smbcli_errstr(cli1->tree));
                                        CHECK_MAX_FAILURES(error_exit);
+                               }
 #if 0
                                torture_comment(tctx, "[%d] trunc open 0x%x -> 0x%x failed\n", k, open_attrs_table[i], open_attrs_table[j]);
 #endif
@@ -182,6 +183,9 @@ error_exit:
        smbcli_setatr(cli1->tree, fname, 0, 0);
        smbcli_unlink(cli1->tree, fname);
 
+       if (failures) {
+               return false;
+       }
        return true;
 }