s4:torture/rpc/mgmt.c: make use of dcerpc_binding_handle stubs
authorStefan Metzmacher <metze@samba.org>
Tue, 16 Mar 2010 09:43:39 +0000 (10:43 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 16 Mar 2010 14:35:30 +0000 (15:35 +0100)
metze

source4/torture/rpc/mgmt.c
source4/torture/rpc/scanner.c

index 95c13c0ca6e8e6fada23db36b6a67a1a976ab108..02fee16e55eb2454e046b7d071977d9c0cd6142f 100644 (file)
@@ -30,7 +30,8 @@
   ask the server what interface IDs are available on this endpoint
 */
 bool test_inq_if_ids(struct torture_context *tctx, 
-                    struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+                    struct dcerpc_binding_handle *b,
+                    TALLOC_CTX *mem_ctx,
                     bool (*per_id_test)(struct torture_context *,
                                         const struct ndr_interface_table *iface,
                                         TALLOC_CTX *mem_ctx,
@@ -45,7 +46,7 @@ bool test_inq_if_ids(struct torture_context *tctx,
        vector = talloc(mem_ctx, struct rpc_if_id_vector_t);
        r.out.if_id_vector = &vector;
        
-       status = dcerpc_mgmt_inq_if_ids(p, mem_ctx, &r);
+       status = dcerpc_mgmt_inq_if_ids_r(b, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
                printf("inq_if_ids failed - %s\n", nt_errstr(status));
                return false;
@@ -78,7 +79,7 @@ bool test_inq_if_ids(struct torture_context *tctx,
        return true;
 }
 
-static bool test_inq_stats(struct dcerpc_pipe *p, 
+static bool test_inq_stats(struct dcerpc_binding_handle *b,
                           TALLOC_CTX *mem_ctx)
 {
        NTSTATUS status;
@@ -89,7 +90,7 @@ static bool test_inq_stats(struct dcerpc_pipe *p,
        r.in.unknown = 0;
        r.out.statistics = &statistics;
 
-       status = dcerpc_mgmt_inq_stats(p, mem_ctx, &r);
+       status = dcerpc_mgmt_inq_stats_r(b, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
                printf("inq_stats failed - %s\n", nt_errstr(status));
                return false;
@@ -109,7 +110,7 @@ static bool test_inq_stats(struct dcerpc_pipe *p,
        return true;
 }
 
-static bool test_inq_princ_name(struct dcerpc_pipe *p, 
+static bool test_inq_princ_name(struct dcerpc_binding_handle *b,
                                TALLOC_CTX *mem_ctx)
 {
        NTSTATUS status;
@@ -121,7 +122,7 @@ static bool test_inq_princ_name(struct dcerpc_pipe *p,
                r.in.authn_proto = i;  /* DCERPC_AUTH_TYPE_* */
                r.in.princ_name_size = 100;
 
-               status = dcerpc_mgmt_inq_princ_name(p, mem_ctx, &r);
+               status = dcerpc_mgmt_inq_princ_name_r(b, mem_ctx, &r);
                if (!NT_STATUS_IS_OK(status)) {
                        continue;
                }
@@ -145,14 +146,14 @@ static bool test_inq_princ_name(struct dcerpc_pipe *p,
        return true;
 }
 
-static bool test_is_server_listening(struct dcerpc_pipe *p, 
+static bool test_is_server_listening(struct dcerpc_binding_handle *b,
                                     TALLOC_CTX *mem_ctx)
 {
        NTSTATUS status;
        struct mgmt_is_server_listening r;
        r.out.status = talloc(mem_ctx, uint32_t);
 
-       status = dcerpc_mgmt_is_server_listening(p, mem_ctx, &r);
+       status = dcerpc_mgmt_is_server_listening_r(b, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
                printf("is_server_listening failed - %s\n", nt_errstr(status));
                return false;
@@ -167,13 +168,13 @@ static bool test_is_server_listening(struct dcerpc_pipe *p,
        return true;
 }
 
-static bool test_stop_server_listening(struct dcerpc_pipe *p, 
+static bool test_stop_server_listening(struct dcerpc_binding_handle *b,
                                       TALLOC_CTX *mem_ctx)
 {
        NTSTATUS status;
        struct mgmt_stop_server_listening r;
 
-       status = dcerpc_mgmt_stop_server_listening(p, mem_ctx, &r);
+       status = dcerpc_mgmt_stop_server_listening_r(b, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
                printf("stop_server_listening failed - %s\n", nt_errstr(status));
                return false;
@@ -208,6 +209,8 @@ bool torture_rpc_mgmt(struct torture_context *torture)
        }
 
        for (l=ndr_table_list();l;l=l->next) {          
+               struct dcerpc_binding_handle *bh;
+
                loop_ctx = talloc_named(mem_ctx, 0, "torture_rpc_mgmt loop context");
                
                /* some interfaces are not mappable */
@@ -235,6 +238,7 @@ bool torture_rpc_mgmt(struct torture_context *torture)
                        talloc_free(loop_ctx);
                        continue;
                }
+               bh = p->binding_handle;
 
                if (!NT_STATUS_IS_OK(status)) {
                        talloc_free(loop_ctx);
@@ -242,23 +246,23 @@ bool torture_rpc_mgmt(struct torture_context *torture)
                        continue;
                }
 
-               if (!test_is_server_listening(p, loop_ctx)) {
+               if (!test_is_server_listening(bh, loop_ctx)) {
                        ret = false;
                }
 
-               if (!test_stop_server_listening(p, loop_ctx)) {
+               if (!test_stop_server_listening(bh, loop_ctx)) {
                        ret = false;
                }
 
-               if (!test_inq_stats(p, loop_ctx)) {
+               if (!test_inq_stats(bh, loop_ctx)) {
                        ret = false;
                }
 
-               if (!test_inq_princ_name(p, loop_ctx)) {
+               if (!test_inq_princ_name(bh, loop_ctx)) {
                        ret = false;
                }
 
-               if (!test_inq_if_ids(torture, p, loop_ctx, NULL, NULL)) {
+               if (!test_inq_if_ids(torture, bh, loop_ctx, NULL, NULL)) {
                        ret = false;
                }
 
index 9acc789ee917b58eaa09a01ffd10f60252ffb6bc..c176c3d6f15b2119527df0e9f6f9f009a548f4ee 100644 (file)
@@ -139,7 +139,7 @@ bool torture_rpc_scanner(struct torture_context *torture)
                        continue;
                }
        
-               if (!test_inq_if_ids(torture, p, torture, test_num_calls, l->table)) {
+               if (!test_inq_if_ids(torture, p->binding_handle, torture, test_num_calls, l->table)) {
                        ret = false;
                }
        }