s4-smbtorture: move all trusted domain tests to RPC-LSA-TRUSTED-DOMAINS.
authorGünther Deschner <gd@samba.org>
Wed, 15 Jul 2009 22:56:17 +0000 (00:56 +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 7d03e7ef9ebbd6c76b7e8d6576ad80f34c61895a..1794a033bc16103eed2c3ed3690a00613a82c8c7 100644 (file)
@@ -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;
+}
index 6eeba7f66c601f6d4a4c7c5801880d8aae21e7f0..94297088c35a477e0151f937785f5983dc10d6a6 100644 (file)
@@ -431,6 +431,7 @@ NTSTATUS torture_rpc_init(void)
        torture_suite_add_suite(suite, torture_rpc_lsa_lookup_sids(suite));
        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_echo(suite));
        torture_suite_add_simple_test(suite, "DFS", torture_rpc_dfs);
        torture_suite_add_suite(suite, torture_rpc_frsapi(suite));