summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-01 19:16:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:22 -0500
commit26ed05364d3172f17a0d4e1159e39a830f8a7217 (patch)
tree7b68da0f76bea0f09ba1b6618d9595d1817832ca
parent477ecbd4987663b0c121d77fb72bce4f318ee7bb (diff)
downloadsamba-26ed05364d3172f17a0d4e1159e39a830f8a7217.tar.gz
samba-26ed05364d3172f17a0d4e1159e39a830f8a7217.tar.xz
samba-26ed05364d3172f17a0d4e1159e39a830f8a7217.zip
r24866: Put remainder of binding string tests in librpc/ directory.
(This used to be commit 5b78d845a4d107e6a0e77a6e57e2b0e22fc0db95)
-rw-r--r--source4/librpc/tests/binding_string.c37
-rwxr-xr-xsource4/selftest/test_binding_string.sh18
-rwxr-xr-xsource4/selftest/test_ldap.sh6
-rwxr-xr-xsource4/selftest/tests_all.sh1
4 files changed, 39 insertions, 23 deletions
diff --git a/source4/librpc/tests/binding_string.c b/source4/librpc/tests/binding_string.c
index 18cf4dfb46..362848049b 100644
--- a/source4/librpc/tests/binding_string.c
+++ b/source4/librpc/tests/binding_string.c
@@ -95,6 +95,41 @@ static const char *test_strings[] = {
"ncacn_unix_stream:[/tmp/epmapper,sign]",
};
+static bool test_parse_check_results(struct torture_context *tctx)
+{
+ struct dcerpc_binding *b;
+ struct GUID uuid;
+
+ torture_assert_ntstatus_ok(tctx,
+ GUID_from_string("308FB580-1EB2-11CA-923B-08002B1075A7", &uuid),
+ "parsing uuid");
+
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_np:$SERVER", &b), "parse");
+ torture_assert(tctx, b->transport == NCACN_NP, "ncacn_np expected");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_ip_tcp:$SERVER", &b), "parse");
+ torture_assert(tctx, b->transport == NCACN_IP_TCP, "ncacn_ip_tcp expected");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_np:$SERVER[rpcecho]", &b), "parse");
+ torture_assert_str_equal(tctx, b->endpoint, "rpcecho", "endpoint");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_np:$SERVER[/pipe/rpcecho]", &b), "parse");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_np:$SERVER[/pipe/rpcecho,sign,seal]", &b), "parse");
+ torture_assert(tctx, b->flags == DCERPC_SIGN+DCERPC_SEAL, "sign+seal flags");
+ torture_assert_str_equal(tctx, b->endpoint, "/pipe/rpcecho", "endpoint");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_np:$SERVER[,sign]", &b), "parse");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncacn_ip_tcp:$SERVER[,sign]", &b), "parse");
+ torture_assert(tctx, b->endpoint == NULL, "endpoint");
+ torture_assert(tctx, b->flags == DCERPC_SIGN, "sign flag");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx, "ncalrpc:", &b), "parse");
+ torture_assert(tctx, b->transport == NCALRPC, "ncalrpc expected");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx,
+ "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_np:$SERVER", &b), "parse");
+ torture_assert(tctx, GUID_equal(&b->object.uuid, &uuid), "object uuid");
+ torture_assert_int_equal(tctx, b->object.if_version, 0, "object version");
+ torture_assert_ntstatus_ok(tctx, dcerpc_parse_binding(tctx,
+ "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$SERVER", &b), "parse");
+
+ return true;
+}
+
static bool test_no_transport(struct torture_context *tctx)
{
const char *binding = "somehost";
@@ -129,5 +164,7 @@ struct torture_suite *torture_local_binding_string(TALLOC_CTX *mem_ctx)
torture_suite_add_simple_test(suite, "no transport", test_no_transport);
+ torture_suite_add_simple_test(suite, "parsing results", test_parse_check_results);
+
return suite;
}
diff --git a/source4/selftest/test_binding_string.sh b/source4/selftest/test_binding_string.sh
deleted file mode 100755
index 79ec482ba6..0000000000
--- a/source4/selftest/test_binding_string.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-incdir=`dirname $0`
-. $incdir/test_functions.sh
-
-for I in "ncacn_np:\$SERVER" \
- "ncacn_ip_tcp:\$SERVER" \
- "ncacn_np:\$SERVER[rpcecho]" \
- "ncacn_np:\$SERVER[/pipe/rpcecho]" \
- "ncacn_np:\$SERVER[/pipe/rpcecho,sign,seal]" \
- "ncacn_np:\$SERVER[,sign]" \
- "ncacn_ip_tcp:\$SERVER[,sign]" \
- "ncalrpc:" \
- "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_np:\$SERVER" \
- "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:\$SERVER"
-do
- plantest "$I" dc $samba4bindir/smbtorture $TORTURE_OPTIONS "$I" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" --option=torture:quick=yes RPC-ECHO "$*"
-done
diff --git a/source4/selftest/test_ldap.sh b/source4/selftest/test_ldap.sh
index 3eba604358..85c3f95915 100755
--- a/source4/selftest/test_ldap.sh
+++ b/source4/selftest/test_ldap.sh
@@ -4,15 +4,13 @@
incdir=`dirname $0`
. $incdir/test_functions.sh
-p=ldap
for options in "" "--option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD --option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD"; do
- plantest "TESTING PROTOCOL $p with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh $p \$SERVER_IP $options
+ plantest "TESTING PROTOCOL ldap with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh ldap \$SERVER_IP $options
done
# see if we support ldaps
if grep ENABLE_GNUTLS.1 include/config.h > /dev/null; then
- p=ldaps
for options in "" "-U\$USERNAME%\$PASSWORD"; do
- plantest "TESTING PROTOCOL $p with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh $p \$SERVER_IP $options
+ plantest "TESTING PROTOCOL ldaps with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh ldaps \$SERVER_IP $options
done
fi
for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA LDAP-UPTODATEVECTOR
diff --git a/source4/selftest/tests_all.sh b/source4/selftest/tests_all.sh
index 868d4cfe3e..b2fa0b1430 100755
--- a/source4/selftest/tests_all.sh
+++ b/source4/selftest/tests_all.sh
@@ -5,7 +5,6 @@ $SRCDIR/selftest/test_nbt.sh "dc"
$SRCDIR/selftest/test_rpc.sh
$SRCDIR/selftest/test_net.sh
$SRCDIR/selftest/test_session_key.sh
-$SRCDIR/selftest/test_binding_string.sh
$SRCDIR/selftest/test_echo.sh
$SRCDIR/selftest/test_posix.sh
$SRCDIR/selftest/test_cifs.sh