s4-torture: Make sure ncacn_np tests are only called over the a pipe.
authorAndreas Schneider <asn@samba.org>
Mon, 25 Jun 2012 17:06:34 +0000 (19:06 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 6 Jul 2012 08:00:56 +0000 (10:00 +0200)
source4/torture/rpc/lsa.c
source4/torture/rpc/lsa_lookup.c

index 4d6cf5de8cc4d80fa72ddf071abcd20158634a58..98fef0f30135a50370e5926150289653e14ac696 100644 (file)
@@ -3063,7 +3063,7 @@ bool torture_rpc_lsa(struct torture_context *tctx)
         NTSTATUS status;
         struct dcerpc_pipe *p;
        bool ret = true;
-       struct policy_handle *handle;
+       struct policy_handle *handle = NULL;
        struct test_join *join = NULL;
        struct cli_credentials *machine_creds;
        struct dcerpc_binding_handle *b;
@@ -3074,6 +3074,11 @@ bool torture_rpc_lsa(struct torture_context *tctx)
        }
        b = p->binding_handle;
 
+       /* Test lsaLookupSids3 and lsaLookupNames4 over tcpip */
+       if (p->binding->transport == NCACN_IP_TCP) {
+               return test_many_LookupSids(p, tctx, handle);
+       }
+
        if (!test_OpenPolicy(b, tctx)) {
                ret = false;
        }
@@ -3164,6 +3169,13 @@ static bool testcase_LookupNames(struct torture_context *tctx,
        struct lsa_TransNameArray2 tnames2;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
+       if (p->binding->transport != NCACN_NP &&
+           p->binding->transport != NCALRPC) {
+               torture_comment(tctx, "testcase_LookupNames is only available "
+                               "over NCACN_NP or NCALRPC");
+               return true;
+       }
+
        if (!test_OpenPolicy(b, tctx)) {
                ret = false;
        }
@@ -3248,6 +3260,13 @@ static bool testcase_TrustedDomains(struct torture_context *tctx,
                talloc_get_type_abort(data, struct lsa_trustdom_state);
        struct dcerpc_binding_handle *b = p->binding_handle;
 
+       if (p->binding->transport != NCACN_NP &&
+           p->binding->transport != NCALRPC) {
+               torture_comment(tctx, "testcase_TrustedDomains is only available "
+                               "over NCACN_NP or NCALRPC");
+               return true;
+       }
+
        torture_comment(tctx, "Testing %d domains\n", state->num_trusts);
 
        if (!test_OpenPolicy(b, tctx)) {
@@ -3309,6 +3328,13 @@ static bool testcase_Privileges(struct torture_context *tctx,
        struct policy_handle *handle;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
+       if (p->binding->transport != NCACN_NP &&
+           p->binding->transport != NCALRPC) {
+               torture_comment(tctx, "testcase_Privileges is only available "
+                               "over NCACN_NP or NCALRPC");
+               return true;
+       }
+
        if (!test_OpenPolicy(b, tctx)) {
                ret = false;
        }
index c4b4cf93743daa693f5770ae0af3adfb95304c60..587ab630bd7049b6de0a32477829c348e6a5cec3 100644 (file)
@@ -228,6 +228,14 @@ bool torture_rpc_lsa_lookup(struct torture_context *torture)
        }
        b = p->binding_handle;
 
+       if (p->binding->transport != NCACN_NP &&
+           p->binding->transport != NCALRPC) {
+               torture_comment(torture,
+                               "torture_rpc_lsa_lookup is only available "
+                               "over NCACN_NP or NCALRPC");
+               return true;
+       }
+
        ret &= open_policy(torture, b, &handle);
        if (!ret) return false;
 
@@ -336,6 +344,14 @@ static bool test_LookupSidsReply(struct torture_context *tctx,
        const char *dom_admin_sid;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
+       if (p->binding->transport != NCACN_NP &&
+           p->binding->transport != NCALRPC) {
+               torture_comment(tctx,
+                               "test_LookupSidsReply is only available "
+                               "over NCACN_NP or NCALRPC");
+               return true;
+       }
+
        if (!open_policy(tctx, b, &handle)) {
                return false;
        }