pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34469?usp=email )
Change subject: sccp: Introduce test TC_process_rx_ludt ...................................................................... sccp: Introduce test TC_process_rx_ludt Related: SYS#6566 Change-Id: I0880ccce872e79f057e17e29e09a566645365e96 --- M library/SCCP_Templates.ttcn M sccp/SCCP_Tests_RAW.ttcn 2 files changed, 82 insertions(+), 0 deletions(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn index 74f1a20..a87ef5c 100644 --- a/library/SCCP_Templates.ttcn +++ b/library/SCCP_Templates.ttcn @@ -217,6 +217,52 @@ } } +template (value) PDU_SCCP ts_SCCP_LUDT(SCCP_PAR_Address calling, SCCP_PAR_Address called, + template (value) octetstring data, + template (value) BIT4 msg_hdl := '0000'B, + template (value) integer hop_ctr := 16) := { + longudata := { + messageType := ludt, + protClass := {'0000'B, msg_hdl}, + hopCounter := hop_ctr, + pointer1 := 0, /* overwritten */ + pointer2 := 0, /* overwritten */ + pointer3 := 0, /* overwritten */ + pointer4 := 0, /* overwritten */ + calledPAddress := ConvertASPAddressToEncodedAddress_itu(called), + callingPAddress := ConvertASPAddressToEncodedAddress_itu(calling), + longData := { + paramLength := 0, + data := data + }, + optionalPart := omit, + eop := omit + } +} + +template PDU_SCCP tr_SCCP_LUDT(template (present) SCCP_PAR_Address calling, template (present) SCCP_PAR_Address called, + template octetstring data := ?, + template BIT4 msg_hdl := '0000'B, + template integer hop_ctr := ?) := { + longudata := { + messageType := ludt, + protClass := {'0000'B, msg_hdl}, + hopCounter := hop_ctr, + pointer1 := ?, + pointer2 := ?, + pointer3 := ?, + pointer4 := ?, + calledPAddress := tr_Addr(called), + callingPAddress := tr_Addr(calling), + longData := { + paramLength := ?, + data := data + }, + optionalPart := { segmentation:= omit, importance := * } ifpresent, + eop := { paramName:= con_SCCP_eop } ifpresent + } +} + template PDU_SCCP tr_SCCP_IT(template (present) OCT3 source_lref := ?, template (present) OCT3 dest_lref := ?) := { diff --git a/sccp/SCCP_Tests_RAW.ttcn b/sccp/SCCP_Tests_RAW.ttcn index 505deb6..1c81d98 100644 --- a/sccp/SCCP_Tests_RAW.ttcn +++ b/sccp/SCCP_Tests_RAW.ttcn @@ -340,6 +340,31 @@ setverdict(pass); } +private function f_tx_ludt_exp(SCCP_PAR_Address calling, SCCP_PAR_Address called, octetstring data) runs on SCCP_Test_RAW_CT { + var template PDU_SCCP exp_rx; + f_send_sccp(ts_SCCP_LUDT(calling, called, data)); + exp_rx := tr_SCCP_LUDT(called, calling, data); + f_exp_sccp(exp_rx); +} + +/* Test if the IUT SCCP code processes a LUDT [treat it like UDT] and answers back. */ +testcase TC_process_rx_ludt() runs on SCCP_Test_RAW_CT { + var SCCP_PAR_Address calling, called; + var octetstring data := f_rnd_octstring(1000); + + f_init_raw(mp_sccp_cfg[0]); + f_sleep(1.0); + + called := valueof(ts_SccpAddr_PC_SSN(mp_sccp_cfg[0].peer_pc, mp_sccp_cfg[0].peer_ssn, + mp_sccp_cfg[0].sio, mp_sccp_cfg[0].sccp_service_type)); + calling := valueof(ts_SccpAddr_PC_SSN(mp_sccp_cfg[0].own_pc, mp_sccp_cfg[0].own_ssn, + mp_sccp_cfg[0].sio, mp_sccp_cfg[0].sccp_service_type)); + + /* Make sure an LUDT is echoed back just like an UDT */ + f_tx_ludt_exp(calling, called, data); + setverdict(pass); +} + function f_scmg_xceive(SCCP_PAR_Address calling, SCCP_PAR_Address called, template (value) PDU_SCMG_message tx, template (omit) PDU_SCMG_message rx_exp, @@ -464,6 +489,7 @@ execute( TC_tiar_timeout() ); execute( TC_it_avoids_tiar() ); execute( TC_process_rx_xudt() ); + execute( TC_process_rx_ludt() ); execute( TC_scmg_sst_ssn1() ); execute( TC_scmg_sst_ssn_valid() ); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34469?usp=email 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: I0880ccce872e79f057e17e29e09a566645365e96 Gerrit-Change-Number: 34469 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pes...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: osmith <osm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged