diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-08-28 17:45:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:03:03 -0500 |
commit | 53d10b44faa77293e380bd1cda6168acc05a5493 (patch) | |
tree | 58dc8d8a13c11494a1a237b4f6f9702240cd75ed /source4/librpc/tests | |
parent | 18302e7030e568d23f13717cb006193490e4213d (diff) | |
download | samba-53d10b44faa77293e380bd1cda6168acc05a5493.tar.gz samba-53d10b44faa77293e380bd1cda6168acc05a5493.tar.bz2 samba-53d10b44faa77293e380bd1cda6168acc05a5493.zip |
r24753: Allow host name in binding string without transport.
(This used to be commit f7051d3a84486ed9d0a1689c10a693521ec63528)
Diffstat (limited to 'source4/librpc/tests')
-rw-r--r-- | source4/librpc/tests/binding_string.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/librpc/tests/binding_string.c b/source4/librpc/tests/binding_string.c index c4ffe19e6b..18cf4dfb46 100644 --- a/source4/librpc/tests/binding_string.c +++ b/source4/librpc/tests/binding_string.c @@ -95,6 +95,27 @@ static const char *test_strings[] = { "ncacn_unix_stream:[/tmp/epmapper,sign]", }; +static bool test_no_transport(struct torture_context *tctx) +{ + const char *binding = "somehost"; + struct dcerpc_binding *b; + const char *s; + + /* Parse */ + torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, binding, &b), + "Error parsing binding string"); + + torture_assert(tctx, b->transport == NCA_UNKNOWN, "invalid transport"); + + s = dcerpc_binding_string(tctx, b); + torture_assert(tctx, s != NULL, "Error converting binding back to string"); + + torture_assert_casestr_equal(tctx, binding, s, + "Mismatch while comparing original and regenerated binding strings"); + + return true; +} + struct torture_suite *torture_local_binding_string(TALLOC_CTX *mem_ctx) { int i; @@ -106,5 +127,7 @@ struct torture_suite *torture_local_binding_string(TALLOC_CTX *mem_ctx) test_BindingString, test_strings[i]); } + torture_suite_add_simple_test(suite, "no transport", test_no_transport); + return suite; } |