arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30314 )


Change subject: WIP: ns: Add test for SNS Size procedure
......................................................................

WIP: ns: Add test for SNS Size procedure

Related: OS#5208

Change-Id: Ica8f6334afadb741180eeb5eb40d8192e61a2e67
---
M ns/NS_Tests.ttcn
1 file changed, 35 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/14/30314/1

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 722f8ec..565945c 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -558,6 +558,40 @@

 /* 48.016 SNS test cases */

+/* Send an SNS Size(-ish) PDU, i.e. an SNS Size or an SNS Size with erroneous 
payload */
+function f_outgoing_sns_size_wrong_ip_family(template (omit) PDU_NS base)
+runs on RAW_NS_CT {
+       const integer IDX := 0;
+       const integer NUM_IP := 1;
+       log("f_outgoing_sns_sizeish_pdu(idx=", IDX, ")");
+       var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[IDX];
+       var template (omit) NsCause cause := omit;
+
+       if (nsvc_cfg.provider.ip.address_family == AF_INET) {
+               base.pDU_SNS_Size.numberOfIP6_Endpoints :=
+                       {iEI := '09'O, numberOfIP_Endpoints := 
int2oct(valueof(NUM_IP), 2)};
+               cause := NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS;
+       } else {
+               base.pDU_SNS_Size.numberOfIP4_Endpoints :=
+                       {iEI := '08'O, numberOfIP_Endpoints := 
int2oct(valueof(NUM_IP), 2)};
+               cause := NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS;
+       }
+       log("expected cause: ", cause);
+       NSCP[IDX].send(base);
+       f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig.nsei, cause), IDX);
+}
+
+testcase TC_sgsn_sns_size_payload() runs on RAW_Test_CT {
+       f_init_ns_codec(mp_nsconfig);
+       /* Template that would be accepted, only missing the number of IP 
endpoints
+        * (since there are no ternary operators in TTCN-3...) */
+       template (omit) PDU_NS ts_base_SNS_SIZE_configured := 
ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 1,
+                                                                             
num_v4 := omit, num_v6 := omit);
+       f_outgoing_sns_size_wrong_ip_family(ts_base_SNS_SIZE_configured);
+       setverdict(pass);
+       f_clean_ns_codec();
+}
+
 /* do a succesful SNS configuration */
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
        f_init_vty();
@@ -1098,6 +1132,7 @@
                        execute( TC_sns_sgsn_add_change_del() );
                        execute( TC_sns_sgsn_size_correct_port() );
                        execute( TC_sns_sgsn_size_after_success() );
+                       execute( TC_sgsn_sns_size_payload() );
                }
        }
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30314
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ica8f6334afadb741180eeb5eb40d8192e61a2e67
Gerrit-Change-Number: 30314
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <[email protected]>
Gerrit-MessageType: newchange

Reply via email to