summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2021-08-19 12:13:27 +0100
committerJule Anger <janger@samba.org>2021-08-25 13:01:09 +0000
commit20ec0ea95e936ce4d1e9243cd377376fd5778575 (patch)
treee9fc77b7080aae19ba9e59168a0bd759e10484c8
parent34d2bc284607ada608948bfccc7686fb14cb9c39 (diff)
downloadsamba-20ec0ea95e936ce4d1e9243cd377376fd5778575.tar.gz
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 <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 161cee6f36b1642e2096a64a4eec22a1ebf82aa2)
-rw-r--r--source4/torture/smb2/streams.c6
1 files changed, 4 insertions, 2 deletions
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;
}