AtsMec_WlanInformationAPI_TestCases.ttcn 110 KB
Newer Older
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_204_no_content
                                               )) {
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with the new measurement config ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_016_OK

    /**
     * @desc Check that the IUT responds with an error when an invalid request is sent
     * @see https://forge.etsi.org/rep/mec/gs028-wai-api/blob/master/WlanInformationApi.json
     * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC028/SRV/WAI/Measurement.tplan2
     */
    testcase TC_MEC_MEC028_SRV_WAI_016_NF() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var Headers v_headers;
        var MeasurementConfig v_measurement_config;
        
        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Test adapter configuration
        
        // Preamble
        f_create_measurement_config(v_measurement_config);
        f_init_default_headers_list(-, -, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_delete(
                                                           PICS_ROOT_API & PX_ME_WLAN_URI & "/measurements" & v_measurement_config.links.self_.href & "_invalid",
                                                           v_headers
                                                           )));
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);

        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_404_not_found
                                               )) {
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_delete_measurement_config(v_measurement_config);
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_016_NF

  } // End of group me_app_role

YannGarcia's avatar
YannGarcia committed
} // End of module AtsMec_WlanInformationAPI_TestCases