AtsMec_LocationAPI_TestCases.ttcn 54.7 KB
Newer Older
        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Test adapter configuration
        
        // Preamble
        f_init_default_headers_list(-, -, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_delete(
                                                           "/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
                                                           v_headers,
                                                           m_http_message_body_json(
                                                                                    m_body_json_zonal_traffic_subscription(
                                                                                                                           m_zonal_traffic_subscription(
                                                                                                                                                        PX_CLIENT_ID,
                                                                                                                                                        PX_CALLBACK_REF_URL,
                                                                                                                                                        PX_ZONE_ID
                                                                                                                                                        )
                                                                                                                           )
                                                                                  )
                                                         )
                                      )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_204_no_content
                                               )) {
YannGarcia's avatar
YannGarcia committed
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content ***");
            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_SRV_UEINFSUB_002_OK
    
    /**
     * @desc Check that the IUT acknowledges the cancellation of UE information change notifications  when commanded by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEINFSUB/PlatUeInformationSubscription.tplan2
     */
    testcase TC_MEC_SRV_UEINFSUB_002_NF() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Test adapter configuration
        
        // Preamble
        f_init_default_headers_list(-, -, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_delete(
                                                           "/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI & "/" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")),
                                                           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
                                             )) {
YannGarcia's avatar
YannGarcia committed
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds 404 Not Found ***");
            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_SRV_UEINFSUB_002_NF
    
  } // End of group ueInfSub
  
  group ueDistSub {
    
  } // End of group ueDistSub
  
Yann Garcia's avatar
Yann Garcia committed
} // End of module AtsMec_LocationAPI_TestCases