From: David Mulder Date: Fri, 13 Dec 2019 20:08:28 +0000 (-0700) Subject: torture4: openattr always succeeds X-Git-Tag: ldb-2.2.0~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fad2bd8ec7a2b2fc873792519e56564fdd750e85;p=thirdparty%2Fsamba.git torture4: openattr always succeeds 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 Reviewed-by: Isaac Boukris Autobuild-User(master): David Mulder Autobuild-Date(master): Wed Jun 24 22:13:11 UTC 2020 on sn-devel-184 --- diff --git a/source4/torture/basic/attr.c b/source4/torture/basic/attr.c index 9eb9ec877ee..f2a554d776c 100644 --- a/source4/torture/basic/attr.c +++ b/source4/torture/basic/attr.c @@ -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; }