From 7a46e049cba32ed410167a69879c5545fde4784a Mon Sep 17 00:00:00 2001 From: Andrew Pogrebennyk Date: Wed, 3 Jul 2013 16:27:16 +0200 Subject: [PATCH] Fix flows; add new register test. --- run_tests.sh | 2 +- scenarios/register/0001_test.yml | 2 + scenarios/register/0002_test.yml | 5 ++ .../register_ignore_allowip/0001_test.yml | 29 ++++++++++ .../register_ignore_allowip/0002_test.yml | 35 ++++++++++++ scenarios/register_ignore_allowip/prefs.yml | 3 + .../register_ignore_allowip/sipp_scenario.xml | 55 +++++++++++++++++++ 7 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 scenarios/register_ignore_allowip/0001_test.yml create mode 100644 scenarios/register_ignore_allowip/0002_test.yml create mode 100644 scenarios/register_ignore_allowip/prefs.yml create mode 100644 scenarios/register_ignore_allowip/sipp_scenario.xml diff --git a/run_tests.sh b/run_tests.sh index f596b7cb..47aa7c8b 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -19,7 +19,7 @@ for i in ${LOG_DIR} ${RESULT_DIR}; do rm -rf $i done -for t in $(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d ); do +for t in $(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d | sort); do echo "Run: $(basename $t)" if [ -z $TEST ]; then bash ${BASE_DIR}/scenarios/check.sh $(basename $t) diff --git a/scenarios/register/0001_test.yml b/scenarios/register/0001_test.yml index f6bb0ce7..002055f6 100644 --- a/scenarios/register/0001_test.yml +++ b/scenarios/register/0001_test.yml @@ -7,6 +7,8 @@ flow: $fU: testuser1003 $tU: testuser1003 - end|ROUTE_NET_INFO: + - start|ROUTE_REG_REQUEST: + - start|ROUTE_REG_HANDLE: - start|ROUTE_AUTH: - exit|ROUTE_AUTH: sip_in: diff --git a/scenarios/register/0002_test.yml b/scenarios/register/0002_test.yml index bf05010c..b73d4c6f 100644 --- a/scenarios/register/0002_test.yml +++ b/scenarios/register/0002_test.yml @@ -7,10 +7,15 @@ flow: $fU: testuser1003 $tU: testuser1003 - end|ROUTE_NET_INFO: + - start|ROUTE_REG_REQUEST: + - start|ROUTE_REG_HANDLE: - start|ROUTE_AUTH: - start|ROUTE_ADD_CALLINFO_REPLY: - return|ROUTE_ADD_CALLINFO_REPLY: - end|ROUTE_AUTH: + - start|ROUTE_PREFERENCES: + - end|ROUTE_PREFERENCES: + - exit|ROUTE_REG_HANDLE: sip_in: - '^REGISTER' - 'Contact: sip:testuser1003@' diff --git a/scenarios/register_ignore_allowip/0001_test.yml b/scenarios/register_ignore_allowip/0001_test.yml new file mode 100644 index 00000000..adee3c78 --- /dev/null +++ b/scenarios/register_ignore_allowip/0001_test.yml @@ -0,0 +1,29 @@ +# REGISTER scenario +flow: + - start|MAIN: + $fU: testuser1003 + $tU: testuser1003 + - start|ROUTE_NET_INFO: + $fU: testuser1003 + $tU: testuser1003 + - end|ROUTE_NET_INFO: + $fU: testuser1003 + $tU: testuser1003 + - start|ROUTE_REG_REQUEST: + - start|ROUTE_REG_HANDLE: + - start|ROUTE_AUTH: + - exit|ROUTE_AUTH: +sip_in: + - '^REGISTER' + - 'Contact: sip:testuser1003@' + - 'Content-Length: 0' + - 'Expires: 600' +sip_out: + - [ + '^SIP/2.0 100 Trying', + 'Content-Length: 0' + ] + - [ + '^SIP/2.0 401 Unauthorized', + 'Content-Length: 0' + ] diff --git a/scenarios/register_ignore_allowip/0002_test.yml b/scenarios/register_ignore_allowip/0002_test.yml new file mode 100644 index 00000000..b73d4c6f --- /dev/null +++ b/scenarios/register_ignore_allowip/0002_test.yml @@ -0,0 +1,35 @@ +# REGISTER scenario +flow: + - start|MAIN: + $fU: testuser1003 + $tU: testuser1003 + - start|ROUTE_NET_INFO: + $fU: testuser1003 + $tU: testuser1003 + - end|ROUTE_NET_INFO: + - start|ROUTE_REG_REQUEST: + - start|ROUTE_REG_HANDLE: + - start|ROUTE_AUTH: + - start|ROUTE_ADD_CALLINFO_REPLY: + - return|ROUTE_ADD_CALLINFO_REPLY: + - end|ROUTE_AUTH: + - start|ROUTE_PREFERENCES: + - end|ROUTE_PREFERENCES: + - exit|ROUTE_REG_HANDLE: +sip_in: + - '^REGISTER' + - 'Contact: sip:testuser1003@' + - 'Content-Length: 0' + - 'Expires: 600' + - 'Authorization: Digest username="testuser1003"' +sip_out: + - [ + '^SIP/2.0 100 Trying', + 'Content-Length: 0' + ] + - [ + '^SIP/2.0 200 OK', + 'Content-Length: 0', + 'P-NGCP-Authorization: testuser1003@', + 'P-NGCP-Authorized: 1' + ] diff --git a/scenarios/register_ignore_allowip/prefs.yml b/scenarios/register_ignore_allowip/prefs.yml new file mode 100644 index 00000000..bc64cd7c --- /dev/null +++ b/scenarios/register_ignore_allowip/prefs.yml @@ -0,0 +1,3 @@ +testuser1003@127.0.0.1: + allowed_ips: [ "1.2.3.4" ] + ignore_allowed_ips: 1 diff --git a/scenarios/register_ignore_allowip/sipp_scenario.xml b/scenarios/register_ignore_allowip/sipp_scenario.xml new file mode 100644 index 00000000..0cca5227 --- /dev/null +++ b/scenarios/register_ignore_allowip/sipp_scenario.xml @@ -0,0 +1,55 @@ + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: [call_id] + CSeq: 1 REGISTER + Contact: sip:[field0 file="callee.csv"]@[local_ip]:50603 + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: [call_id] + CSeq: 2 REGISTER + [field2 file="callee.csv"] + Contact: sip:[field0 file="callee.csv"]@[local_ip]:50603 + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + + +