From 47eb061b5345cccf322c165f510f54c04481d4bc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 16 Jul 2009 02:10:23 +0200 Subject: s4-smbtorture: move all privilege tests to RPC-LSA-PRIVILEGES. Guenther --- source4/torture/rpc/lsa.c | 65 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 12 deletions(-) (limited to 'source4/torture/rpc/lsa.c') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 1794a033bc..801bc8711e 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -2625,22 +2625,10 @@ bool torture_rpc_lsa(struct torture_context *tctx) ret = false; } - if (!test_CreateAccount(p, tctx, handle)) { - ret = false; - } - if (!test_CreateSecret(p, tctx, handle)) { ret = false; } - if (!test_EnumAccounts(p, tctx, handle)) { - ret = false; - } - - if (!test_EnumPrivs(p, tctx, handle)) { - ret = false; - } - if (!test_QueryInfoPolicy(p, tctx, handle)) { ret = false; } @@ -2807,3 +2795,56 @@ struct torture_suite *torture_rpc_lsa_trusted_domains(TALLOC_CTX *mem_ctx) return suite; } + +static bool testcase_Privileges(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_CreateAccount(p, tctx, handle)) { + ret = false; + } + + if (!test_EnumAccounts(p, tctx, handle)) { + ret = false; + } + + if (!test_EnumPrivs(p, tctx, handle)) { + ret = false; + } + + if (!test_lsa_Close(p, tctx, handle)) { + ret = false; + } + + return ret; +} + + +struct torture_suite *torture_rpc_lsa_privileges(TALLOC_CTX *mem_ctx) +{ + struct torture_suite *suite; + struct torture_rpc_tcase *tcase; + + suite = torture_suite_create(mem_ctx, "LSA-PRIVILEGES"); + + tcase = torture_suite_add_rpc_iface_tcase(suite, "lsa", + &ndr_table_lsarpc); + torture_rpc_tcase_add_test(tcase, "Privileges", + testcase_Privileges); + + return suite; +} -- cgit