From 63d601b777076e2eb66ba418478c3d7dd5594935 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 31 May 2016 10:12:19 +0200 Subject: [PATCH] MT#20139 scenarios_lnp: add register_lock_ported register is forbidden if subscriber has lock ported Change-Id: Icc5d7d6a0f703cfb3f9caff2309b3425c79fbbf8 --- .../register_lock_ported/0001_test.yml.tt2 | 26 +++++++++ .../register_lock_ported/0002_test.yml.tt2 | 57 +++++++++++++++++++ scenarios_lnp/register_lock_ported/prefs.json | 8 +++ .../register_lock_ported/scenario.yml | 32 +++++++++++ .../register_lock_ported/sipp_scenario00.xml | 55 ++++++++++++++++++ 5 files changed, 178 insertions(+) create mode 100644 scenarios_lnp/register_lock_ported/0001_test.yml.tt2 create mode 100644 scenarios_lnp/register_lock_ported/0002_test.yml.tt2 create mode 100644 scenarios_lnp/register_lock_ported/prefs.json create mode 100644 scenarios_lnp/register_lock_ported/scenario.yml create mode 100644 scenarios_lnp/register_lock_ported/sipp_scenario00.xml diff --git a/scenarios_lnp/register_lock_ported/0001_test.yml.tt2 b/scenarios_lnp/register_lock_ported/0001_test.yml.tt2 new file mode 100644 index 00000000..9b4e5e7e --- /dev/null +++ b/scenarios_lnp/register_lock_ported/0001_test.yml.tt2 @@ -0,0 +1,26 @@ +flow: + - start|DEFAULT_ROUTE: + $fU: testuser1003 + $tU: testuser1003 + - start|ROUTE_NET_INFO: + $fU: testuser1003 + $tU: testuser1003 + - return|ROUTE_NET_INFO: + - 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_lnp/register_lock_ported/0002_test.yml.tt2 b/scenarios_lnp/register_lock_ported/0002_test.yml.tt2 new file mode 100644 index 00000000..3a3afe60 --- /dev/null +++ b/scenarios_lnp/register_lock_ported/0002_test.yml.tt2 @@ -0,0 +1,57 @@ +flow: + - start|DEFAULT_ROUTE: + $fU: testuser1003 + $tU: testuser1003 + - start|ROUTE_NET_INFO: + $fU: testuser1003 + $tU: testuser1003 + - return|ROUTE_NET_INFO: + - start|ROUTE_REG_REQUEST: + - start|ROUTE_REG_HANDLE: + - start|ROUTE_AUTH: + - start|ROUTE_AUTH_HELPER: + - return|ROUTE_AUTH_HELPER: + - start|ROUTE_ADD_CALLINFO_REPLY: + - return|ROUTE_ADD_CALLINFO_REPLY: + - return|ROUTE_AUTH: + - start|ROUTE_PREFERENCES: + - exit|ROUTE_PREFERENCES: + $xavp(callee_dom_prefs): None + $xavp(callee_peer_prefs): None + $xavp(callee_real_prefs): None + $xavp(callee_usr_prefs): None + $xavp(caller_dom_prefs[0]=>dummy[*]): + - caller + $xavp(caller_peer_prefs): None + $xavp(caller_real_prefs[0]=>ac[*]): [1] + $xavp(caller_real_prefs[0]=>account_id): '\d+' + $xavp(caller_real_prefs[0]=>allowed_ips_grp): '\d+' + $xavp(caller_real_prefs[0]=>cc[*]): [43] + $xavp(caller_real_prefs[0]=>cli[*]): [4311003] + $xavp(caller_real_prefs[0]=>dummy[*]): + - caller + $xavp(caller_real_prefs[0]=>lock[*]): [5] + $xavp(caller_usr_prefs[0]=>ac[*]): [1] + $xavp(caller_usr_prefs[0]=>account_id): '\d+' + $xavp(caller_usr_prefs[0]=>allowed_ips_grp): '\d+' + $xavp(caller_usr_prefs[0]=>cc[*]): [43] + $xavp(caller_usr_prefs[0]=>cli[*]): [4311003] + $xavp(caller_usr_prefs[0]=>dummy[*]): + - caller +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 403 Unauthorized, lock level ported detected', + 'Content-Length: 0', + 'P-NGCP-Authorization: testuser1003@', + 'P-NGCP-Authorized: 1' + ] diff --git a/scenarios_lnp/register_lock_ported/prefs.json b/scenarios_lnp/register_lock_ported/prefs.json new file mode 100644 index 00000000..556fddc0 --- /dev/null +++ b/scenarios_lnp/register_lock_ported/prefs.json @@ -0,0 +1,8 @@ +{ + "testuser1003@spce.test": { + "allowed_ips": [ + "127.126.0.1" + ], + "lock": 5 + } +} diff --git a/scenarios_lnp/register_lock_ported/scenario.yml b/scenarios_lnp/register_lock_ported/scenario.yml new file mode 100644 index 00000000..6cf270a0 --- /dev/null +++ b/scenarios_lnp/register_lock_ported/scenario.yml @@ -0,0 +1,32 @@ +test_uuid: register_lock_ported +domains: + 'spce.test': + reseller_id: 1 +customers: + 'customer.test': + contacts: + - email: "customer.test@spce.test" + reseller_id: 1 + details: + status: 'active' + type: 'sipaccount' + billing_profile_id: 1 + reseller_id: 1 +subscribers: + spce.test: + testuser1003: + customer: 'customer.test' + password: testuser + cc: 43 + ac: 1 + sn: 1003 +scenarios: + - ip: 127.126.0.1 + domain: spce.test + username: testuser1003 + responders: + - ip: 127.1.0.1 + domain: spce.test + register: no + username: testuser1003 + active: no diff --git a/scenarios_lnp/register_lock_ported/sipp_scenario00.xml b/scenarios_lnp/register_lock_ported/sipp_scenario00.xml new file mode 100644 index 00000000..45997674 --- /dev/null +++ b/scenarios_lnp/register_lock_ported/sipp_scenario00.xml @@ -0,0 +1,55 @@ + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id] + CSeq: 1 REGISTER + Contact: sip:[field0 file="callee.csv" line=0]@[local_ip]:[local_port] + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id] + CSeq: 2 REGISTER + [field2 file="callee.csv" line=0] + Contact: sip:[field0 file="callee.csv" line=0]@[local_ip]:[local_port] + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + + +