From: Noel Power Date: Thu, 19 Aug 2021 11:13:27 +0000 (+0100) Subject: s4: torture: CHECK ret value and fail if false X-Git-Tag: ldb-2.5.0~894 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=161cee6f36b1642e2096a64a4eec22a1ebf82aa2;p=thirdparty%2Fsamba.git s4: torture: CHECK ret value and fail if false If we reach 'done' with ret == false without setting the torture result we get unexpected results e.g. Exception: Exception: Unknown error/failure. Missing torture_fail() or torture_assert_*() call? BUG: https://bugzilla.samba.org/show_bug.cgi?id=14760 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/source4/torture/smb2/streams.c b/source4/torture/smb2/streams.c index 814ed1666c7..c5ece0d9bcb 100644 --- a/source4/torture/smb2/streams.c +++ b/source4/torture/smb2/streams.c @@ -957,7 +957,7 @@ static bool test_stream_names(struct torture_context *tctx, CHECK_STATUS(status, NT_STATUS_OK); ret &= check_stream_list(tree, tctx, fname, 4, four, io.smb2.out.file.handle); - + CHECK_VALUE(ret, true); smb2_util_close(tree, h1); smb2_util_close(tree, h2); smb2_util_close(tree, h3); @@ -973,6 +973,7 @@ static bool test_stream_names(struct torture_context *tctx, ret &= check_stream_list(tree, tctx, fname, 4, four, io.smb2.out.file.handle); + CHECK_VALUE(ret, true); for (i=0; i < 4; i++) { NTTIME write_time; uint64_t stream_size; @@ -1114,6 +1115,7 @@ static bool test_stream_names(struct torture_context *tctx, ret &= check_stream_list(tree,tctx, fname, 5, five2, io.smb2.out.file.handle); + CHECK_VALUE(ret, true); ZERO_STRUCT(sinfo); sinfo.rename_information.level = RAW_SFILEINFO_RENAME_INFORMATION; sinfo.rename_information.in.file.handle = h1; @@ -1138,6 +1140,7 @@ static bool test_stream_names(struct torture_context *tctx, ret &= check_stream_list(tree,tctx, fname, 5, five2, io.smb2.out.file.handle); + CHECK_VALUE(ret, true); /* TODO: we need to test more rename combinations */ done: @@ -2062,6 +2065,5 @@ struct torture_suite *torture_smb2_streams_init(TALLOC_CTX *ctx) test_basefile_rename_with_open_stream); suite->description = talloc_strdup(suite, "SMB2-STREAM tests"); - return suite; }