Commit ba0c23f7 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add semantic check in Makefile; Add build stamp; Add IPv6 support

parent b1b3d3b6
Loading
Loading
Loading
Loading
+12 −2
Changes for Makefile: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -83,10 +83,15 @@ cc_objects := $(patsubst %.cc, $(outdir)/%.o, $(cc_sources))

outbin = $(bindir)/$(ATS)$(SUB_ATS)$(EXE)

.PHONY: all FORCE echo
.PHONY: all FORCE echo check

all: $(bindir) $(outdir) $(outbin)

# Semantic check of all the TTCN-3 and ASN.1 sources of $(ATS), without generating or compiling code
# (a minute, versus a long C++ build): catches syntax and type errors. See scripts/semantic_check.sh
check:
	$(TTCN3_DIR)/bin/compiler -s $(TTCN3_COMPILER_OPTIONS) $(tt_sources)

echo_sources:
	@echo -e "$(addsuffix \n,$(all_sources))"

@@ -120,8 +125,13 @@ t3d: all
$(outdir) $(outdir)/asn1 $(bindir):
	mkdir -p $@

# Build stamp (fx_build_stamp, logged at test start): compiled when the executable is linked, so that it
# names the commit, the link date and the host of the executable actually run
build_stamp = $(shell git -C $(TOPDIR) describe --always --dirty 2>/dev/null || echo unknown) built $(shell date -u +%Y-%m-%dT%H:%M:%SZ) on $(shell hostname)

$(bindir)/$(ATS)$(EXE): $(gen_objects) $(cc_objects) 
	g++ -g -O0 -std=c++17 -o $@ $(LDFLAGS) $(gen_objects) $(cc_objects) $(libs)
	g++ -g -O0 -std=c++17 -fPIC -c $(addprefix -D, $(defines)) -DBUILD_STAMP='"$(build_stamp)"' $(addprefix -I, $(includes)) -o $(outdir)/build_stamp_ext.o $(TOPDIR)/ccsrc/Externals/build_stamp_ext.cc
	g++ -g -O0 -std=c++17 -o $@ $(LDFLAGS) $(gen_objects) $(cc_objects) $(outdir)/build_stamp_ext.o $(libs)

$(gen_objects) :%.o :%.cc
	g++ -g -O0 -std=c++17 -Wno-long-long -flarge-source-files -Wmisleading-indentation -fPIC -c $(addprefix -D, $(defines)) $(addprefix -I, $(includes)) -o $@ $<
+11 −12
Changes for ttcn/AtsNGAP/NGAP_Steps.ttcn: 11 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -785,12 +785,14 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
                if (p_dataCallCnf) {
                    fl_UT_ApplyCommand(utPtcMtcPort, cas_UT_Req(ACTIVATE_BEARER, CNF_REQUIRED, {
                                                                                                cs_Ut_Parameter_Common("APN", PX_UT_DATA_CALL_APN),
                                                                                                cs_Ut_Parameter_Common("ATTACH_TIMEOUT", float2str(PX_UT_DATA_CALL_ATTACH_TIMEOUT))
                                                                                                cs_Ut_Parameter_Common("ATTACH_TIMEOUT", float2str(PX_UT_DATA_CALL_ATTACH_TIMEOUT)),
                                                                                                cs_Ut_Parameter_Common("IPTYPE", PX_UT_PDU_SESSION_TYPE)
                                                                                                }), true); // Confirmation read by f_NGAP_gnb_UE_await_data_call
                } else {
                    fl_UT_ApplyCommand(utPtcMtcPort, cas_UT_Req(ACTIVATE_BEARER, NO_CNF_REQUIRED, {
                                                                                                   cs_Ut_Parameter_Common("APN", PX_UT_DATA_CALL_APN),
                                                                                                   cs_Ut_Parameter_Common("ATTACH_TIMEOUT", float2str(PX_UT_DATA_CALL_ATTACH_TIMEOUT))
                                                                                                   cs_Ut_Parameter_Common("ATTACH_TIMEOUT", float2str(PX_UT_DATA_CALL_ATTACH_TIMEOUT)),
                                                                                                   cs_Ut_Parameter_Common("IPTYPE", PX_UT_PDU_SESSION_TYPE)
                                                                                                   }));
                }
            }
