summaryrefslogtreecommitdiffstats
path: root/source4/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-11 07:28:53 +0100
committerGünther Deschner <gd@samba.org>2014-02-13 11:54:15 +0100
commitdf4a900aa60f5be22f3ea157bfdaf6427251299f (patch)
treecd82d8d24b244cae4d1de165829fde332f63bb67 /source4/librpc
parent06410872a14fae40b2fc94279f42e1454d54eec3 (diff)
downloadsamba-df4a900aa60f5be22f3ea157bfdaf6427251299f.tar.gz
samba-df4a900aa60f5be22f3ea157bfdaf6427251299f.tar.xz
samba-df4a900aa60f5be22f3ea157bfdaf6427251299f.zip
s4:librpc/tests: add dcerpc_binding assoc_group_id tests
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/tests/binding_string.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/librpc/tests/binding_string.c b/source4/librpc/tests/binding_string.c
index 5f072eac8e9..a790616e7df 100644
--- a/source4/librpc/tests/binding_string.c
+++ b/source4/librpc/tests/binding_string.c
@@ -123,6 +123,7 @@ static const char *test_strings[] = {
"ncalrpc:[IDENTIFIER]",
"ncacn_unix_stream:[/tmp/epmapper,sign]",
"ncacn_ip_tcp:127.0.0.1[75,target_hostname=port75.example.com,target_principal=host/port75.example.com]",
+ "ncacn_ip_tcp:127.0.0.1[75,connect,target_hostname=port75.example.com,target_principal=host/port75.example.com,assoc_group_id=0x01234567]",
};
static bool test_parse_check_results(struct torture_context *tctx)
@@ -196,6 +197,24 @@ static bool test_parse_check_results(struct torture_context *tctx)
"ncacn_ip_tcp:$HOST[,target_hostname=$HOSTNAME,target_principal=$PRINCIPAL]",
"back to string");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx,
+ "ncacn_ip_tcp:$HOST[,connect,target_hostname=$HOSTNAME,target_principal=$PRINCIPAL,assoc_group_id=0x01234567]",
+ &b), "parse");
+ flags = dcerpc_binding_get_flags(b);
+ torture_assert(tctx, flags == DCERPC_CONNECT, "connect flag");
+ torture_assert_str_equal(tctx, dcerpc_binding_get_string_option(b, "host"),
+ "$HOST", "host");
+ torture_assert_str_equal(tctx, dcerpc_binding_get_string_option(b, "target_hostname"),
+ "$HOSTNAME", "target_hostname");
+ torture_assert_str_equal(tctx, dcerpc_binding_get_string_option(b, "target_principal"),
+ "$PRINCIPAL", "target_principal");
+ torture_assert_int_equal(tctx, dcerpc_binding_get_assoc_group_id(b), 0x01234567,
+ "assoc_group_id");
+ torture_assert_str_equal(tctx,
+ dcerpc_binding_string(tctx, b),
+ "ncacn_ip_tcp:$HOST[,connect,target_hostname=$HOSTNAME,target_principal=$PRINCIPAL,assoc_group_id=0x01234567]",
+ "back to string");
+
return true;
}