Loading ttcn/AtsNGAP/NGAP_Steps.ttcn +70 −0 Changes for ttcn/AtsNGAP/NGAP_Steps.ttcn: 70 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG // Lib3GPP import from NG_NAS_TypeDefs all; import from NG_NAS_MsgContainers all; // LibNGAP import from NGAP_CommonDataTypes language "ASN.1:1997" all; Loading Loading @@ -1134,6 +1135,75 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG return true; } // End of function f_NGAP_gnb_check_uplink_gpdu /** * @brief Default altstep catching the uplink NAS messages of a real UE once its PDU session is being set up. * @details Activated by TC_NGAP_GNB_PDU_01 from the PDU SESSION RESOURCE SETUP REQUEST (carrying the PDU * SESSION ESTABLISHMENT ACCEPT) until the end of the test body. Any UPLINK NAS TRANSPORT received * meanwhile, which a_defaultNGAP would silently discard, is reported by * f_NGAP_gnb_report_ue_nas_message; the interrupted alt then goes on (repeat). It is activated * after a_defaultNGAP, so it is evaluated first. */ altstep a_NGAP_gnb_ue_nas_messages() runs on gNBNGAPComponent { var NGAP_PDU v_pdu; [] N2_gNBaMF_P.receive(mw_ngap_initMsg({ procedureCode := id_UplinkNASTransport, criticality := ?, value_ := ? })) -> value v_pdu { f_NGAPPDU_Get(v_pdu); f_NASPDU_Get(vc_recvNGAP_PDU); f_NGAP_gnb_report_ue_nas_message(); repeat; } } // End of altstep a_NGAP_gnb_ue_nas_messages /** * @brief Report an uplink NAS message the UE sent while its PDU session is being set up or used. * @details The message (vc_recvNAS_PDU) is deciphered and decoded (f_NG_NAS_UL_GetPlainMessage), then: * - 5GMM STATUS (TS 24.501 clause 8.2.29): the UE could not handle a 5GMM message, e.g. the DL NAS * TRANSPORT carrying the accept; * - UL NAS TRANSPORT carrying a 5GSM STATUS (clause 8.3.16) or a PDU SESSION RELEASE REQUEST (clause * 8.3.12): the UE refuses the PDU SESSION ESTABLISHMENT ACCEPT, or drops the session; * set the verdict to inconc, with the cause: these come from the UE and the accept built by the test * system, not from the gNB under test. Any other message is only logged. */ function f_NGAP_gnb_report_ue_nas_message() runs on gNBNGAPComponent { var NG_NAS_UL_Message_Type v_message; var octetstring v_gsm; if (not f_NG_NAS_UL_GetPlainMessage(v_message)) { log("*** " & __SCOPE__ & ": INFO: undecodable uplink NAS message from the UE: ", vc_recvNAS_PDU, " ***"); return; } if (ischosen(v_message.gmm_Status)) { log("*** " & __SCOPE__ & ": INCONC: 5GMM STATUS from the UE, cause ", v_message.gmm_Status.gmmCause, " ***"); setverdict(inconc, "5GMM STATUS from the UE"); return; } if (not ischosen(v_message.ul_Nas_Transport)) { log("*** " & __SCOPE__ & ": INFO: uplink NAS message from the UE: ", v_message, " ***"); return; } // 5GSM message (TS 24.501 clause 8.3.1): EPD, PDU session ID, PTI, message type, ... v_gsm := v_message.ul_Nas_Transport.payload.payload; if ((lengthof(v_gsm) < 4) or (v_gsm[0] != '2E'O)) { log("*** " & __SCOPE__ & ": INFO: UL NAS TRANSPORT from the UE, not 5GSM: ", v_message, " ***"); return; } if (v_gsm[3] == 'D6'O) { log("*** " & __SCOPE__ & ": INCONC: 5GSM STATUS from the UE for PDU session ", v_gsm[1], ", 5GSM cause ", substr(v_gsm, 4, lengthof(v_gsm) - 4), " ***"); setverdict(inconc, "5GSM STATUS from the UE"); } else if (v_gsm[3] == 'D1'O) { log("*** " & __SCOPE__ & ": INCONC: PDU SESSION RELEASE REQUEST from the UE for PDU session ", v_gsm[1], ": ", v_gsm, " ***"); setverdict(inconc, "PDU SESSION RELEASE REQUEST from the UE"); } else { log("*** " & __SCOPE__ & ": INFO: 5GSM message ", v_gsm[3], " from the UE for PDU session ", v_gsm[1], ": ", v_gsm, " ***"); } } // End of function f_NGAP_gnb_report_ue_nas_message /** * @brief Leave the real UE in a known state at the end of a test: deregistered, in flight mode. * @details Unless PX_UT_DEREGISTER_TIMEOUT is 0.0: asks the upper tester to switch the modem to flight Loading ttcn/AtsNGAP/NGAP_TCFunctions.ttcn +10 −2 Changes for ttcn/AtsNGAP/NGAP_TCFunctions.ttcn: 10 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ module NGAP_TCFunctions { function f_TC_NGAP_GNB_PDU_01() runs on gNBNGAPComponent { // Local variables var PDUSessionID v_pduSessionId := PX_PDU_SESSION_ID; // PDU session to be set up var default v_ueNasMessages := null; // a_NGAP_gnb_ue_nas_messages, while the PDU session is set up and used // Preamble f_NGAP_gnb_init(); Loading Loading @@ -90,6 +91,9 @@ module NGAP_TCFunctions { f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } v_pduSessionId := oct2int(v_psi); // From now on, report a 5GSM STATUS or a PDU SESSION RELEASE REQUEST of the UE instead of // discarding it (TS 24.501 clauses 8.3.16 and 8.3.12) v_ueNasMessages := activate(a_NGAP_gnb_ue_nas_messages()); f_send_pdu_session_resource_setup_request_with_accept(v_psi, v_pti); } else { var PDUSessionResourceSetupRequestTransfer v_pdu_session_resource_setup_request_transfer := valueof( Loading Loading @@ -189,12 +193,16 @@ module NGAP_TCFunctions { if (not f_NGAP_gnb_UE_await_data_call()) { log("*** " & __SCOPE__ & ": INCONC: the PDU session is set up, but the UE data call is not connected. ***"); } else if (f_NGAP_gnb_UE_ping()) { // User plane probe: the echo requests must reach PX_TRANSPORT_LAYER_ADDRESS as uplink // G-PDUs (check with a capture on UDP port 2152); not checked by the test yet // User plane: the UE pinged PX_UT_PING_HOST; with PICS_USE_GTPU the uplink G-PDUs and the // downlink echo replies are checked by f_NGAP_gnb_UE_ping log("*** " & __SCOPE__ & ": INFO: user plane traffic sent by the UE ***"); } } } if (v_ueNasMessages != null) { // The postamble awaits the DEREGISTRATION REQUEST of the UE in an UPLINK NAS TRANSPORT deactivate(v_ueNasMessages); } f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); log("*** " & __SCOPE__ & ": INFO: Testbody done. ***"); Loading ttcn/AtsNGAP/NGAP_TestConfiguration.ttcn +5 −5 Changes for ttcn/AtsNGAP/NGAP_TestConfiguration.ttcn: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ module NGAP_TestConfiguration { */ function f_cf_Ut_Up(in NGNASComponent p_ptc) runs on NGNASComponent system TestAdapter { if (PICS_USE_AT_COMMANDS) { var NGNASComponent v_utDispatcher := NGNASComponent.create; var NGNASComponent v_utDispatcher := NGNASComponent.create("UtDispatcher"); map(v_utDispatcher:utPort, system:utPort); connect(v_utDispatcher:utMtcPtcPort, p_ptc:utPtcMtcPort); v_utDispatcher.start(f_UtDispatcherMain(p_ptc)); Loading @@ -61,7 +61,7 @@ module NGAP_TestConfiguration { } //Create p_NGAPComponent_amf := aMFNGAPComponent.create ; p_NGAPComponent_amf := aMFNGAPComponent.create("AMF"); // Connect mtc sync port connect(self:syncPort, self:syncPort); Loading @@ -87,7 +87,7 @@ module NGAP_TestConfiguration { var FncRetCode v_ret := e_success; //Create p_NGAPComponent_gnb := gNBNGAPComponent.create ; p_NGAPComponent_gnb := gNBNGAPComponent.create("gNB") ; // Connect mtc sync port connect(self:syncPort, self:syncPort); Loading Loading @@ -118,8 +118,8 @@ module NGAP_TestConfiguration { var FncRetCode v_ret := e_success; //Create p_NGAPComponent_gnb1 := gNBNGAPComponent.create; p_NGAPComponent_gnb2 := gNBNGAPComponent.create; p_NGAPComponent_gnb1 := gNBNGAPComponent.create("gNB1"); p_NGAPComponent_gnb2 := gNBNGAPComponent.create("gNB2"); // Connect mtc sync port connect(self:syncPort, self:syncPort); Loading Loading
ttcn/AtsNGAP/NGAP_Steps.ttcn +70 −0 Changes for ttcn/AtsNGAP/NGAP_Steps.ttcn: 70 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG // Lib3GPP import from NG_NAS_TypeDefs all; import from NG_NAS_MsgContainers all; // LibNGAP import from NGAP_CommonDataTypes language "ASN.1:1997" all; Loading Loading @@ -1134,6 +1135,75 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG return true; } // End of function f_NGAP_gnb_check_uplink_gpdu /** * @brief Default altstep catching the uplink NAS messages of a real UE once its PDU session is being set up. * @details Activated by TC_NGAP_GNB_PDU_01 from the PDU SESSION RESOURCE SETUP REQUEST (carrying the PDU * SESSION ESTABLISHMENT ACCEPT) until the end of the test body. Any UPLINK NAS TRANSPORT received * meanwhile, which a_defaultNGAP would silently discard, is reported by * f_NGAP_gnb_report_ue_nas_message; the interrupted alt then goes on (repeat). It is activated * after a_defaultNGAP, so it is evaluated first. */ altstep a_NGAP_gnb_ue_nas_messages() runs on gNBNGAPComponent { var NGAP_PDU v_pdu; [] N2_gNBaMF_P.receive(mw_ngap_initMsg({ procedureCode := id_UplinkNASTransport, criticality := ?, value_ := ? })) -> value v_pdu { f_NGAPPDU_Get(v_pdu); f_NASPDU_Get(vc_recvNGAP_PDU); f_NGAP_gnb_report_ue_nas_message(); repeat; } } // End of altstep a_NGAP_gnb_ue_nas_messages /** * @brief Report an uplink NAS message the UE sent while its PDU session is being set up or used. * @details The message (vc_recvNAS_PDU) is deciphered and decoded (f_NG_NAS_UL_GetPlainMessage), then: * - 5GMM STATUS (TS 24.501 clause 8.2.29): the UE could not handle a 5GMM message, e.g. the DL NAS * TRANSPORT carrying the accept; * - UL NAS TRANSPORT carrying a 5GSM STATUS (clause 8.3.16) or a PDU SESSION RELEASE REQUEST (clause * 8.3.12): the UE refuses the PDU SESSION ESTABLISHMENT ACCEPT, or drops the session; * set the verdict to inconc, with the cause: these come from the UE and the accept built by the test * system, not from the gNB under test. Any other message is only logged. */ function f_NGAP_gnb_report_ue_nas_message() runs on gNBNGAPComponent { var NG_NAS_UL_Message_Type v_message; var octetstring v_gsm; if (not f_NG_NAS_UL_GetPlainMessage(v_message)) { log("*** " & __SCOPE__ & ": INFO: undecodable uplink NAS message from the UE: ", vc_recvNAS_PDU, " ***"); return; } if (ischosen(v_message.gmm_Status)) { log("*** " & __SCOPE__ & ": INCONC: 5GMM STATUS from the UE, cause ", v_message.gmm_Status.gmmCause, " ***"); setverdict(inconc, "5GMM STATUS from the UE"); return; } if (not ischosen(v_message.ul_Nas_Transport)) { log("*** " & __SCOPE__ & ": INFO: uplink NAS message from the UE: ", v_message, " ***"); return; } // 5GSM message (TS 24.501 clause 8.3.1): EPD, PDU session ID, PTI, message type, ... v_gsm := v_message.ul_Nas_Transport.payload.payload; if ((lengthof(v_gsm) < 4) or (v_gsm[0] != '2E'O)) { log("*** " & __SCOPE__ & ": INFO: UL NAS TRANSPORT from the UE, not 5GSM: ", v_message, " ***"); return; } if (v_gsm[3] == 'D6'O) { log("*** " & __SCOPE__ & ": INCONC: 5GSM STATUS from the UE for PDU session ", v_gsm[1], ", 5GSM cause ", substr(v_gsm, 4, lengthof(v_gsm) - 4), " ***"); setverdict(inconc, "5GSM STATUS from the UE"); } else if (v_gsm[3] == 'D1'O) { log("*** " & __SCOPE__ & ": INCONC: PDU SESSION RELEASE REQUEST from the UE for PDU session ", v_gsm[1], ": ", v_gsm, " ***"); setverdict(inconc, "PDU SESSION RELEASE REQUEST from the UE"); } else { log("*** " & __SCOPE__ & ": INFO: 5GSM message ", v_gsm[3], " from the UE for PDU session ", v_gsm[1], ": ", v_gsm, " ***"); } } // End of function f_NGAP_gnb_report_ue_nas_message /** * @brief Leave the real UE in a known state at the end of a test: deregistered, in flight mode. * @details Unless PX_UT_DEREGISTER_TIMEOUT is 0.0: asks the upper tester to switch the modem to flight Loading
ttcn/AtsNGAP/NGAP_TCFunctions.ttcn +10 −2 Changes for ttcn/AtsNGAP/NGAP_TCFunctions.ttcn: 10 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ module NGAP_TCFunctions { function f_TC_NGAP_GNB_PDU_01() runs on gNBNGAPComponent { // Local variables var PDUSessionID v_pduSessionId := PX_PDU_SESSION_ID; // PDU session to be set up var default v_ueNasMessages := null; // a_NGAP_gnb_ue_nas_messages, while the PDU session is set up and used // Preamble f_NGAP_gnb_init(); Loading Loading @@ -90,6 +91,9 @@ module NGAP_TCFunctions { f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } v_pduSessionId := oct2int(v_psi); // From now on, report a 5GSM STATUS or a PDU SESSION RELEASE REQUEST of the UE instead of // discarding it (TS 24.501 clauses 8.3.16 and 8.3.12) v_ueNasMessages := activate(a_NGAP_gnb_ue_nas_messages()); f_send_pdu_session_resource_setup_request_with_accept(v_psi, v_pti); } else { var PDUSessionResourceSetupRequestTransfer v_pdu_session_resource_setup_request_transfer := valueof( Loading Loading @@ -189,12 +193,16 @@ module NGAP_TCFunctions { if (not f_NGAP_gnb_UE_await_data_call()) { log("*** " & __SCOPE__ & ": INCONC: the PDU session is set up, but the UE data call is not connected. ***"); } else if (f_NGAP_gnb_UE_ping()) { // User plane probe: the echo requests must reach PX_TRANSPORT_LAYER_ADDRESS as uplink // G-PDUs (check with a capture on UDP port 2152); not checked by the test yet // User plane: the UE pinged PX_UT_PING_HOST; with PICS_USE_GTPU the uplink G-PDUs and the // downlink echo replies are checked by f_NGAP_gnb_UE_ping log("*** " & __SCOPE__ & ": INFO: user plane traffic sent by the UE ***"); } } } if (v_ueNasMessages != null) { // The postamble awaits the DEREGISTRATION REQUEST of the UE in an UPLINK NAS TRANSPORT deactivate(v_ueNasMessages); } f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict()); log("*** " & __SCOPE__ & ": INFO: Testbody done. ***"); Loading
ttcn/AtsNGAP/NGAP_TestConfiguration.ttcn +5 −5 Changes for ttcn/AtsNGAP/NGAP_TestConfiguration.ttcn: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ module NGAP_TestConfiguration { */ function f_cf_Ut_Up(in NGNASComponent p_ptc) runs on NGNASComponent system TestAdapter { if (PICS_USE_AT_COMMANDS) { var NGNASComponent v_utDispatcher := NGNASComponent.create; var NGNASComponent v_utDispatcher := NGNASComponent.create("UtDispatcher"); map(v_utDispatcher:utPort, system:utPort); connect(v_utDispatcher:utMtcPtcPort, p_ptc:utPtcMtcPort); v_utDispatcher.start(f_UtDispatcherMain(p_ptc)); Loading @@ -61,7 +61,7 @@ module NGAP_TestConfiguration { } //Create p_NGAPComponent_amf := aMFNGAPComponent.create ; p_NGAPComponent_amf := aMFNGAPComponent.create("AMF"); // Connect mtc sync port connect(self:syncPort, self:syncPort); Loading @@ -87,7 +87,7 @@ module NGAP_TestConfiguration { var FncRetCode v_ret := e_success; //Create p_NGAPComponent_gnb := gNBNGAPComponent.create ; p_NGAPComponent_gnb := gNBNGAPComponent.create("gNB") ; // Connect mtc sync port connect(self:syncPort, self:syncPort); Loading Loading @@ -118,8 +118,8 @@ module NGAP_TestConfiguration { var FncRetCode v_ret := e_success; //Create p_NGAPComponent_gnb1 := gNBNGAPComponent.create; p_NGAPComponent_gnb2 := gNBNGAPComponent.create; p_NGAPComponent_gnb1 := gNBNGAPComponent.create("gNB1"); p_NGAPComponent_gnb2 := gNBNGAPComponent.create("gNB2"); // Connect mtc sync port connect(self:syncPort, self:syncPort); Loading