From 627a9ae22361e05e7b704725f646d9c49a607f0e Mon Sep 17 00:00:00 2001 From: Alessio Garzi Date: Fri, 21 Mar 2025 12:28:44 +0100 Subject: [PATCH] MT#62341 Add sanity new scenario This new scenario checks the integrity of : - Authorization header - From header - To header - Contact header Checks must be performed at LB level using kamailio "sanity" module. Change-Id: I870d5ec15ba584357c1b0bfc26f4aa5fcb47fa05 --- scenarios/sanity/cdr_test.yml.tt2 | 2 + scenarios/sanity/prefs.json.tt2 | 5 ++ scenarios/sanity/scenario.yml | 46 ++++++++++ scenarios/sanity/sipp_scenario00.xml | 86 +++++++++++++++++++ scenarios/sanity/sipp_scenario00_test.yml.tt2 | 25 ++++++ 5 files changed, 164 insertions(+) create mode 100644 scenarios/sanity/cdr_test.yml.tt2 create mode 100644 scenarios/sanity/prefs.json.tt2 create mode 100644 scenarios/sanity/scenario.yml create mode 100644 scenarios/sanity/sipp_scenario00.xml create mode 100644 scenarios/sanity/sipp_scenario00_test.yml.tt2 diff --git a/scenarios/sanity/cdr_test.yml.tt2 b/scenarios/sanity/cdr_test.yml.tt2 new file mode 100644 index 00000000..04e6501c --- /dev/null +++ b/scenarios/sanity/cdr_test.yml.tt2 @@ -0,0 +1,2 @@ +cdr: [] + diff --git a/scenarios/sanity/prefs.json.tt2 b/scenarios/sanity/prefs.json.tt2 new file mode 100644 index 00000000..8c9fbe25 --- /dev/null +++ b/scenarios/sanity/prefs.json.tt2 @@ -0,0 +1,5 @@ +{ + "@sanity.scenarios.test": { + "nat_sipping": "no" + } +} diff --git a/scenarios/sanity/scenario.yml b/scenarios/sanity/scenario.yml new file mode 100644 index 00000000..a2df97cd --- /dev/null +++ b/scenarios/sanity/scenario.yml @@ -0,0 +1,46 @@ +--- +test_uuid: sanity +description: Test 1 - register with broken auth header\ + Test 2 - register with broken from header + Test 3 - register with broken to header +domains: + sanity.scenarios.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: + sanity.scenarios.test: + testuser1003: + customer: 'customer.test' + password: testuser + cc: 43 + ac: 1 + sn: 1003 + testuser1002: + customer: 'customer.test' + password: testuser + cc: 43 + ac: 1 + sn: 1002 + alias_numbers: + - cc: 34 + ac: 96 + sn: 5711941 +scenarios: + - ip: 127.126.0.1 + username: testuser1002 + domain: sanity.scenarios.test + responders: + - ip: 127.3.0.5 + username: testuser1003 + domain: sanity.scenarios.test + register: no + active: no diff --git a/scenarios/sanity/sipp_scenario00.xml b/scenarios/sanity/sipp_scenario00.xml new file mode 100644 index 00000000..952421af --- /dev/null +++ b/scenarios/sanity/sipp_scenario00.xml @@ -0,0 +1,86 @@ + + + + + ;tag=[pid]SIPpTag00[call_number] + To: + Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id] + CSeq: 1 REGISTER + Contact: + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + Authorization: Digest username="594^R + + ]]> + + + + + + + Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id] + CSeq: 2 REGISTER + Contact: + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + ;tag=[pid]SIPpTag00[call_number] + To: 500 + Call-ID: NGCP%[field4 file="callee.csv" line=0]%///[call_id] + CSeq: 3 REGISTER + Contact: + 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: 4 REGISTER + Contact: hello + Expires: 600 + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + diff --git a/scenarios/sanity/sipp_scenario00_test.yml.tt2 b/scenarios/sanity/sipp_scenario00_test.yml.tt2 new file mode 100644 index 00000000..8aa81d54 --- /dev/null +++ b/scenarios/sanity/sipp_scenario00_test.yml.tt2 @@ -0,0 +1,25 @@ +messages: +- - 'SIP/2.0 400 Bad Auth Header' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ REGISTER' + - 'Server: Sipwise NGCP LB' + - 'Content-Length:\s+0' +- - 'SIP/2.0 400 Invalid From Header' + - 'From: 500' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ REGISTER' + - 'Server: Sipwise NGCP LB' + - 'Content-Length:\s+0' +- - 'SIP/2.0 400 Invalid To Header' + - 'From: ;tag=[\w-]+' + - 'To: 500;tag=[\w-]+' + - 'CSeq: \d+ REGISTER' + - 'Server: Sipwise NGCP LB' + - 'Content-Length:\s+0' +- - 'SIP/2.0 400 Bad Contact Header' + - 'From: ;tag=[\w-]+' + - 'To: ;tag=[\w-]+' + - 'CSeq: \d+ REGISTER' + - 'Server: Sipwise NGCP LB' + - 'Content-Length:\s+0'