s4-smbtorture: move all privilege tests to RPC-LSA-PRIVILEGES.
authorGünther Deschner <gd@samba.org>
Thu, 16 Jul 2009 00:10:23 +0000 (02:10 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 16 Jul 2009 08:03:12 +0000 (10:03 +0200)
Guenther

source4/torture/rpc/lsa.c
source4/torture/rpc/rpc.c

index 1794a033bc16103eed2c3ed3690a00613a82c8c7..801bc8711e2fc11992863b61fa2fa49605e504c6 100644 (file)
@@ -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;
+}
index 94297088c35a477e0151f937785f5983dc10d6a6..ffdd7484708b7e99d5f7d52872539c252094267a 100644 (file)
@@ -432,6 +432,7 @@ NTSTATUS torture_rpc_init(void)
        torture_suite_add_suite(suite, torture_rpc_lsa_lookup_names(suite));
        torture_suite_add_suite(suite, torture_rpc_lsa_secrets(suite));
        torture_suite_add_suite(suite, torture_rpc_lsa_trusted_domains(suite));
+       torture_suite_add_suite(suite, torture_rpc_lsa_privileges(suite));
        torture_suite_add_suite(suite, torture_rpc_echo(suite));
        torture_suite_add_simple_test(suite, "DFS", torture_rpc_dfs);
        torture_suite_add_suite(suite, torture_rpc_frsapi(suite));