diff options
author | arehbein <arehbein@sysmocom.de> | 2022-11-21 22:47:22 +0100 |
---|---|---|
committer | arehbein <arehbein@sysmocom.de> | 2022-11-25 15:19:20 +0100 |
commit | cd2547e8620faa028ae63b746e4e52941fbe7ac3 (patch) | |
tree | 3b436eb4a264e1c1dd185e837c34fbbffb990394 | |
parent | 6ff41c4e036b3813bbcf8784e6369cd87eebe785 (diff) |
WIP: ns: Add test for SNS Size procedure
Change-Id: Icabbc9d8a3ba30930daf1fa6e2f15506489f72b0
-rw-r--r-- | ns/NS_Tests.ttcn | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn index 722f8ecc..565945ca 100644 --- a/ns/NS_Tests.ttcn +++ b/ns/NS_Tests.ttcn @@ -558,6 +558,40 @@ testcase TC_alive_retries_single_no_resp() runs on RAW_Test_CT { /* 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 @@ control { 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() ); } } } |