Commit 61a1d038 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add pass in UT; Bug fixed in generate_png.sh script

parent 5e9014d9
Loading
Loading
Loading
Loading
+1 −1
Changes for ttcn/AtsNGAP/NGAP_TestConfiguration.ttcn: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ module NGAP_TestConfiguration {
                var NGNASComponent v_utDispatcher := NGNASComponent.create;
                map(v_utDispatcher:utPort, system:utPort);
                connect(v_utDispatcher:utMtcPtcPort, p_ptc:utPtcMtcPort);
                v_utDispatcher.start(f_UtDispatcherMain());
                v_utDispatcher.start(f_UtDispatcherMain(p_ptc));
            }
        }

+33 −8
Changes for ttcn/AtsNGAP/NGAP_UtDispatcher.ttcn: 33 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -18,27 +18,46 @@ module NGAP_UtDispatcher {
    modulepar float PX_UT_CNF_TIMEOUT := 200.0;

    /**
     * @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.
     * @brief  Main behaviour of the dedicated Upper Tester dispatcher component started by
     *         f_cf_Ut_Up.
     * @details Handles PTC requests, one at a time, until p_ptc terminates, then ends so the MTC
     *         does not wait tc_sync for it. Each confirmed UT command sets the verdict of this
     *         component (pass on success, inconc on failure or timeout), which contributes to
     *         the test case verdict.
     *         Deliberately not activated as a default altstep on the MTC (see module @desc above).
     * @param  p_ptc The test component served by this dispatcher.
     */
    function f_UtDispatcherMain() runs on NGNASComponent {
        as_UT_Dispatcher();
    function f_UtDispatcherMain(in NGNASComponent p_ptc) runs on NGNASComponent {
        alt {
            [] as_UT_Dispatcher(true);
            [] p_ptc.done {
                log("f_UtDispatcherMain: PTC done, stopping the UT dispatcher");
            }
        }
    }

    /**
     * @desc  Handle one PTC request, and go back to waiting for the next one.
     * @brief  Handle one PTC request, and go back to waiting for the next one.
     * @param  p_setVerdict When true, set the verdict from the UT confirmation
     *         (see f_UT_HandleRequest).
     */
    altstep as_UT_Dispatcher() runs on NGNASComponent {
    altstep as_UT_Dispatcher(in boolean p_setVerdict := false) runs on NGNASComponent {
        var UT_COMMON_CMD v_cmd;

        [] utMtcPtcPort.receive(car_UT_ReqAny) -> value v_cmd {
            f_UT_HandleRequest(v_cmd);
            f_UT_HandleRequest(v_cmd, p_setVerdict);
            repeat;
        }
    }

    function f_UT_HandleRequest(in UT_COMMON_CMD p_cmd) runs on NGNASComponent {
    /**
     * @brief  Forward one PTC request to the upper tester and return its confirmation, if any.
     * @param  p_cmd The PTC request.
     * @param  p_setVerdict When true, set the verdict: pass if the UT confirms success, inconc if
     *         it reports a failure, does not confirm in time or the request cannot be mapped.
     *         Requests without confirmation (NO_CNF_REQUIRED) leave the verdict unchanged.
     */
    function f_UT_HandleRequest(in UT_COMMON_CMD p_cmd, in boolean p_setVerdict := false) runs on NGNASComponent {
        var Ut_System_Cmd_Type v_sys;
        var UT_COMMON_CNF v_cnf;
        timer t_cnf := PX_UT_CNF_TIMEOUT;
@@ -46,6 +65,7 @@ module NGAP_UtDispatcher {

        if (not f_UT_MapCommand(p_cmd, v_sys)) {
            log("f_UT_HandleRequest: missing parameter for ", p_cmd.Cmd);
            if (p_setVerdict) { setverdict(inconc, "UT command not mapped: missing parameter"); }
            if (v_cnfExpected) {
                utMtcPtcPort.send(UT_COMMON_CNF: { Result := false, ResultString := "missing parameter" });
            }
@@ -60,10 +80,15 @@ module NGAP_UtDispatcher {
        alt {
            [] utPort.receive(car_UT_COMMON_CNF) -> value v_cnf {
                t_cnf.stop;
                if (p_setVerdict) {
                    if (v_cnf.Result) { setverdict(pass, "UT command succeeded"); }
                    else { setverdict(inconc, "UT command failed"); }
                }
                utMtcPtcPort.send(v_cnf);
            }
            [] t_cnf.timeout {
                log("f_UT_HandleRequest: no confirmation for ", p_cmd.Cmd);
                if (p_setVerdict) { setverdict(inconc, "UT command not confirmed in time"); }
                utMtcPtcPort.send(UT_COMMON_CNF: { Result := false, ResultString := "timeout" });
            }
        }