From f0908c1dc604b304a788261784a39d08cfb48760 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Sep 2012 08:40:05 +1000 Subject: torture: tidy up rpc.lsa OpenPolicy2 test to more clearly use torture_fail() --- source4/torture/rpc/lsa.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 942dd5234b..27b307f2f3 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -247,22 +247,18 @@ static bool test_OpenPolicy2_fail(struct dcerpc_binding_handle *b, return true; } - if (!NT_STATUS_IS_OK(r.out.result)) { - if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_ACCESS_DENIED) || - NT_STATUS_EQUAL(r.out.result, NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED)) { - torture_comment(tctx, - "OpenPolicy2 correctly returned with " - "result: %s\n", - nt_errstr(r.out.result)); - return true; - } + if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_ACCESS_DENIED) || + NT_STATUS_EQUAL(r.out.result, NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED)) { + torture_comment(tctx, + "OpenPolicy2 correctly returned with " + "result: %s\n", + nt_errstr(r.out.result)); + return true; } - torture_assert_ntstatus_equal(tctx, - r.out.result, - NT_STATUS_OK, - "OpenPolicy2 return value should be " - "ACCESS_DENIED"); + torture_fail(tctx, + "OpenPolicy2 return value should be " + "ACCESS_DENIED or RPC_PROTSEQ_NOT_SUPPORTED"); return false; } -- cgit