Skip to content
AtsImsIot_TestConfiguration.ttcn 58.6 KiB
Newer Older
Bostjan Pintar's avatar
Bostjan Pintar committed
/*
 *	@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 LibCommon_VerdictControl { type FncRetCode; }
    /*language "TTCN-3:2008 Amendment 1" - FSCOM/YGA*/
	import from LibIms_UpperTester  { modulepar PX_IMS_USER_DATA; }
	import from LibIot_PIXITS { modulepar PX_EUT_A, PX_EUT_B, PX_PRODUCTS, PX_MAX_MSG_WAIT; }
	import from LibIot_TypesAndValues {
		type	StartTrafficCaptureRsp, StopTrafficCaptureRsp, MonitorInterfaceInfo, InterfaceInfo, InterfaceInfoList, Product,
				ProtocolFilter, StartTrafficCaptureRsp, StopTrafficCaptureRsp, SetFilterReq, SetFilterRsp, Status; }
    /*language "TTCN-3:2008 Amendment 1" - FSCOM/YGA*/
    import from LibIot_Functions  { altstep a_receiveIOTVerdict; function f_setConformanceVerdict, f_setE2EVerdict; }
	import from LibIot_TestConfiguration { function f_cf_oracle_up, f_cf_oracle_down; }
	import from LibIot_TestInterface {type IotEquipmentUser;}
	import from AtsImsIot_TestSystem {type ImsInterfaceMonitor, SipInterfaceMonitor, DiameterInterfaceMonitor, NaptrInterfaceMonitor, SgiInterfaceMonitor, ImsTestCoordinator, CF_INT_CALL, CF_INT_AS, CF_ROAM_AS, CF_EPC_CALL, CF_ATT, CF_ATT_old;}
	import from LibIot_TestInterface {type InterfaceMonitor;}
	import from AtsImsIot_Templates {
		template	m_generalConfigurationReq_offline, m_generalConfigurationReq_online, m_generalConfigurationReq_merge,
					m_generalConfigurationRsp_success, m_generalConfigurationRsp_error, m_generalConfigurationRsp_timeout,
					m_SetFilterReq, mw_SetFilterRsp, m_startTrafficCaptureReq, m_stopTrafficCaptureReq,
					m_startTrafficCaptureRsp_any, m_stopTrafficCaptureRsp_any; }
	import from AtsImsIot_Functions {function f_setInterfaceNameOnComponent, f_setInterfaceInfoComponent;}
	
	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 Mx A
        const charstring c_mx_A := "Mx A";
        //* interface monitor name Mx B
        const charstring c_mx_B := "Mx B";
		//* interface monitor name Ic
		const charstring c_ic := "Ici";
		//* interface monitor name Isc A
		const charstring c_isc_A := "Isc A";
		//* interface monitor name Isc B
		const charstring c_isc_B := "Isc B";
		//* interface monitor name NAPTR
		const charstring c_naptr := "NAPTR";
		//* 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";
  		const charstring c_userUE_A2 := "User A2";
		//* eut trigger name User B
		const charstring c_userUE_B := "User B";
		const charstring c_userUE_B2 := "User B2";
        //* eut trigger name User C
        const charstring c_userUE_C := "User C";
		//* interface monitor name Gm C
		const charstring c_gm_C := "Gm C";
        //* eut trigger name User D
        const charstring c_userUE_D := "User D";
		//* interface monitor name Gm D
		const charstring c_gm_D := "Gm D";
        //* interface monitor name Rx
        const charstring c_rx := "Rx"; // See ETSI TS 103 029 V3.1.1 clause 5.4.2
        //* interface monitor name Mw
        const charstring c_mw := "Mw";
        //* interface monitor name Mx
        const charstring c_mx := "Mx";
		//* interface monitor name Sgi
		const charstring c_sgi := "Sgi";
		//* interface monitor name Rx
		const charstring c_s6a := "S6a";
		//* interface monitor name Rx
		const charstring c_gx := "Gx";
	}
	
	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 	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_sip(in SipInterfaceMonitor 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:sipPort, system:sipPort);
				map(p_monitor:acPort, system:acPort);
				// configure oracle
				f_cf_oracle_up(p_monitor);
			}
			/**
			* @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_diameter(in DiameterInterfaceMonitor 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:diameterPort, system:diameterPort);
				map(p_monitor:acPort, system:acPort);
				// configure oracle
				f_cf_oracle_up(p_monitor);
			}
			/**
			* @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_naptr(in NaptrInterfaceMonitor 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:naptrPort, system:naptrPort);
				map(p_monitor:acPort, system:acPort);
				// configure oracle
				f_cf_oracle_up(p_monitor);
			}
			/**
			* @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_sgi(in SgiInterfaceMonitor 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:sgiPort, system:sgiPort);
				map(p_monitor:acPort, system:acPort);
				// configure oracle
				f_cf_oracle_up(p_monitor);
Loading full blame...