From 4181ee86fbb9681af9c0ee7c00a54b5530d9a764 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Wed, 21 Apr 2021 12:35:07 +0200 Subject: [PATCH] TT#116100 scenarios/register_allowip * domain per scenario * dynamic IP/port and numbers Change-Id: I019bfb474a54ca15a3c46e5c5879838b91335b79 --- scenarios/register_allowip/0001_test.yml.tt2 | 4 ++-- scenarios/register_allowip/0002_test.yml.tt2 | 20 ++++++++++---------- scenarios/register_allowip/prefs.json | 7 ------- scenarios/register_allowip/prefs.json.tt2 | 7 +++++++ scenarios/register_allowip/scenario.yml | 13 +++++++------ 5 files changed, 26 insertions(+), 25 deletions(-) delete mode 100644 scenarios/register_allowip/prefs.json create mode 100644 scenarios/register_allowip/prefs.json.tt2 diff --git a/scenarios/register_allowip/0001_test.yml.tt2 b/scenarios/register_allowip/0001_test.yml.tt2 index ba47f601..df7170b0 100644 --- a/scenarios/register_allowip/0001_test.yml.tt2 +++ b/scenarios/register_allowip/0001_test.yml.tt2 @@ -3,7 +3,7 @@ flow: - start|ROUTE_ENTRY: - return|ROUTE_ENTRY: - start|ROUTE_NET_INFO: - $x_hdr(From): sip:testuser1003@ + $x_hdr(From): sip:[% scenarios.0.username %]@ - return|ROUTE_NET_INFO: - start|ROUTE_CHECK_TEL_URI: - return|ROUTE_CHECK_TEL_URI: @@ -16,7 +16,7 @@ flow: - exit|ROUTE_EXIT: sip_in: - '^REGISTER' - - 'Contact: sip:testuser1003@' + - 'Contact: sip:[% scenarios.0.username %]@' - 'Content-Length: 0' - 'Expires: 600' sip_out: diff --git a/scenarios/register_allowip/0002_test.yml.tt2 b/scenarios/register_allowip/0002_test.yml.tt2 index 640e36c3..6f6b54c5 100644 --- a/scenarios/register_allowip/0002_test.yml.tt2 +++ b/scenarios/register_allowip/0002_test.yml.tt2 @@ -3,7 +3,7 @@ flow: - start|ROUTE_ENTRY: - return|ROUTE_ENTRY: - start|ROUTE_NET_INFO: - $x_hdr(From): sip:testuser1003@ + $x_hdr(From): sip:[% scenarios.0.username %]@ - return|ROUTE_NET_INFO: - start|ROUTE_CHECK_TEL_URI: - return|ROUTE_CHECK_TEL_URI: @@ -29,27 +29,27 @@ flow: $xavp(caller_dom_prefs[0]=>dummy[*]): - caller $xavp(caller_peer_prefs): None - $xavp(caller_real_prefs[0]=>ac[*]): [1] + $xavp(caller_real_prefs[0]=>ac[*]): [[% register_allowip_scenarios_test.testuser1003.ac %]] $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]=>cc[*]): [[% register_allowip_scenarios_test.testuser1003.cc %]] + $xavp(caller_real_prefs[0]=>cli[*]): [[% register_allowip_scenarios_test.testuser1003.phone_number %]] $xavp(caller_real_prefs[0]=>dummy[*]): - caller $xavp(caller_real_prefs[0]=>man_allowed_ips_grp[*]): [0] - $xavp(caller_usr_prefs[0]=>ac[*]): [1] + $xavp(caller_usr_prefs[0]=>ac[*]): [[% register_allowip_scenarios_test.testuser1003.ac %]] $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]=>cc[*]): [[% register_allowip_scenarios_test.testuser1003.cc %]] + $xavp(caller_usr_prefs[0]=>cli[*]): [[% register_allowip_scenarios_test.testuser1003.phone_number %]] $xavp(caller_usr_prefs[0]=>dummy[*]): - caller sip_in: - '^REGISTER' - - 'Contact: sip:testuser1003@' + - 'Contact: sip:[% scenarios.0.username %]@' - 'Content-Length: 0' - 'Expires: 600' - - 'Authorization: Digest username="testuser1003"' + - 'Authorization: Digest username="[% scenarios.0.username %]"' sip_out: - [ '^SIP/2.0 100 Trying', @@ -58,6 +58,6 @@ sip_out: - [ '^SIP/2.0 403 Unauthorized IP detected', 'Content-Length: 0', - 'P-NGCP-Authorization: testuser1003@', + 'P-NGCP-Authorization: [% scenarios.0.username %]@', 'P-NGCP-Authorized: 1' ] diff --git a/scenarios/register_allowip/prefs.json b/scenarios/register_allowip/prefs.json deleted file mode 100644 index faf5342a..00000000 --- a/scenarios/register_allowip/prefs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "testuser1003@spce.test": { - "allowed_ips": [ - "1.2.3.4" - ] - } -} diff --git a/scenarios/register_allowip/prefs.json.tt2 b/scenarios/register_allowip/prefs.json.tt2 new file mode 100644 index 00000000..b8aabb92 --- /dev/null +++ b/scenarios/register_allowip/prefs.json.tt2 @@ -0,0 +1,7 @@ +{ + "[% scenarios.0.username %]@register-allowip.scenarios.test": { + "allowed_ips": [ + "1.2.3.4" + ] + } +} diff --git a/scenarios/register_allowip/scenario.yml b/scenarios/register_allowip/scenario.yml index 81ae9f8b..c8e0ea5a 100644 --- a/scenarios/register_allowip/scenario.yml +++ b/scenarios/register_allowip/scenario.yml @@ -1,6 +1,7 @@ +--- test_uuid: register_allowip domains: - 'spce.test': + register-allowip.scenarios.test: reseller_id: 1 customers: 'customer.test': @@ -13,7 +14,7 @@ customers: billing_profile_id: 1 reseller_id: 1 subscribers: - spce.test: + register-allowip.scenarios.test: testuser1003: customer: 'customer.test' password: testuser @@ -22,11 +23,11 @@ subscribers: sn: 1003 scenarios: - ip: 127.126.0.1 - domain: spce.test + domain: register-allowip.scenarios.test username: testuser1003 responders: - ip: 127.1.0.1 - domain: spce.test - register: no + domain: register-allowip.scenarios.test + register: 'no' username: testuser1003 - active: no + active: 'no'