From: Andrew Bartlett Date: Wed, 29 Nov 2017 20:35:20 +0000 (+1300) Subject: torture: Use torture_assert{,_int_equal}_goto() in smb2.kernel-oplocks X-Git-Tag: talloc-2.1.11~314 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e4286ec4f3b434c69f124714bb99015dfd8cf08;p=thirdparty%2Fsamba.git torture: Use torture_assert{,_int_equal}_goto() in smb2.kernel-oplocks This allows this test to be added as flapping. Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c index b6d9f842336..6d749f92c1c 100644 --- a/source4/torture/smb2/oplock.c +++ b/source4/torture/smb2/oplock.c @@ -5040,7 +5040,8 @@ static bool test_smb2_kernel_oplocks8(struct torture_context *tctx, io.in.fname = fname; req = smb2_create_send(tree, &io); - torture_assert(tctx, req != NULL, "smb2_create_send"); + torture_assert_goto(tctx, req != NULL, + ret, done, "smb2_create_send"); /* Ensure while the open is blocked the smbd is still serving other requests. */ @@ -5058,7 +5059,8 @@ static bool test_smb2_kernel_oplocks8(struct torture_context *tctx, h1 = io.out.file.handle; /* in less than 2 seconds. Otherwise the server blocks. */ - torture_assert(tctx, end - start < 2, "server was blocked !"); + torture_assert_goto(tctx, end - start < 2, + ret, done, "server was blocked !"); /* Pick up the return for the initial blocking open. */ status = smb2_create_recv(req, tctx, &io); @@ -5071,14 +5073,12 @@ static bool test_smb2_kernel_oplocks8(struct torture_context *tctx, /* Wait for the exit code from the child. */ while (child_exit_code == -1) { int rval = tevent_loop_once(tctx->ev); - torture_assert(tctx, rval == 0, "tevent_loop_once error\n"); + torture_assert_goto(tctx, rval == 0, ret, + done, "tevent_loop_once error\n"); } - if (child_exit_code != 0) { - torture_comment(tctx, "Bad child exit code %d\n", - child_exit_code); - ret = false; - } + torture_assert_int_equal_goto(tctx, child_exit_code, 0, + ret, done, "Bad child exit code"); done: if (!smb2_util_handle_empty(h1)) {