summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/lsa.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-07-16 02:10:23 +0200
committerGünther Deschner <gd@samba.org>2009-07-16 10:03:12 +0200
commit47eb061b5345cccf322c165f510f54c04481d4bc (patch)
tree1f5022d6c0348b9a5da363399cc65938d106df1b /source4/torture/rpc/lsa.c
parent29c3a277e10e9c87c6965c4c6fb26a01b1277c57 (diff)
downloadsamba-47eb061b5345cccf322c165f510f54c04481d4bc.tar.gz
samba-47eb061b5345cccf322c165f510f54c04481d4bc.tar.bz2
samba-47eb061b5345cccf322c165f510f54c04481d4bc.zip
s4-smbtorture: move all privilege tests to RPC-LSA-PRIVILEGES.
Guenther
Diffstat (limited to 'source4/torture/rpc/lsa.c')
-rw-r--r--source4/torture/rpc/lsa.c65
1 files changed, 53 insertions, 12 deletions
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;
+}