r4625: added a test that demonstrates that once a context_id is established,
authorAndrew Tridgell <tridge@samba.org>
Mon, 10 Jan 2005 03:48:19 +0000 (03:48 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:35 +0000 (13:08 -0500)
it can't be changed (so you have to create a new context_id, not
change the interface bound to an existing one)
(This used to be commit 5f10a8f8d04d627927d9870c87d6e7d8b98d563c)

source4/torture/rpc/alter_context.c

index 2c6f209404d44bd4515865cd19758a303876672b..600b51d15bdd9da0fff7bc7ce824c59fcf17245e 100644 (file)
@@ -32,6 +32,8 @@ BOOL torture_rpc_alter_context(void)
        TALLOC_CTX *mem_ctx;
        BOOL ret = True;
        struct policy_handle handle;
+       struct dcerpc_syntax_id syntax;
+       struct dcerpc_syntax_id transfer_syntax;
 
        mem_ctx = talloc_init("torture_rpc_alter_context");
 
@@ -69,6 +71,32 @@ BOOL torture_rpc_alter_context(void)
                ret = False;
        }
 
+       syntax = p->syntax;
+       transfer_syntax = p->transfer_syntax;
+
+       printf("Testing change of primary context\n");
+       status = dcerpc_alter_context(p, mem_ctx, &p2->syntax, &p2->transfer_syntax);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("dcerpc_alter_context failed - %s\n", nt_errstr(status));
+               return False;
+       }
+
+       printf("testing DSSETUP pipe operations - should fault\n");
+       if (test_DsRoleGetPrimaryDomainInformation(p, mem_ctx)) {
+               ret = False;
+       }
+
+       if (!test_lsa_OpenPolicy2(p, mem_ctx, &handle)) {
+               ret = False;
+       }
+
+       if (!test_lsa_Close(p, mem_ctx, &handle)) {
+               ret = False;
+       }
+
+       printf("testing DSSETUP pipe operations\n");
+       ret &= test_DsRoleGetPrimaryDomainInformation(p2, mem_ctx);
+
        talloc_destroy(mem_ctx);
 
         torture_rpc_close(p);