Commit f54f5f0f authored by Pekka Pessi's avatar Pekka Pessi

nta: added test for sf.net bug #1292657

Ignore-this: 7a4491a9f4a5b77d7eb777238b87718a

darcs-hash:20090707184651-db55f-5e57295ac15a970a432458d7d03e70b81cd530df.gz
parent d00d3865
......@@ -69,6 +69,7 @@ port=$(./portbind $v6flag) sink=$port
port=$(./portbind $v6flag $((port + 1))) down=$port
port=$(./portbind $v6flag $((port + 1))) bind=$port
port=$(./portbind $v6flag $((port + 1))) contact=$port
port=$(./portbind $v6flag $((port + 1))) sips=$port
# Disable IPv6 resolver for now
if false && eval $ipv6 ; then
......@@ -125,11 +126,11 @@ ns AAAA $me6
A 127.0.0.1
_sip._udp SRV 1 100 $contact me
_sips._tcp SRV 3 100 $contact me
_sips._tcp SRV 3 100 $sips me
_sip._tcp SRV 2 100 $contact me
_sip._udp.srv SRV 1 100 $contact a
_sips._tcp.srv SRV 3 100 $contact a
_sips._tcp.srv SRV 3 100 $sips a
_sip._tcp.srv SRV 2 100 $contact $aaaa
_sip._udp.srv2 SRV 1 200 $contact c
......@@ -155,9 +156,14 @@ na503 NAPTR 20 15 "S" "SIP+D2F" "" a2
nona NAPTR 20 15 "S" "ZIP+D2U" "" a2
_sip._udp.nona SRV 1 10 $contact ip4
; No SIP SRV match
; First SIP SRV is not found
nosrv NAPTR 20 1 "s" "SIP+D2U" "" _sip._udp.nosrv
NAPTR 20 2 "s" "SIP+D2U" "" _sip._udp.srv
NAPTR 20 2 "s" "SIP+D2T" "" _sip._tcp.nosrv
NAPTR 20 3 "s" "SIP+D2U" "" _sip._udp.srv
NAPTR 20 4 "s" "SIP+D2T" "" _sip._tcp.srv
; Redirect with TLS
; This fails (and we get 503)
a2 A 127.0.0.2
......@@ -198,6 +204,8 @@ if test -r $pidfile ; then
sink=$sink down=$down \
ipv6=$ipv6 \
SIPCONTACT="sip:*:$contact;comp=sigcomp" \
SIPSCONTACT="sips:*:$sips;comp=sigcomp" \
TEST_NTA_CERTDIR=$srcdir/../tport/ \
$VALGRIND ./test_nta "$@" - $resolvfile
exit=$?
kill $(cat $pidfile)
......
......@@ -95,7 +95,7 @@ int tstflags = 0;
#define NONE ((void *)-1)
int expensive_checks;
int expensive_checks, test_nta_sips;
#define EXPENSIVE_CHECKS (expensive_checks)
......@@ -635,6 +635,15 @@ int test_init(agent_t *ag, char const *resolv_conf)
TAG_END());
TEST_1(ag->ag_agent);
contact = getenv("SIPSCONTACT");
if (contact) {
if (nta_agent_add_tport(ag->ag_agent, URL_STRING_MAKE(contact),
TPTAG_CERTIFICATE(getenv("TEST_NTA_CERTDIR")),
TPTAG_TLS_VERIFY_POLICY(TPTLS_VERIFY_NONE),
TAG_END()) == 0)
test_nta_sips = 1;
}
{
/* Initialize our headers */
sip_from_t from[1];
......@@ -2123,6 +2132,27 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
url->url_params = NULL;
}
if (test_nta_sips) {
/* Test 1.8 - Send a message to sips:example.org
*
* Tests sf.net bug #1292657 (SIPS resolving with NAPTR).
*/
client_t ctx[1] = {{ ag, "Test 1.8" }};
ag->ag_expect_leg = ag->ag_default_leg;
ctx->c_orq =
nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ctx,
ag->ag_obp,
SIP_METHOD_MESSAGE,
(url_string_t *)"sips:example.org",
SIPTAG_SUBJECT_STR(ctx->c_name),
SIPTAG_FROM(ag->ag_alice),
SIPTAG_TO(ag->ag_bob),
SIPTAG_CONTACT(ag->ag_m_alice),
TAG_END());
TEST_1(!client_run(ctx, 200));
TEST_P(ag->ag_latest_leg, ag->ag_default_leg);
}
nta_agent_set_params(ag->ag_agent,
NTATAG_SIP_T1(500),
NTATAG_SIP_T1X64(64 * 500),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment