diff options
author | Andreas Schneider <asn@samba.org> | 2012-06-26 09:58:12 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-07-06 10:00:56 +0200 |
commit | 8bc4d7a3e61f5af4ed1e731b43a8530b80403d3a (patch) | |
tree | eb52dda2fbbcf027b1d00589b9b3ab61763acdf3 | |
parent | 22da7106b3c7a8b531d18c59401414bb548528ee (diff) | |
download | samba-8bc4d7a3e61f5af4ed1e731b43a8530b80403d3a.tar.gz samba-8bc4d7a3e61f5af4ed1e731b43a8530b80403d3a.tar.bz2 samba-8bc4d7a3e61f5af4ed1e731b43a8530b80403d3a.zip |
s4-torture: Make sure lsa_OpenPolicy fails over TCP/IP.
-rw-r--r-- | source4/torture/rpc/lsa.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 98fef0f301..d2f1bcef23 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -40,7 +40,8 @@ static void init_lsa_String(struct lsa_String *name, const char *s) } static bool test_OpenPolicy(struct dcerpc_binding_handle *b, - struct torture_context *tctx) + struct torture_context *tctx, + bool test_fail) /* check if the tests fails! */ { struct lsa_ObjectAttribute attr; struct policy_handle handle; @@ -72,9 +73,11 @@ static bool test_OpenPolicy(struct dcerpc_binding_handle *b, 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, "not considering %s to be an error\n", - nt_errstr(r.out.result)); - return true; + if (test_fail) { + torture_comment(tctx, "not considering %s to be an error\n", + nt_errstr(r.out.result)); + return true; + } } torture_comment(tctx, "OpenPolicy failed - %s\n", nt_errstr(r.out.result)); @@ -3076,10 +3079,18 @@ bool torture_rpc_lsa(struct torture_context *tctx) /* Test lsaLookupSids3 and lsaLookupNames4 over tcpip */ if (p->binding->transport == NCACN_IP_TCP) { - return test_many_LookupSids(p, tctx, handle); + if (!test_OpenPolicy(b, tctx, true)) { + ret = false; + } + + if (!test_many_LookupSids(p, tctx, handle)) { + ret = false; + } + + return ret; } - if (!test_OpenPolicy(b, tctx)) { + if (!test_OpenPolicy(b, tctx, false)) { ret = false; } @@ -3176,7 +3187,7 @@ static bool testcase_LookupNames(struct torture_context *tctx, return true; } - if (!test_OpenPolicy(b, tctx)) { + if (!test_OpenPolicy(b, tctx, false)) { ret = false; } @@ -3269,7 +3280,7 @@ static bool testcase_TrustedDomains(struct torture_context *tctx, torture_comment(tctx, "Testing %d domains\n", state->num_trusts); - if (!test_OpenPolicy(b, tctx)) { + if (!test_OpenPolicy(b, tctx, false)) { ret = false; } @@ -3335,7 +3346,7 @@ static bool testcase_Privileges(struct torture_context *tctx, return true; } - if (!test_OpenPolicy(b, tctx)) { + if (!test_OpenPolicy(b, tctx, false)) { ret = false; } |