Commit 5323c62c authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in REGISTRATION_ACCEPT template/function

parent acc87ce1
Loading
Loading
Loading
Loading
+17.5 KiB (41.5 KiB)

File changed.

No diff preview for this file type.

+1 −1
Changes for etc/AtsNGAP/AtsNGAP_GNB_p_net.cfg_: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ system.NGAP_gNB_1.params := "NGAP/SCTP(local_server=10.174.19.14,server_mode=1,l
#system.NGAP_AMF.params := "NGAP/SCTP_FILE/IP_OFFLINE/PCAP_FILE(file=../captures/ttcn_5g_ngap.pcapng)" # Linux cooked capture v2, no Ethernet layer
#system.NGAP_AMF.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0,mac_dst=8c554ac1eee1)/PCAP_FILE(file=../captures/TC_NGAP_AMF_PDU_01.pcap)" # regular pcap with Ethernet layer

system.utPort.params := "UT/TCP(server=localhost,port=12100,debug=1)"
system.utPort.params := "UT/TCP(server=10.59.0.7,port=12100,debug=1)"

[DEFINE]
# In this section you can create macro definitions,
+12 −3
Changes for ttcn/AtsNGAP/NGAP_Steps.ttcn: 12 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
    import from UpperTesterFunctions all;

    // Lib_NG_NAS
    import from Lib_NG_NAS_Templates all;
    import from Lib_NG_NAS_Security_Functions all;

    // AtsNGAP
@@ -676,17 +677,25 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
                log("f_NGAP_gnb_UE_SecurityMode: vc_inner_message is not bound or empty");
                setverdict(fail, "Security Mode Command message content is not available for verification");
            } else {
                // TODO FSCOM To be enhanced with more detailed verification of the Security Mode Command message content
                log("f_NGAP_gnb_UE_SecurityMode: vc_inner_message is bound and has length ", lengthof(vc_inner_message));
                var NG_REGISTRATION_REQUEST v_inner_message;
                var bitstring v_bs := oct2bit(vc_inner_message);
                var integer v_result := decvalue(v_bs, v_inner_message);
                vc_recvNgNasUl_Msg.registration_Request := v_inner_message;
                if (v_result != 0) {
                    log("f_NGAP_gnb_UE_SecurityMode: Failed to decode Security Mode Command message content");
                    setverdict(fail, "Failed to decode Security Mode Command message content");
                } else {
                    log_msg("f_NGAP_gnb_UE_SecurityMode: v_inner_message: ", v_inner_message);
                    // FIXME FSCOM To be enhanced with verification of the inner message
                    log("f_NGAP_gnb_UE_SecurityMode: v_inner_message: ", v_inner_message);

                    if (match(vc_recvNgNasUl_Msg, mw_NG_REGISTRATION_REQUEST)) { // FIXME FSCOM Enforce the template matching to the expected NG_REGISTRATION_REQUEST message content
                        log("f_NGAP_gnb_UE_SecurityMode: Received NG_REGISTRATION_REQUEST NAS message");
                        vc_registration_request := v_inner_message;
                        setverdict(pass, "Received NG_REGISTRATION_REQUEST NAS message");
                    } else {
                        log("f_NGAP_gnb_UE_SecurityMode: v_inner_message does not match expected NG_REGISTRATION_REQUEST");
                        setverdict(fail, "Security Mode Command message content does not match expected NG_REGISTRATION_REQUEST");
                    }
                }
            }
            log("<<< f_NGAP_gnb_UE_SecurityMode");
+1 −1
Changes for ttcn/LibNGAP/lib/LibNGAP_Templates.ttcn: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -18086,7 +18086,7 @@ module LibNGAP_Templates {
                } // End of template mw_candidatePCI
                template (present) Cause mw_cause_radioNetwork(
                                                            template (present) CauseRadioNetwork p_radioNetwork
                                                               template (present) CauseRadioNetwork p_radioNetwork := unspecified
                                                               ) := {
                    radioNetwork := p_radioNetwork
                } // End of template mw_cause_radioNetwork
