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


Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
......................................................................

WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

Related: OS#5208
Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
---
M ns/NS_Tests.ttcn
1 file changed, 32 insertions(+), 0 deletions(-)



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

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 3ebdbf3..64ab5dc 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -609,6 +609,37 @@
        f_clean_ns_codec();
 }

+testcase TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() runs on RAW_Test_CT {
+       f_init_vty();
+       f_init_ns_codec(mp_nsconfig);
+       const integer IDX := 0;
+       const integer NUM_IP := 1;
+       log("f_outgoing_sns_size_invalid_num_of_ip_eps(idx=", IDX, ")");
+       var NsCause cause;
+       /* Assumption: No connections to other NSEs for SUT and testcomponent */
+       const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+       const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+       const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints;
+       /* Template that would be accepted, only missing the number of IP 
endpoints
+        * (since there are no ternary operators in TTCN-3...) */
+       var template (omit) PDU_NS ts_base_SNS_SIZE_configured :=
+               ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 
num_of_nsvcs,
+                           num_v4 := omit, num_v6 := omit);
+       /* Send IP4 endpoints when IP6 is configured and vice versa, in effect 
sending an unsupported type of NS-VC endpoints. */
+       if (g_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) {
+               ts_base_SNS_SIZE_configured.pDU_SNS_Size.numberOfIP6_Endpoints 
:=
+                       {iEI := int2oct(enum2int(ns_iei_num_ipv6_ep), 1), 
numberOfIP_Endpoints := int2oct(NUM_IP, 2)};
+               cause := NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS;
+       } else {
+               ts_base_SNS_SIZE_configured.pDU_SNS_Size.numberOfIP4_Endpoints 
:=
+                       {iEI := int2oct(enum2int(ns_iei_num_ipv4_ep), 1), 
numberOfIP_Endpoints := int2oct(NUM_IP, 2)};
+               cause := NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS;
+       }
+       f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause);
+       setverdict(pass);
+       f_clean_ns_codec();
+}
+
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
        f_init_vty();
        f_init_ns_codec(mp_nsconfig);
@@ -1149,6 +1180,7 @@
                        execute( TC_sns_sgsn_size_correct_port() );
                        execute( TC_sns_sgsn_size_after_success() );
                        execute( 
TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() );
+                       execute( TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() );
                }
        }
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
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: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <[email protected]>
Gerrit-MessageType: newchange

Reply via email to