/* * @author STF 370 * @version $Id $ * @desc This module contains functions which implement the * configuration of the SUT adapter and mapping of test * components for establishing and tearing down different * test configurations. */ module AtsImsIot_TestConfiguration { import from LibIot_PIXITS {modulepar PX_EUT_A, PX_EUT_B, PX_PRODUCTS;} import from LibIot_Functions { function f_setConformanceVerdict, f_setE2EVerdict; } import from AtsImsIot_Templates {template m_SetFilterReq, mw_SetFilterRsp;} import from LibCommon_VerdictControl {type FncRetCode;} import from LibIot_TypesAndValues { type InterfaceInfo, InterfaceInfoList, Product, ProtocolFilter, SetFilterReq, SetFilterRsp, Status; } import from LibIot_TestConfiguration { function f_cf_oracle_up, f_cf_oracle_down; } import from AtsImsIot_TestSystem { type ImsInterfaceMonitor, ImsTestCoordinator; } import from LibIot_TestInterface {type IotEquipmentUser;} group constantDefinitions { //* interface monitor name Gm A const charstring c_gm_A := "Gm A"; //* interface monitor name Gm B const charstring c_gm_B := "Gm B"; //* interface monitor name Mw const charstring c_mw := "Mw"; //* interface monitor name Isc A const charstring c_isc_A := "Isc A"; //* interface monitor name Isc B const charstring c_isc_B := "Isc B"; //* eut trigger name User A const charstring c_trigger_A := "User A"; //* eut trigger name User B const charstring c_trigger_B := "User B"; //* eut trigger name User A const charstring c_userUE_A := "User A"; //* eut trigger name User B const charstring c_userUE_B := "User B"; const charstring c_userUE_B2 := "User B2"; } group mappingFunctions { /** * * @desc initialize the adapter port of MTC */ function f_cf_adapter_up() runs on ImsTestCoordinator { map(self:acPort, system:acPort); } /** * * @desc uninitialize the adapter port of MTC */ function f_cf_adapter_down() runs on ImsTestCoordinator { unmap(self:acPort, system:acPort); } /** * * @desc initialize trigger component ports * @param p_driver trigger component */ function f_cf_user_up(in IotEquipmentUser p_driver) runs on ImsTestCoordinator { // connect sync ports connect(p_driver:syncPort, self:syncPort); // connect TSI ports map(p_driver:eaPort, system:eaPort); // configure oracle f_cf_oracle_up(p_driver); } /** * * @desc uninitialize trigger component ports * @param p_driver trigger component */ function f_cf_user_down(in IotEquipmentUser p_driver) runs on ImsTestCoordinator { // disconnect sync ports disconnect(p_driver:syncPort, self:syncPort); // disconnect TSI ports unmap(p_driver:eaPort, system:eaPort); // release oracle ports f_cf_oracle_down(p_driver); } /** * @desc configures monitor component: connects to the synchronnization * port, maps to the TSI port and connects to the oracle * @param p_monitor monitor component */ function f_cf_monitor_up(in ImsInterfaceMonitor p_monitor) runs on ImsTestCoordinator { // connect sync ports connect(p_monitor:syncPort, self:syncPort); connect(p_monitor:icpPort, self:icpPort); // mapp TSI port map(p_monitor:dPort, system:dPort); map(p_monitor:acPort, system:acPort); // configure oracle f_cf_oracle_up(p_monitor); } /** * @desc frees monitor component: disconnects the synchronnization * port, unmaps from the TSI port and disconnects from the oracle * @param p_monitor monitor component */ function f_cf_monitor_down(in ImsInterfaceMonitor p_monitor) runs on ImsTestCoordinator { // connect sync ports disconnect(p_monitor:syncPort, self:syncPort); disconnect(p_monitor:icpPort, self:icpPort); // mapp TSI port unmap(p_monitor:dPort, system:dPort); unmap(p_monitor:acPort, system:acPort); // configure oracle f_cf_oracle_down(p_monitor); } } group adapterConfiguration { function f_cf_setFilter(in SetFilterReq p_req) runs on ImsInterfaceMonitor { var SetFilterRsp v_rsp; var template Status v_status := { code := e_success, reason := * } tc_wait.start; acPort.send(p_req); alt { [] acPort.receive (mw_SetFilterRsp(v_status)) -> value v_rsp { tc_wait.stop; f_setE2EVerdict(pass, "Adapter Configuration: setting monitor filter successful"); f_setConformanceVerdict(pass, "Adapter Configuration: setting monitor filter successful"); } [] acPort.receive (mw_SetFilterRsp(?)) -> value v_rsp { tc_wait.stop; f_setE2EVerdict(inconc, "Adapter Configuration: error while setting monitor filter"); f_setConformanceVerdict(inconc, "Adapter Configuration: error while setting monitor filter"); } [] tc_wait.timeout { f_setE2EVerdict(inconc, "Adapter Configuration: timer expires while waiting for response"); f_setConformanceVerdict(inconc, "Adapter Configuration: timer expires while waiting for response"); } } } } group componentCreation { /** * @desc creates a monitor component * @param p_name name of the monitor component * @return the created monitor component */ function f_cf_create_monitor(in charstring p_name) runs on ImsTestCoordinator return ImsInterfaceMonitor { var ImsInterfaceMonitor v_monitor := ImsInterfaceMonitor.create(p_name) alive; return v_monitor; } } group testConfiguration { /** * @desc * Test configuration function for roaming registration szenario. * More information can be found in ETSI TS 186 011-2 V2.3.1 Cause * 4.3.4. * @param p_Gm Gm interface monitor component * @param p_Mw Mw interface monitor component */ function f_cf_roam_reg( inout ImsInterfaceMonitor p_Gm, inout ImsInterfaceMonitor p_Mw ) runs on ImsTestCoordinator { p_Gm := f_cf_create_monitor(c_gm_A); p_Mw := f_cf_create_monitor(c_mw); f_cf_monitor_up(p_Gm); f_cf_monitor_up(p_Mw); // TODO UE IP address and port is missing p_Gm.start(f_cf_setFilter( valueof (m_SetFilterReq( e_sip, f_getInterfaceInfoList("Gm", PX_EUT_A, PX_EUT_B) ) ))); p_Gm.done; p_Mw.start(f_cf_setFilter( valueof(m_SetFilterReq( e_sip, f_getInterfaceInfoList("Mw", PX_EUT_A, PX_EUT_B) ) ))); p_Mw.done; } function f_cf_int_call( inout ImsInterfaceMonitor p_GmA, inout ImsInterfaceMonitor p_Mw, inout ImsInterfaceMonitor p_GmB, in boolean p_useGmB ) runs on ImsTestCoordinator { p_GmA := f_cf_create_monitor(c_gm_A); p_Mw := f_cf_create_monitor(c_mw); if(p_useGmB) { p_GmB := f_cf_create_monitor(c_gm_B); f_cf_monitor_up(valueof(p_GmB)); } f_cf_monitor_up(p_GmA); f_cf_monitor_up(p_Mw); // TODO UE IP address and port is missing p_GmA.start(f_cf_setFilter( valueof (m_SetFilterReq( e_sip, {f_getInterfaceInfo("Gm", PX_PRODUCTS[PX_EUT_A])} ) ))); p_GmA.done; p_Mw.start(f_cf_setFilter( valueof(m_SetFilterReq( e_sip, f_getInterfaceInfoList("Mw", PX_EUT_A, PX_EUT_B) ) ))); p_Mw.done; if(p_useGmB) { p_GmB.start(f_cf_setFilter( valueof (m_SetFilterReq( e_sip, {f_getInterfaceInfo("Gm", PX_PRODUCTS[PX_EUT_B])} ) ))); p_GmB.done; } } } function f_getInterfaceInfoList( in charstring p_interfaceName, in integer p_product1, in integer p_product2 ) return InterfaceInfoList { var InterfaceInfoList v_list := { f_getInterfaceInfo(p_interfaceName, PX_PRODUCTS[p_product1]), f_getInterfaceInfo(p_interfaceName, PX_PRODUCTS[p_product2]) }; return v_list; } function f_getInterfaceInfo(in charstring p_interfaceName, Product p_product) return InterfaceInfo { var InterfaceInfo v_info := { IpInterfaceInfo := { { domainName := "invalid", IpAddress := "0.0.0.0", portNumbers := {0} } } }; for(var integer i := 0; i <= lengthof(p_product.monitorInterfaces); i := i + 1) { if(p_product.monitorInterfaces[i].interfaceName == p_interfaceName) { return p_product.monitorInterfaces[i].interfaceInfo; } } return v_info; } }