diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-04-09 09:02:48 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-04-09 16:28:31 +0200 |
commit | 5844a7dfe6a952500456a6bc3acbe9566d830a2a (patch) | |
tree | d15ebe2b1d401d80aebc5d34ce6c865def63d642 /source4/torture/rpc | |
parent | e95e2e82624eab72c1ae913b9b2b00412c91802e (diff) | |
download | samba-5844a7dfe6a952500456a6bc3acbe9566d830a2a.tar.gz samba-5844a7dfe6a952500456a6bc3acbe9566d830a2a.tar.bz2 samba-5844a7dfe6a952500456a6bc3acbe9566d830a2a.zip |
s4:torture/rpc/lsa.c: add test_lsa_OpenPolicy2_ex() that takes an expected status
metze
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/lsa.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 7ad6697084..2323920581 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -83,13 +83,15 @@ static bool test_OpenPolicy(struct dcerpc_binding_handle *b, } -bool test_lsa_OpenPolicy2(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle **handle) +bool test_lsa_OpenPolicy2_ex(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle **handle, + NTSTATUS expected_status) { struct lsa_ObjectAttribute attr; struct lsa_QosInfo qos; struct lsa_OpenPolicy2 r; + NTSTATUS status; torture_comment(tctx, "\nTesting OpenPolicy2\n"); @@ -115,8 +117,12 @@ bool test_lsa_OpenPolicy2(struct dcerpc_binding_handle *b, r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; r.out.handle = *handle; - torture_assert_ntstatus_ok(tctx, dcerpc_lsa_OpenPolicy2_r(b, tctx, &r), + status = dcerpc_lsa_OpenPolicy2_r(b, tctx, &r); + torture_assert_ntstatus_equal(tctx, status, expected_status, "OpenPolicy2 failed"); + if (!NT_STATUS_IS_OK(expected_status)) { + 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)) { @@ -135,6 +141,13 @@ bool test_lsa_OpenPolicy2(struct dcerpc_binding_handle *b, } +bool test_lsa_OpenPolicy2(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle **handle) +{ + return test_lsa_OpenPolicy2_ex(b, tctx, handle, NT_STATUS_OK); +} + static const char *sid_type_lookup(enum lsa_SidType r) { switch (r) { |