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

Ehance the upper tester

parent 08d942d8
Loading
Loading
Loading
Loading
+6 −3
Changes for etc/AtsNGAP/AtsNGAP_GNB_ueransim.cfg_: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -12,8 +12,11 @@ NGAP_Pics.PICS_NGAP_AMF_IUT := false
NGAP_Pics.PICS_NGAP_GNB_IUT    := true

LibNGAP_Pics.PICS_OFFLINE_MODE    := false # true for offline mode with pcap files, false for online mode with SCTP server
LibNGAP_Pics.PICS_USE_UERANSIMU   := true # true to start UERANSIM gNB and UE simulators, false to not start them
LibNGAP_Pics.PICS_USE_AT_COMMANDS := false # true to use AT commands to control the UE, false to not use them
LibNGAP_Pics.PICS_USE_UERANSIMU   := false # true to start UERANSIM gNB and UE simulators, false to not start them
LibNGAP_Pics.PICS_USE_AT_COMMANDS := true # true to use AT commands to control the UE, false to not use them

LibNGAP_Pics.PICS_NO_RAN_NODE_NAME                                := true # true to not use RAN node name, false to use it
LibNGAP_Pics.PICS_REGISTRATION_REQUEST_WITH_NO_UE_CONTEXT_REQUEST := true # true to send RegistrationRequest with no UE Context Request IE, false to send it with UE Context Request IE

LibNGAP_Pixits.PX_NAS_MCC          := '999'H
LibNGAP_Pixits.PX_NAS_MNC          := '70'H
@@ -93,7 +96,7 @@ system.NGAP_gNB_1.params := "NGAP/SCTP(local_server=127.0.0.5,server_mode=1,loca
#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=12000,debug=1)"
system.utPort.params := "UT/TCP(server=localhost,port=12100,debug=1)"

[DEFINE]
# In this section you can create macro definitions,
+44 −0
Changes for ttcn/AtsNGAP/NGAP_DebugAuthFail.ttcn: 44 added lines, 0 removed lines.
Original line number Diff line number Diff line
/**
 * @desc  Scratch test: does the AUTHENTICATION FAILURE (Synch failure) message captured from
 *        the real UE actually decmatch against mw_NG_AUTHENTICATION_FAILURE?
 *        Not an ETSI test case -- temporary, to be removed after the investigation.
 */
module NGAP_DebugAuthFail {

    import from NG_NAS_MsgContainers all;
    import from Lib_NG_NAS_Templates all;

    type component DebugComponent {
    }

    testcase TC_DEBUG_AUTH_FAIL() runs on DebugComponent {
        var octetstring v_raw := '7E005915300E3EF145BE1BC198E63ECB06BE2A1C'O;
        var bitstring v_bits := oct2bit(v_raw);
        var NG_NAS_UL_Message_Type v_decoded;

        var integer v_result := decvalue(v_bits, v_decoded);
        log("decvalue result: ", v_result);
        log("decoded value: ", v_decoded);

        if (v_result != 0) {
            log("*** decvalue FAILED, result=", v_result);
            setverdict(fail);
        } else {
            if (match(v_decoded, mw_NG_AUTHENTICATION_FAILURE(mw_GMM_GSM_Cause(-, int2bit(21, 8))))) {
                log(">>> match() against mw_NG_AUTHENTICATION_FAILURE(..., 21): PASS");
                setverdict(pass);
            } else {
                log(">>> match() against mw_NG_AUTHENTICATION_FAILURE(..., 21): FAIL");
                setverdict(fail);
            }

            // Also try a direct decmatch on the octetstring, exactly like the alt() in
            // f_send_authentication_request_await_authentication_response does.
            if (match(v_raw, decmatch(mw_NG_AUTHENTICATION_FAILURE(mw_GMM_GSM_Cause(-, int2bit(21, 8)))))) {
                log(">>> match() with decmatch(): PASS");
            } else {
                log(">>> match() with decmatch(): FAIL");
            }
        }
    }
}
+14 −2
Changes for ttcn/AtsNGAP/NGAP_Steps.ttcn: 14 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
    // UpperTester
    import from UpperTesterFunctions all;

    // Lib_NG_NAS
    import from Lib_NG_NAS_Security_Functions all;

    // AtsNGAP
    import from NGAP_TestSystem all;
    import from NGAP_Pixits all;
