summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-10 03:48:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:35 -0500
commit575e981639a76f32da8f7697b671c772185058b4 (patch)
treea86f8c3513c00d9b9e5b595792a4447ab8a0a6f7 /source4/torture
parent1b1b678cc8c79dacc3b80de4f8203154d47c0345 (diff)
downloadsamba-575e981639a76f32da8f7697b671c772185058b4.tar.gz
samba-575e981639a76f32da8f7697b671c772185058b4.tar.bz2
samba-575e981639a76f32da8f7697b671c772185058b4.zip
r4625: added a test that demonstrates that once a context_id is established,
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)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/alter_context.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/torture/rpc/alter_context.c b/source4/torture/rpc/alter_context.c
index 2c6f209404..600b51d15b 100644
--- a/source4/torture/rpc/alter_context.c
+++ b/source4/torture/rpc/alter_context.c
@@ -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);