s4:torture/rpc: add extra_flags to torture_rpc_connection_transport()
authorStefan Metzmacher <metze@samba.org>
Thu, 15 Sep 2016 06:36:32 +0000 (08:36 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 26 Oct 2016 09:20:17 +0000 (11:20 +0200)
This can be used to pass DCERPC_CONCURRENT_MULTIPLEX, which
sends DCERPC_PFC_FLAG_CONC_MPX in the DCERPC_BIND.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/rpc/handles.c
source4/torture/rpc/rpc.c
source4/torture/rpc/witness.c

index 98005212370fd5f59476591285292e126eb26e48..fcbe7c4ee333cd1ea16116a6ee63c8a89945d9a6 100644 (file)
@@ -131,7 +131,8 @@ static bool test_handles_lsa_shared(struct torture_context *torture)
        torture_comment(torture, "connect lsa pipe2\n");
        status = torture_rpc_connection_transport(torture, &p2, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_ok(torture, status, "opening lsa pipe2");
        b2 = p2->binding_handle;
 
@@ -170,7 +171,8 @@ static bool test_handles_lsa_shared(struct torture_context *torture)
        torture_comment(torture, "connect lsa pipe3 after the policy handle is opened\n");
        status = torture_rpc_connection_transport(torture, &p3, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_ok(torture, status, "opening lsa pipe3");
        b3 = p3->binding_handle;
 
@@ -310,7 +312,8 @@ static bool test_handles_lsa_shared(struct torture_context *torture)
        torture_comment(torture, "connect lsa pipe4 and use policy handle\n");
        status = torture_rpc_connection_transport(torture, &p4, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_ok(torture, status, "opening lsa pipe4");
        b4 = p4->binding_handle;
 
@@ -335,7 +338,8 @@ static bool test_handles_lsa_shared(struct torture_context *torture)
        torture_comment(torture, "connect lsa pipe5 - should fail\n");
        status = torture_rpc_connection_transport(torture, &p5, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening lsa pipe5");
 
@@ -423,7 +427,8 @@ static bool test_handles_mixed_shared(struct torture_context *torture)
        torture_comment(torture, "connect lsa pipe2\n");
        status = torture_rpc_connection_transport(torture, &p2, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_ok(torture, status, "opening lsa pipe2");
        b2 = p2->binding_handle;
 
@@ -460,14 +465,16 @@ static bool test_handles_mixed_shared(struct torture_context *torture)
        torture_comment(torture, "connect samr pipe3 - should fail\n");
        status = torture_rpc_connection_transport(torture, &p3, &ndr_table_samr,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening samr pipe3");
 
        torture_comment(torture, "connect lsa pipe4 - should fail\n");
        status = torture_rpc_connection_transport(torture, &p4, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening lsa pipe4");
 
@@ -479,14 +486,16 @@ static bool test_handles_mixed_shared(struct torture_context *torture)
        torture_comment(torture, "connect samr pipe5 with assoc_group_id[0x%08X]- should fail\n", ++assoc_group_id);
        status = torture_rpc_connection_transport(torture, &p5, &ndr_table_samr,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening samr pipe5");
 
        torture_comment(torture, "connect lsa pipe6 with assoc_group_id[0x%08X]- should fail\n", ++assoc_group_id);
        status = torture_rpc_connection_transport(torture, &p6, &ndr_table_lsarpc,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening lsa pipe6");
 
@@ -523,14 +532,16 @@ static bool test_handles_random_assoc(struct torture_context *torture)
        torture_comment(torture, "connect samr pipe2 with assoc_group_id[0x%08X]- should fail\n", ++assoc_group_id);
        status = torture_rpc_connection_transport(torture, &p2, &ndr_table_samr,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening samr pipe2");
 
        torture_comment(torture, "connect samr pipe3 with assoc_group_id[0x%08X]- should fail\n", ++assoc_group_id);
        status = torture_rpc_connection_transport(torture, &p3, &ndr_table_samr,
                                                  transport,
-                                                 assoc_group_id);
+                                                 assoc_group_id,
+                                                 0);
        torture_assert_ntstatus_equal(torture, status, NT_STATUS_UNSUCCESSFUL,
                                      "opening samr pipe3");
 
index 6553229eaa703854edb3ecb3479c303998be36b7..e0ed70ccbc95518570023e3d2d42b82438aabe55 100644 (file)
@@ -100,7 +100,8 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx,
                                          struct dcerpc_pipe **p, 
                                          const struct ndr_interface_table *table,
                                          enum dcerpc_transport_t transport,
-                                         uint32_t assoc_group_id)
+                                         uint32_t assoc_group_id,
+                                         uint32_t extra_flags)
 {
        NTSTATUS status;
        struct dcerpc_binding *binding;
@@ -122,6 +123,11 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx,
                return status;
        }
 
+       status = dcerpc_binding_set_flags(binding, extra_flags, 0);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
        status = dcerpc_pipe_connect_b(tctx, p, binding, table,
                                       cmdline_credentials,
                                       tctx->ev, tctx->lp_ctx);
index 1d4ae8636a0565764ec51344d858e67906322e72..d3edd023e4987d486dcc9879e35e16a0e3df5e92 100644 (file)
@@ -79,7 +79,7 @@ static bool find_sofs_share(struct torture_context *tctx,
 
        torture_assert_ntstatus_ok(tctx,
                torture_rpc_connection_transport(tctx, &p, &ndr_table_srvsvc,
-                                                NCACN_NP, 0),
+                                                NCACN_NP, 0, 0),
                "failed to setup srvsvc connection");
 
        b = p->binding_handle;