+33 −7
Changes for ttcn/LibNGAP/lib_system/LibNGAP_Functions.ttcn: 33 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -1263,6 +1263,23 @@ module LibNGAP_Functions {

        // Send InitialContextSetupRequest
        // 1. Build the NAS message for Registration Accept
        var template (value) NG_MobileIdentity v_guti;
        log("f_send_initial_context_setup_request_await_initial_context_setup_resonse: typeOfId=", vc_registration_request.ngMobileId.typeOfId);
        if (vc_registration_request.ngMobileId.typeOfId == tsc_IdType_NG_SUCI) {
            var NG_NAS_GutiParameters_Type v_guti_parameters;
            v_guti_parameters.AMF_RegionId := PX_AMF_REGION_ID;
            v_guti_parameters.AMF_SetId    := PX_AMF_SET_ID;
            v_guti_parameters.AMF_Pointer  := PX_AMF_POINTER;
            v_guti_parameters.NG_TMSI      := oct2bit(px_TMSI_Def);
            v_guti := f_NG_GutiParameters2MobileIdentity(
                                                         fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC),
                                                         v_guti_parameters
                                                        );
        } else {
            setverdict(inconc, "*** " & __SCOPE__ & ": FAIL: Unexpected typeOfId in Registration Request");
            testcase.stop("*** " & __SCOPE__ & ": INCONC: Unexpected typeOfId in Registration Request. ***");
        }
                
        var NG_NAS_DL_Message_Type v_nas_message := valueof(
                                                            m_NG_REGISTRATION_ACCEPT(
                                                                                     cs_RegistrationResult(
@@ -1272,23 +1289,32 @@ module LibNGAP_Functions {
                                                                                                           '0'B,
                                                                                                           '0'B
                                                                                                           ),
                                                                                     f_NG_Imeisv2MobileIdentity_v(px_IMEISV_Def),
                                                                                     v_guti,
                                                                                     -,
                                                                                     m_NG_TrackingAreaIdList(
                                                                                                             -,
                                                                                                             m_NG_TrackingAreaIdList_LV(
                                                                                                                                        '07'O,
                                                                                                                                        '07'O, // One PLMN + TAC
                                                                                                                                        {
                                                                                                                                            m_NG_ListOfPartialTaiList(
                                                                                                                                                                      -, -,
                                                                                                                                                                      '00001'B,
                                                                                                                                                                      '00000'B,
                                                                                                                                                                      valueof(
                                                                                                                                                                              m_NG_PartialTaiType_type3(
                                                                                                                                                                                                       m_NG_Type3Element(
                                                                                                                                                                              m_NG_PartialTaiType_type2(
                                                                                                                                                                                                        { 
                                                                                                                                                                                                            m_NG_Type2Element(
                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                mw_ng_partial_tai(
                                                                                                                                                                                                                                                  fl_NasNN_MCC2PlmnId(
                                                                                                                                                                                                                                                        PX_NAS_MCC, 
                                                                                                                                                                                                                                                        PX_NAS_MNC
                                                                                                                                                                     )))))
                                                                                                                                                                                                                                                  ),
                                                                                                                                                                                                                                                  PX_TACode
                                                                                                                                                                                                                                                  )
                                                                                                                                                                                                                              }
                                                                                                                                                                                                            )
                                                                                                                                                                                                        }
                                                                                                                                                                     )))
                                                                                                                                        }
                                                                                                             )),
                                                                                     cs_NSSAI_SST1eMBB('15'O),
@@ -1359,7 +1385,7 @@ module LibNGAP_Functions {
                                                                                                                                                  ),
                                                                                                                                          {
                                                                                                                                            m_allowedNSSAI_Item(
                                                                                                                                                                m_s_NSSAI('00'O, '000000'O)
                                                                                                                                                                m_s_NSSAI(-, PX_SD)
                                                                                                                                                                )
                                                                                                                                          },
                                                                                                                                          m_uESecurityCapabilities,
Loading