@@ -850,6 +852,11 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
                    break;
                }
            }
            if (PX_UT_PDU_SESSION_TYPE == "IPV6") {
                // The UE builds its IPv6 address from the interface identifier and a prefix it learns later: not checked
                log("*** " & __SCOPE__ & ": INFO: data call connected (IPv6), UE address ", v_address, " ***");
                return true;
            }
            if (v_address != v_expected) {
                log("*** " & __SCOPE__ & ": INCONC: the UE is connected with address '", v_address, "', expected ", v_expected, " ***");
                setverdict(inconc, "data call: UE address " & v_address & ", expected " & v_expected);
@@ -905,11 +912,7 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
                [] utPtcMtcPort.receive(car_UT_COMMON_CNF) -> value v_cnf {
                    t_ping.stop;
                }
                [not vc_ueContextReleased] N2_gNBaMF_P.receive(mw_ngap_initMsg({
                                                                                procedureCode := id_UEContextReleaseRequest,
                                                                                criticality   := ?,
                                                                                value_        := ?
                                                                               })) -> value vc_recvNGAP_PDU {
                [not vc_ueContextReleased] N2_gNBaMF_P.receive(mw_ngap_initMsg_anyProcedure(id_UEContextReleaseRequest)) -> value vc_recvNGAP_PDU {
                    log("*** " & __SCOPE__ & ": INFO: UE CONTEXT RELEASE REQUEST from the gNB during the ping: ", vc_recvNGAP_PDU, " ***");
                    if (not f_send_ue_context_release_command_await_ue_context_release_complete(m_cause_nas(normal_release))) {
                        log("*** " & __SCOPE__ & ": INFO: UE CONTEXT RELEASE COMPLETE does not conform ***");
@@ -1146,11 +1149,7 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
        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 {
            [] N2_gNBaMF_P.receive(mw_ngap_initMsg_anyProcedure(id_UplinkNASTransport)) -> value v_pdu {
                f_NGAPPDU_Get(v_pdu);
                f_NASPDU_Get(vc_recvNGAP_PDU);
                f_NGAP_gnb_report_ue_nas_message();
+1 −7
Changes for ttcn/AtsNGAP/NGAP_TCFunctions.ttcn: 1 added line, 7 removed lines.
Original line number Diff line number Diff line
@@ -148,13 +148,7 @@ module NGAP_TCFunctions {
                // criticality "ignore" for its IEs, which mw_n2_PDUSessionResourceSetupResponse does not
                // match. The PDU session must be in the list of the sessions set up, not of those failed
                f_recv_NGAP_PDU(
                                mw_ngap_succMsg(
                                                {
                                                    procedureCode := id_PDUSessionResourceSetup,
                                                    criticality   := ?,
                                                    value_        := ?
                                                }
                                ));
                                mw_ngap_succMsg_anyProcedure(id_PDUSessionResourceSetup));
                {
                    // The response must be for this UE, use the TS 38.413 criticalities, set up the requested PDU
                    // session (any optional IE accepted), and report no PDU session as failed
+17 −0
Changes for ttcn/LibNGAP/lib/LibNGAP_Pixits.ttcn: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -739,6 +739,23 @@ module LibNGAP_Pixits {
    /** @desc IPv4 address of the DNS server given to the real UE in the PDU SESSION ESTABLISHMENT ACCEPT; see f_encode_dl_nas_transport_pdu_session_establishment_accept */
    modulepar Oct4 PX_UT_DNS_IPV4 := '08080808'O; // 8.8.8.8

    /** @desc PDU session type of the data call of the real UE: "IPV4", "IPV6" or "IPV4V6". It is the type the upper tester
     *        dials (IPTYPE) and the type selected in the PDU SESSION ESTABLISHMENT ACCEPT and the PDU SESSION RESOURCE SETUP
     *        REQUEST TRANSFER; see f_encode_dl_nas_transport_pdu_session_establishment_accept */
    modulepar charstring PX_UT_PDU_SESSION_TYPE := "IPV4";

    /** @desc IPv6 interface identifier assigned to the real UE (PDU session type IPV6 or IPV4V6, TS 24.501 clause 9.11.4.10) */
    modulepar octetstring PX_UT_PDU_ADDRESS_IPV6_IID := '0000000000000002'O;

    /** @desc SSC mode selected in the PDU SESSION ESTABLISHMENT ACCEPT (1..3) */
    modulepar integer PX_UT_SSC_MODE := 1;

    /** @desc 5QI of the QoS flow of the PDU session of the real UE (non-dynamic, e.g. 9 for the default non-GBR flow) */
    modulepar integer PX_UT_5QI := 9;

    /** @desc Session AMBR of the PDU session of the real UE, in Mbps, the same downlink and uplink (1..65535) */
    modulepar integer PX_UT_SESSION_AMBR_MBPS := 1000;

    /** @desc Time, in seconds, the upper tester waits for the real UE to be attached before it dials the data call; it must cover the registration procedure */
    modulepar float      PX_UT_DATA_CALL_ATTACH_TIMEOUT := 60.0;

+46 −0
Changes for ttcn/LibNGAP/lib/LibNGAP_Templates.ttcn: 46 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -97,6 +97,52 @@ module LibNGAP_Templates {
                    unsuccessfulOutcome := p_msg
                } // End of template mw_ngap_unsuccMsg
                /**
                 * @desc  Any initiating message of the given elementary procedure, whatever its criticality and IEs.
                 *        For messages from a real NG-RAN node or AMF, which may use other criticalities than the
                 *        strict mw_n2_* templates and add optional IEs: receive with this template, then check the
                 *        content (f_NGAP_check_received_PDU), so that a non-matching message is reported instead of
                 *        being discarded by a_defaultNGAP.
                 * @param p_procedureCode The procedure code (e.g. id_InitialUEMessage)
                 */
                template (present) NGAP_PDU mw_ngap_initMsg_anyProcedure(
                                                                         template (present) ProcedureCode p_procedureCode
                                                                         ) := {
                    initiatingMessage := {
                        procedureCode := p_procedureCode,
                        criticality   := ?,
                        value_        := ?
                    }
                } // End of template mw_ngap_initMsg_anyProcedure
                /**
                 * @desc  Any successful outcome of the given elementary procedure; see mw_ngap_initMsg_anyProcedure
                 * @param p_procedureCode The procedure code (e.g. id_PDUSessionResourceSetup)
                 */
                template (present) NGAP_PDU mw_ngap_succMsg_anyProcedure(
                                                                         template (present) ProcedureCode p_procedureCode
                                                                         ) := {
                    successfulOutcome := {
                        procedureCode := p_procedureCode,
                        criticality   := ?,
                        value_        := ?
                    }
                } // End of template mw_ngap_succMsg_anyProcedure
                /**
                 * @desc  Any unsuccessful outcome of the given elementary procedure; see mw_ngap_initMsg_anyProcedure
                 * @param p_procedureCode The procedure code
                 */
                template (present) NGAP_PDU mw_ngap_unsuccMsg_anyProcedure(
                                                                           template (present) ProcedureCode p_procedureCode
                                                                           ) := {
                    unsuccessfulOutcome := {
                        procedureCode := p_procedureCode,
                        criticality   := ?,
                        value_        := ?
                    }
                } // End of template mw_ngap_unsuccMsg_anyProcedure
            } // End of group Receive
        } // End of group  g_NGAP_PDU
Loading