[L] Change in osmo-ttcn3-hacks[master]: mme: Introduce tests TC_incoming_update_bearer_*
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44198?usp=email ) Change subject: mme: Introduce tests TC_incoming_update_bearer_* ...................................................................... mme: Introduce tests TC_incoming_update_bearer_* The compilation flag --legacy-template-subrefs is now needed in order to have proper matching in tr_S1AP_RABModifyReq(). Related: SYS#8357 Change-Id: Ib0c0996ed1cbf9b2182e3b232b733af5b9c441ce --- M library/GTPv2_Templates.ttcn M library/NAS_EPS_Templates.ttcn M mme/ConnHdlr.ttcn M mme/MME_Tests.ttcn M mme/expected-results.xml M mme/regen_makefile.sh 6 files changed, 360 insertions(+), 20 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTPv2_Templates.ttcn b/library/GTPv2_Templates.ttcn index 1664f9a..1d19efc 100644 --- a/library/GTPv2_Templates.ttcn +++ b/library/GTPv2_Templates.ttcn @@ -177,6 +177,7 @@ /* ... */ Context_Not_Found (64), System_Failure (72), + No_resources_available (73), APN_access_denied__no_subscription (93) } with { variant "FIELDLENGTH(8)" encode "RAW" }; @@ -462,6 +463,88 @@ additionalOctets := * } +/* 8.18 */ +template (value) ServingNetwork +ts_GTP2C_ServingNetwork(template (value) hexstring mcc, + template (value) hexstring mnc, + template (value) BIT4 instance := '0000'B) := +{ + elementIdentifier := '53'O, + lengthIndicator := 0, /* overwritten */ + instance := instance, + spare := '0000'B, + mccDigit1 := mcc[0], + mccDigit2 := mcc[1], + mccDigit3 := mcc[2], + mncDigit3 := mnc[2], /* 'F'H for 2 digit MNC */ + mncDigit1 := mnc[0], + mncDigit2 := mnc[1], + additionalOctets := omit +} + +/* 8.19 24.008 */ +template (value) TrafficFlowTemplateV_CreateAddReplaceTFT +ts_GTP2C_TrafficFlowTemplateV_CreateAddReplaceTFT( + template (value) integer numberOfPacketFilters, + template (value) BIT1 eBIT, + template (value) BIT3 operationCodeTFT, + template (value) PacketFilterList_CreateAddReplaceTFT packetFilterList_CreateAddReplaceTFT, + template (omit) ParametersList parametersList := omit) := +{ + numberOfPacketFilters := numberOfPacketFilters, + eBIT := eBIT, + operationCodeTFT := operationCodeTFT, + packetFilterList_CreateAddReplaceTFT := packetFilterList_CreateAddReplaceTFT, + parametersList := parametersList +} + +template (value) TrafficFlowTemplateV +ts_GTP2C_TrafficFlowTemplateV_U_CreateAddReplaceTFT( + template (value) integer numberOfPacketFilters, + template (value) BIT1 eBIT := '0'B, + template (value) BIT3 operationCodeTFT := '011'B, /* Add packet filters to existing TFT */ + template (value) PacketFilterList_CreateAddReplaceTFT packetFilterList_CreateAddReplaceTFT, + template (omit) ParametersList parametersList := omit) := +{ + trafficFlowTemplateV_CreateAddReplaceTFT := + ts_GTP2C_TrafficFlowTemplateV_CreateAddReplaceTFT(numberOfPacketFilters, + eBIT, + operationCodeTFT, + packetFilterList_CreateAddReplaceTFT, + parametersList) +} + +template (value) PacketFilter +ts_GTP2C_PacketFilter(template (value) PacketFilterIdentifier identifier, + template (value) OCT1 evaluationPrecedence, + template (value) octetstring contents) := +{ + identifier := identifier, + evaluationPrecedence := evaluationPrecedence, + lengthIndicator := 0, /* overwritten */ + contents := contents +} + +template (value) PacketFilterIdentifier +ts_PacketFilterIdentifier(template (value) BIT4 identifier, + template (value) BIT2 direction) := { + identifier := identifier, + direction := direction, + spare := '00'B +}; + +/* 8.19 */ +template (value) EPS_BearerLevel_TFT +ts_GTPC2_EPS_BearerLevel_TFT(template (value) TrafficFlowTemplateV trafficFlowTemplateValue, + template (value) BIT4 instance := '0000'B) := +{ + elementIdentifier := '54'O, + lengthIndicator := 0, /* overwritten */ + instance := instance, + spare := '0000'B, + trafficFlowTemplateValue := trafficFlowTemplateValue +} + /* 8.21 */ function ts_GTP2C_UserLocInfo(template (omit) CGI cgi := omit, template (omit) SAI sai := omit, @@ -627,12 +710,13 @@ /* 8.28 */ template (value) BearerContextIEs ts_GTP2C_BcContextIE(template (value) uint4_t ebi, + template (omit) EPS_BearerLevel_TFT ePS_Bearer_TFT := omit, template (omit) FullyQualifiedTEID_List teid_list := omit, template (omit) Bearer_QoS qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0), template (omit) ChargingID charging_id := omit) := { ePS_Bearer_ID := ts_GTP2C_EpsBearerId(ebi), cause := ts_GTP2C_Cause(Request_accepted, '0'B), - ePS_Bearer_TFT := omit, + ePS_Bearer_TFT := ePS_Bearer_TFT, fullyQualifiedTEID := teid_list, bearerLevel_QoS := qos, chargingID := charging_id, @@ -1453,25 +1537,81 @@ privateExtension := omit }}); -/* 8.18 */ -template (value) ServingNetwork -ts_GTP2C_ServingNetwork(template (value) hexstring mcc, - template (value) hexstring mnc, - template (value) BIT4 instance := '0000'B) := -{ - elementIdentifier := '53'O, - lengthIndicator := 0, /* overwritten */ - instance := instance, - spare := '0000'B, - mccDigit1 := mcc[0], - mccDigit2 := mcc[1], - mccDigit3 := mcc[2], - mncDigit3 := mnc[2], /* 'F'H for 2 digit MNC */ - mncDigit1 := mnc[0], - mncDigit2 := mnc[1], - additionalOctets := omit -} +/* 7.2.15 Update Bearer Request */ +template (value) PDU_GTPCv2 +ts_GTP2C_UpdateBearerRequest(template (value) OCT4 d_teid, + template (value) OCT3 seq, + template (value) BearerContextGrouped_List bearerContextGrouped, + template (value) AggregateMaximumBitRate apn_ambr, + template (omit) ProcedureTransactionID procedureTransactionID := omit, + template (omit) ProtocolConfigOptions protocolConfigOptions := omit, + template (omit) ChangeReportingAction changeReportingAction := omit, + template (omit) CSG_InformationReportingAction cSG_InformationReportingAction := omit, + template (omit) Indication indicationFlags := omit, + template (omit) HeNBInformationReporting heNBInformationReporting := omit, + template (omit) FullyQualifiedPDN_ConnectionSetID_List csid := omit, + template (omit) PresenceReportingAreaAction presenceReportingAreaAction := omit, + template (omit) LoadControlInformationGrouped_List loadControlInformationGrouped := omit, + template (omit) OverloadControlInformationGrouped_List overloadControlInformationGrouped := omit, + template (omit) FullyQualifiedContainer nBIFOMContainer := omit) := +ts_PDU_GTP2C(d_teid, seq, '61'O, { + updateBearerRequest := { + bearerContextGrouped := bearerContextGrouped, + procedureTransactionID := procedureTransactionID, + protocolConfigOptions := protocolConfigOptions, + apn_ambr := apn_ambr, + changeReportingAction := changeReportingAction, + cSG_InformationReportingAction := cSG_InformationReportingAction, + indicationFlags := indicationFlags, + heNBInformationReporting := heNBInformationReporting, + csid := csid, + presenceReportingAreaAction := presenceReportingAreaAction, + loadControlInformationGrouped := loadControlInformationGrouped, + overloadControlInformationGrouped := overloadControlInformationGrouped, + nBIFOMContainer := nBIFOMContainer, + privateExtension := omit + }}); +/* 7.2.16 Update Bearer Response */ +template (present) PDU_GTPCv2 +tr_GTP2C_UpdateBearerResp(template (present) OCT4 d_teid, + template (present) OCT3 seq := ?, + template (present) GTP2C_Cause cause := ?, + template BearerContextGrouped_List bearerContextGrouped := *, + template ProtocolConfigOptions protocolConfigOptions := *, + template Recovery recovery := *, + template FullyQualifiedPDN_ConnectionSetID_List csid := *, + template Indication indicationFlags := *, + template UE_TimeZone uE_TimeZone := *, + template UserLocationInfo uLI := *, + template TrustedWLANAccessNetworkIdentifier trustedWLANAccessNetworkIdentifier := *, + template OverloadControlInformationGrouped_List overloadControlInformationGrouped := *, + template PresenceReportingAreaInformation presenceReportingAreaInformation := *, + template IP_Address_List iP_Addr := *, + template TWANIdentifierTimestamp tWANIdentifierTimestamp := *, + template PortNumber_List portNumber := *, + template FullyQualifiedContainer nBIFOMContainer := *, + template ExtendedProtocolConfigOptions extendedProtocolConfigOptions := *) := +tr_PDU_GTP2C(d_teid, seq, { + updateBearerResponse := { + cause := tr_GTP2C_Cause(cause), + bearerContextGrouped := bearerContextGrouped, + protocolConfigOptions := protocolConfigOptions, + recovery := recovery, + csid := csid, + indicationFlags := indicationFlags, + uE_TimeZone := uE_TimeZone, + uLI := uLI, + trustedWLANAccessNetworkIdentifier := trustedWLANAccessNetworkIdentifier, + overloadControlInformationGrouped := overloadControlInformationGrouped, + presenceReportingAreaInformation := presenceReportingAreaInformation, + iP_Addr := iP_Addr, + tWANIdentifierTimestamp := tWANIdentifierTimestamp, + portNumber := portNumber, + nBIFOMContainer := nBIFOMContainer, + extendedProtocolConfigOptions := extendedProtocolConfigOptions, + privateExtension := * + }}); } diff --git a/library/NAS_EPS_Templates.ttcn b/library/NAS_EPS_Templates.ttcn index 20b2913..8ddd11a 100644 --- a/library/NAS_EPS_Templates.ttcn +++ b/library/NAS_EPS_Templates.ttcn @@ -1432,4 +1432,67 @@ } } +/* 8.3.18 Modify EPS bearer context request */ +template (present) PDU_NAS_EPS +tr_NAS_ModifyEpsBearCtxReq(template (present) BIT4 bearer_id := ?, + template (present) BIT8 proc_tid := ?, + template EPS_QualityOfServiceTLV newEPS_QoS := *, + template TrafficFlowTemplateTLV trafficFlowTemplate := *, + template QoSTLV new_QoS := *, + template LLC_SAPITV negotiated_LLC_SAPI := *, + template RadioPriorityTV radioPriority := *, + template PacketFlowIDTLV packetFlowID := *, + template APN_AggregateMaximumBitRateTLV aPN_AMBR := *, + template ProtocolConfigOptionsTLV protocolConfigOptions := *, + template WLANOffloadAcceptabilityTV wLANOffloadIndication := *, + template NBIFOM_ContainerTLV nBIFOMContainer := *, + template HeaderCompressinConfigurationTLV headerCompressinConfiguration := *, + template ExtendedProtocolConfigurationOptionsTLVE extendedProtocolConfigurationOptions := *, + template Extended_APN_AMBR_TLV extended_APN_AMBR := *, + template ExtendedEPSQoSTLV extendedQoS := *) := { + protocolDiscriminator := c_EPS_NAS_PD_ESM, + ePS_messages := { + ePS_SessionManagement := { + pDU_NAS_EPS_ModifyEPSBearerContextRequest := { + ePSBearerIdentity := bearer_id, + procedureTransactionIdentifier := proc_tid, + messageType := '11001001'B, + newEPS_QoS := newEPS_QoS, + trafficFlowTemplate := trafficFlowTemplate, + new_QoS := new_QoS, + negotiated_LLC_SAPI := negotiated_LLC_SAPI, + radioPriority := radioPriority, + packetFlowID := packetFlowID, + aPN_AMBR := aPN_AMBR, + protocolConfigOptions := protocolConfigOptions, + wLANOffloadIndication := wLANOffloadIndication, + nBIFOMContainer := nBIFOMContainer, + headerCompressinConfiguration := headerCompressinConfiguration, + extendedProtocolConfigurationOptions := extendedProtocolConfigurationOptions, + extended_APN_AMBR := extended_APN_AMBR, + extendedQoS := extendedQoS + } + } + } +} + +/* 8.3.16 Modify EPS bearer context accept */ +template (value) PDU_NAS_EPS +ts_NAS_ActDefEpsBearCtxAcc(template (value) BIT4 bearer_id, + template (value) BIT8 proc_tid) := { + protocolDiscriminator := c_EPS_NAS_PD_ESM, + ePS_messages := { + ePS_SessionManagement := { + pDU_NAS_EPS_ModifyEPSBearerContextAccept := { + ePSBearerIdentity := bearer_id, + procedureTransactionIdentifier := proc_tid, + messageType := '11001010'B, + protocolConfigOptions := omit, + nBIFOMContainer := omit, + extendedProtocolConfigurationOptions := omit + } + } + } +} + } diff --git a/mme/ConnHdlr.ttcn b/mme/ConnHdlr.ttcn index e3e62f8..37b60a3 100644 --- a/mme/ConnHdlr.ttcn +++ b/mme/ConnHdlr.ttcn @@ -374,6 +374,50 @@ } } +altstep as_s1ap_handle_ERABModifyRequest_ModifyBearerCtxReq(boolean reply_success := true) runs on ConnHdlr { + var S1AP_PDU rx_msg; + var PDU_NAS_EPS rx_nas; + [] S1AP.receive((tr_S1AP_RABModifyReq(g_pars.ue_pars.mme_ue_id, + g_pars.ue_pars.enb_ue_id, + max_br := omit), + tr_S1AP_RABModifyReq(g_pars.ue_pars.mme_ue_id, + g_pars.ue_pars.enb_ue_id, + max_br := ?))) -> value rx_msg { + var template (value) E_RAB_ID rab_id := 5; + + S1AP.receive(tr_NAS_ModifyEpsBearCtxReq()) -> value rx_nas; + + if (reply_success) { + var template (value) PDU_NAS_EPS nas_esm; + var template (omit) E_RABModifyListBearerModRes rab_modified_items; + + rab_modified_items := + ts_E_RABModifyListBearerModRes(ts_E_RABModifyItemBearerModRes(rab_id := rab_id)) + S1AP.send(ts_S1AP_RABModifyRsp(g_pars.ue_pars.mme_ue_id, + g_pars.ue_pars.enb_ue_id, + rab_modified_items := rab_modified_items, + rab_failed_items := omit)); + + nas_esm := ts_NAS_ActDefEpsBearCtxAcc(bearer_id := int2bit(g_pars.ue_pars.bearer.ebi, 4), + proc_tid := int2bit(1,8)); + S1AP.send(nas_esm); + } else { + var template (omit) E_RABList rab_failed_items; + + rab_failed_items := + ts_E_RABList(ts_E_RABItem(rab_id := rab_id, + cause := {radioNetwork := reduce_load_in_serving_cell})); + S1AP.send(ts_S1AP_RABModifyRsp(g_pars.ue_pars.mme_ue_id, + g_pars.ue_pars.enb_ue_id, + rab_modified_items := omit, + rab_failed_items := rab_failed_items)); + } + } + [] S1AP.receive(PDU_NAS_EPS:?) -> value rx_nas { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Rx Unexpected NAS PDU msg: ", rx_nas)); + } +} + altstep as_s1ap_handle_IntialCtxSetupReq_TAU_Accept() runs on ConnHdlr { var S1AP_PDU rx_msg; var PDU_NAS_EPS rx_nas; @@ -678,6 +722,51 @@ } } +function f_GTP2C_tx_UpdateBearerRequest() +runs on ConnHdlr { + var uint16_t gtpc_seq_nr := f_rnd_int(65535); + var template (value) GTPv2_Types.TrafficFlowTemplateV flow; + var template (value) BearerContextGrouped bctx; + var template (value) PDU_GTPCv2 upd_req; + + flow := ts_GTP2C_TrafficFlowTemplateV_U_CreateAddReplaceTFT(numberOfPacketFilters := 1, + operationCodeTFT := '011'B, /* Add packet filters to existing TFT */ + packetFilterList_CreateAddReplaceTFT := { + ts_GTP2C_PacketFilter(identifier := ts_PacketFilterIdentifier(identifier := '0100'B, + direction := '01'B), + evaluationPrecedence := '1C'O, + contents := '3011100a13eb85ffffffff11ac170642ffffffff50a00c40c370'O) + }) + bctx := ts_GTP2C_BcGrouped(ts_GTP2C_BcContextIE(ebi := g_pars.ue_pars.bearer.ebi, + ePS_Bearer_TFT := ts_GTPC2_EPS_BearerLevel_TFT(trafficFlowTemplateValue := flow), + qos := ts_GTP2C_BearerQos(qci := '01'O, + max_br_ul := 44, + max_br_dl := 31, + g_br_ul := 44, + g_br_dl := 31, + prio_lvl := '0010'B, + pe_vuln := '0'B, + pe_capa := '0'B))); + upd_req := ts_GTP2C_UpdateBearerRequest(d_teid := g_pars.ue_pars.s11_teic_remote, + seq := int2oct(gtpc_seq_nr, 3), + bearerContextGrouped := { bctx }, + apn_ambr := ts_GTP2C_Ambr(102400, 102400)); + GTP2.send(upd_req); +} + +altstep as_GTP2C_UpdateBearerResp(template (present) GTP2C_Cause cause := Request_accepted) runs on ConnHdlr { + var PDU_GTPCv2 rx_msg; + + [] GTP2.receive(tr_GTP2C_UpdateBearerResp(g_pars.ue_pars.s11_teic_local, + cause := cause)) -> value rx_msg { + setverdict(pass); + } + [] GTP2.receive { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Unexpected GTPv2/S11 message from MME")); + } +} + /* 3GPP TS 23.401 D.3.5, TS 23.003 2.8.2.1 */ private function guti2rai_ptmsi(in NAS_EPS_Types.GUTI guti, in OCT2 truncated_nas_token, out RoutingAreaIdentity rai, out OCT4 ptmsi, out OCT3 ptmsi_sig) runs on ConnHdlr { diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn index 586c667..e717766 100644 --- a/mme/MME_Tests.ttcn +++ b/mme/MME_Tests.ttcn @@ -816,6 +816,45 @@ vc_conn.done; } +/* SWGC forwards PGW-originated GTPv2C Update Bearer Request to MME, + * which should update the eRAB + NAS towards the eNB+UE. + * Success scenario. */ +private function f_TC_incoming_update_bearer_success() runs on ConnHdlr { + f_attach(); + f_GTP2C_tx_UpdateBearerRequest(); + as_s1ap_handle_ERABModifyRequest_ModifyBearerCtxReq(reply_success := true); + as_GTP2C_UpdateBearerResp(cause := Request_accepted); +} +testcase TC_incoming_update_bearer_success() runs on MTC_CT { + f_init(9, init_diameter := true, init_gtpv2c_s11 := true); + f_s1ap_setup(0); + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_incoming_update_bearer_success), pars); + vc_conn.done; +} + +/* SWGC forwards PGW-originated GTPv2C Update Bearer Request to MME, + * which should update the eRAB + NAS towards the eNB+UE. + * eNB fails to update the eRAB scenario. */ +private function f_TC_incoming_update_bearer_enb_failure() runs on ConnHdlr { + f_attach(); + f_GTP2C_tx_UpdateBearerRequest(); + as_s1ap_handle_ERABModifyRequest_ModifyBearerCtxReq(reply_success := false); + as_GTP2C_UpdateBearerResp(cause := No_resources_available); +} +testcase TC_incoming_update_bearer_enb_failure() runs on MTC_CT { + f_init(11, init_diameter := true, init_gtpv2c_s11 := true); + f_s1ap_setup(0); + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_incoming_update_bearer_enb_failure), pars); + vc_conn.done; +} + + control { execute( TC_s1ap_setup_unknown_global_enb_id_plmn() ); execute( TC_s1ap_setup_wrong_tac() ); @@ -829,6 +868,8 @@ execute( TC_ue_cell_reselect_eutran_to_geran() ); execute( TC_ue_cell_reselect_geran_to_eutran() ); execute( TC_s1ap_attach_no_emergency() ); + execute( TC_incoming_update_bearer_success() ); + execute( TC_incoming_update_bearer_enb_failure() ); } diff --git a/mme/expected-results.xml b/mme/expected-results.xml index ae2dd4e..95b2d55 100644 --- a/mme/expected-results.xml +++ b/mme/expected-results.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<testsuite name='Titan' tests='17' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> +<testsuite name='Titan' tests='23' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='MME_Tests' name='TC_s1ap_setup_unknown_global_enb_id_plmn' time='MASKED'/> <testcase classname='MME_Tests' name='TC_s1ap_setup_wrong_tac' time='MASKED'/> <testcase classname='MME_Tests' name='TC_s1ap_setup' time='MASKED'/> @@ -12,6 +12,8 @@ <testcase classname='MME_Tests' name='TC_ue_cell_reselect_eutran_to_geran' time='MASKED'/> <testcase classname='MME_Tests' name='TC_ue_cell_reselect_geran_to_eutran' time='MASKED'/> <testcase classname='MME_Tests' name='TC_s1ap_attach_no_emergency' time='MASKED'/> + <testcase classname='MME_Tests' name='TC_incoming_update_bearer_success' time='MASKED'/> + <testcase classname='MME_Tests' name='TC_incoming_update_bearer_enb_failure' time='MASKED'/> <testcase classname='MME_Tests_SGsAP' name='TC_sgsap_vlr_reset' time='MASKED'/> <testcase classname='MME_Tests_SGsAP' name='TC_sgsap_paging_sms' time='MASKED'/> <testcase classname='MME_Tests_SGsAP' name='TC_sgsap_paging_cs' time='MASKED'/> diff --git a/mme/regen_makefile.sh b/mme/regen_makefile.sh index 79686ab..1e4ed89 100755 --- a/mme/regen_makefile.sh +++ b/mme/regen_makefile.sh @@ -28,6 +28,11 @@ TELNETasp_PT.cc " +# https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 +REGEN_MAKEFILE_ADD_TTCN3_COMPILER_FLAGS_IF_SUPPORTED=" + --legacy-template-subrefs +" + . ../_buildsystem/regen_makefile.inc.sh sed -i -e 's/^LINUX_LIBS = -lxml2 -lsctp/LINUX_LIBS = -lxml2 -lsctp -lgnutls/' Makefile -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44198?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ib0c0996ed1cbf9b2182e3b232b733af5b9c441ce Gerrit-Change-Number: 44198 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de>
participants (1)
-
pespin