Tue Jul 7 13:46:51 CDT 2009 Pekka Pessi <first.last@nokia.com>

* nta: added test for sf.net bug #1292657


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14181 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-07-10 00:43:25 +00:00
parent 1eb6218be2
commit aae0726b64
3 changed files with 44 additions and 6 deletions

View File

@ -1 +1 @@
Thu Jul 9 19:40:57 CDT 2009
Thu Jul 9 19:41:40 CDT 2009

View File

@ -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)

View File

@ -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),