@@ -588,8 +591,17 @@ module NGAP_Steps { // TODO FSCOM f_xxx_UE_SecurityMode to be mmoved into NAG_NG
            } else if (PICS_USE_AT_COMMANDS) {
                // Trigger the real UE (modem) into registering on the network by having it place an IMS
                // call: the modem attaches/registers as a side effect of the call setup, which is what
                // f_await_registration_request below is waiting for. Fire-and-forget (NO_CNF_REQUIRED):
                // the call result itself is not checked here, only the resulting NAS signalling is.
                // f_await_registration_request below is waiting for. The call result itself is not
                // checked (NO_CNF_REQUIRED, the default of f_UT_RequestIMSCall), only the resulting NAS
                // signalling is -- but the modem restart and the PLMN selection ahead of it are waited on
                // (CNF_REQUIRED), so the IMS call is only placed once the modem is actually camped on the
                // intended PLMN.
                log("f_NGAP_gnb_UE_Register: Restarting the modem");
                f_UT_RestartModem(utPtcMtcPort);

                log("f_NGAP_gnb_UE_Register: Selecting PLMN manually: MCC=", PX_UT_PLMN_MCC, ", MNC=", PX_UT_PLMN_MNC);
                f_UT_ManualPLMN_Select(utPtcMtcPort, fl_NasNN_MCC2PlmnId(PX_UT_PLMN_MCC, PX_UT_PLMN_MNC), tsc_ManualPLMN_None, CNF_REQUIRED);

                log("f_NGAP_gnb_UE_Register: Requesting an IMS call to ", PX_UT_IMS_CALLEE_URI, " to trigger UE registration");
                f_UT_RequestIMSCall(utPtcMtcPort, PX_UT_IMS_CALLEE_URI);
            }
+11 −4
Changes for ttcn/AtsNGAP/NGAP_TestConfiguration.ttcn: 11 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -28,14 +28,21 @@ module NGAP_TestConfiguration {
    group cfUp {

        /**
         * @desc Connects the MTC to the upper tester and to a PTC (only when AT commands are used)
         * @desc Connects a PTC to the upper tester (only when AT commands are used).
         *       The dispatcher runs on its own dedicated component, not the MTC: the MTC is
         *       blocked inside LibCommon_Sync for most of a test case, and that shared sync
         *       function's own catch-all "any port" receive would silently swallow every
         *       UT_COMMON_CMD before a default altstep on the MTC ever got a chance to see it.
         *       A plain NGNASComponent has no synchronisation port/behaviour of its own, so it is
         *       never subject to that conflict.
         * @param p_ptc The PTC
         */
        function f_cf_Ut_Up(in NGNASComponent p_ptc) runs on NGNASComponent system TestAdapter {
            if (PICS_USE_AT_COMMANDS) {
                map(self:utPort, system:utPort);
                connect(self:utMtcPtcPort, p_ptc:utPtcMtcPort);
                activate(as_UT_Dispatcher());
                var NGNASComponent v_utDispatcher := NGNASComponent.create;
                map(v_utDispatcher:utPort, system:utPort);
                connect(v_utDispatcher:utMtcPtcPort, p_ptc:utPtcMtcPort);
                v_utDispatcher.start(f_UtDispatcherMain());
            }
        }

+17 −3
Changes for ttcn/AtsNGAP/NGAP_UtDispatcher.ttcn: 17 added lines, 3 removed lines.
Original line number Diff line number Diff line
/**
 * @desc  MTC-side Upper Tester dispatcher: forwards the requests received from the PTCs (utMtcPtcPort)
 *        to the upper tester (utPort, system side) and returns the confirmation to the PTC.
 * @desc  Upper Tester dispatcher: forwards the requests received from a PTC (utMtcPtcPort) to the
 *        upper tester (utPort, system side) and returns the confirmation to the PTC.
 *        Runs on its own dedicated component (see f_cf_Ut_Up / f_UtDispatcherMain), never on the
 *        MTC: the MTC spends most of a test case blocked inside LibCommon_Sync's
 *        f_serverSyncClientsTimedIntermediateSync, whose "[] any port.receive { repeat; }" branch
 *        has priority over any default altstep and would otherwise silently discard every
 *        UT_COMMON_CMD before a default altstep such as as_UT_Dispatcher ever saw it.
 */
module NGAP_UtDispatcher {

@@ -13,7 +18,16 @@ module NGAP_UtDispatcher {
    modulepar float PX_UT_CNF_TIMEOUT := 200.0;

    /**
     * @desc  Default altstep of the MTC: handle one PTC request at a time
     * @desc  Main behaviour of the dedicated Upper Tester dispatcher component started by
     *        f_cf_Ut_Up: handles PTC requests, one at a time, for as long as the component lives.
     *        Deliberately not activated as a default altstep on the MTC (see module @desc above).
     */
    function f_UtDispatcherMain() runs on NGNASComponent {
        as_UT_Dispatcher();
    }

    /**
     * @desc  Handle one PTC request, and go back to waiting for the next one.
     */
    altstep as_UT_Dispatcher() runs on NGNASComponent {
        var UT_COMMON_CMD v_cmd;
Loading