From 29c3a277e10e9c87c6965c4c6fb26a01b1277c57 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 16 Jul 2009 00:56:17 +0200 Subject: s4-smbtorture: move all trusted domain tests to RPC-LSA-TRUSTED-DOMAINS. Guenther --- source4/torture/rpc/lsa.c | 55 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 7 deletions(-) (limited to 'source4/torture/rpc/lsa.c') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 7d03e7ef9e..1794a033bc 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -2632,13 +2632,6 @@ bool torture_rpc_lsa(struct torture_context *tctx) if (!test_CreateSecret(p, tctx, handle)) { ret = false; } - if (!test_CreateTrustedDomain(p, tctx, handle)) { - ret = false; - } - - if (!test_CreateTrustedDomainEx2(p, tctx, handle)) { - ret = false; - } if (!test_EnumAccounts(p, tctx, handle)) { ret = false; @@ -2766,3 +2759,51 @@ struct torture_suite *torture_rpc_lsa_lookup_names(TALLOC_CTX *mem_ctx) return suite; } + +static bool testcase_TrustedDomains(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + bool ret = true; + struct policy_handle *handle; + + if (!test_OpenPolicy(p, tctx)) { + ret = false; + } + + if (!test_lsa_OpenPolicy2(p, tctx, &handle)) { + ret = false; + } + + if (!handle) { + ret = false; + } + + if (!test_CreateTrustedDomain(p, tctx, handle)) { + ret = false; + } + + if (!test_CreateTrustedDomainEx2(p, tctx, handle)) { + ret = false; + } + + if (!test_lsa_Close(p, tctx, handle)) { + ret = false; + } + + return ret; +} + +struct torture_suite *torture_rpc_lsa_trusted_domains(TALLOC_CTX *mem_ctx) +{ + struct torture_suite *suite; + struct torture_rpc_tcase *tcase; + + suite = torture_suite_create(mem_ctx, "LSA-TRUSTED-DOMAINS"); + + tcase = torture_suite_add_rpc_iface_tcase(suite, "lsa", + &ndr_table_lsarpc); + torture_rpc_tcase_add_test(tcase, "TrustedDomains", + testcase_TrustedDomains); + + return suite; +} -- cgit