/** * @author STF 370 * @version $Id: $ * @desc This module provides common function for TestCoordinator component. */ module AtsImsIot_Functions { import from AtsImsIot_TestSystem {type ImsTestCoordinator;} import from LibIot_PIXITS {modulepar PX_MAX_MSG_WAIT, PX_PRODUCTS;} import from AtsImsIot_TypesAndValues {type SipMessage;} import from LibIms_UpperTester all; import from LibIot_TestInterface {type InterfaceMonitor, TestCoordinator, EquipmentUser;} import from LibIot_Functions {function f_getE2EVerdict;} group ue { /** * @desc * Starts user component behavior for triggering the registration * procedures at the UE from test coordinator. * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userTriggerRegistration(EquipmentUser p_userCompRef, ImsUserInfo p_userInfo) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO Investigate if f_PR_user_home_registration is to be removed // Reason: Thre is no difference when triggering UE to register in home or visiting NW if( p_userInfo.publicId == "dummy" ) { return false; } v_status := f_mtc_userRegister(p_userCompRef, p_userInfo.publicId, p_userInfo.privateId, p_userInfo.password); return v_status; } /** * @desc * Starts user component behavior for checking the successful * registration. * @param p_userCompRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userCheckRegistration(EquipmentUser p_userCompRef, ImsUserInfo p_userInfo) runs on TestCoordinator return boolean { var boolean v_status := true; if( p_userInfo.publicId == "dummy" ) { return false; } v_status := f_mtc_userCheckRegistrationSuccessful(p_userCompRef); return v_status; } /** * @desc Trigger UE given by p_ueRef to initiate an MO call * @param p_userCompRef Reference to IMS UE user component * @param p_calledParty ImsUserInfo of called party * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userTriggerInitiateCall(EquipmentUser p_ueRef, ImsUserInfo p_calledParty) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Trigger UE given by p_ueRef to initiate an MO call * @param p_userCompRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userTriggerAnswerCall(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Trigger UE given by p_ueRef to end current call * @param p_userCompRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_triggerEndCall(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Trigger UE given by p_ueRef to enter HOLD state * @param p_userCompRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userTriggerHold(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Trigger UE given by p_ueRef to leave HOLD state and resume pending call * @param p_userCompRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userTriggerResume(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE given by p_ueRef is ringing * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckRinging(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE given by p_ueRef reports a successfull call establishment * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallEstablished(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE by p_ueRef given reports that its peer is ringing * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckPeerIsRinging(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE by p_ueRef given reports HOLD state * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckUserOnHold(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE by p_ueRef given reports that call has been resumed * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallResumed(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE by p_ueRef given reports that call has ended * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallEnded(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Check that UE by p_ueRef given reports that call is no longer offered * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallNoLongerOffered(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Start capturing and monitoring traffic on all configured interfaces * @return true or false */ function f_mtc_StartAllTrafficCapture() runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /** * @desc Starts user component behaviour for registration from test coordinator * @param p_userCompRef Reference to IMS UE user component * @param p_publicId public user identity * @param p_privateId private user identity * @param p_pw user password * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userRegister(EquipmentUser p_userCompRef, charstring p_publicId, charstring p_privateId, charstring p_pw) runs on TestCoordinator return boolean { // TODO server address parameter may needed var boolean v_success := false; p_userCompRef.start(f_userRegistration(p_publicId, p_privateId, p_pw)); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } function f_mtc_userCheckRegistrationSuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserIsRegistered()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * @desc Starts user component behaviour for registration from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @param publicId public user identity * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userDeregister(EquipmentUser p_userCompRef, charstring p_publicId) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_userDeregistration(p_publicId)); p_userCompRef.done; if( f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * * @desc Starts user component behaviour for sending a message from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @param p_content Content of meessage to be sent */ function f_mtc_userSendMessage(EquipmentUser p_userCompRef, charstring p_content) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_userSendMessage(p_content)); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * * @desc Starts user component behaviour for checking message receipt from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @param p_content Content of meessage to be received */ function f_mtc_userCheckMessageReceipt(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_userCheckMessageReceipt()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * * @desc Starts user component behaviour for checking message receipt from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @param p_content Content of meessage to be received */ function f_mtc_userCheckMessageNotDelivered(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_userCheckMessageNotDelivered()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } function f_getAnyValidUser(integer p_productIdx) return ImsUserInfo { var integer v_size := sizeof(PX_IMS_USER_DATA); const ImsUserInfo c_dummyInfo := { "dummy", "dummy", "dummy", "dummy", "dummy" }; var ImsUserIdentity v_userid; for(var integer i := 0; i < v_size; i := i+1) { if(PX_IMS_USER_DATA[i].productIndex == p_productIdx) { var integer v_size_j := sizeof(PX_IMS_USER_DATA[i].userIds); for(var integer j := 0; j < v_size_j; j := j+1) { if ( ischosen(PX_IMS_USER_DATA[i].userIds[j].genUserId )) { return PX_IMS_USER_DATA[i].userIds[j].genUserId; } // end if } // end for j log("f_getAnyValidUser: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getAnyValidUser: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } function f_getTelUserId(integer p_productIdx) return ImsUserInfo { var integer v_size := sizeof(PX_IMS_USER_DATA); const ImsUserInfo c_dummyInfo := { "dummy", "dummy", "dummy", "dummy", "dummy" }; var ImsUserIdentity v_userid; for(var integer i := 0; i < v_size; i := i+1) { if(PX_IMS_USER_DATA[i].productIndex == p_productIdx) { var integer v_size_j := sizeof(PX_IMS_USER_DATA[i].userIds); for(var integer j := 0; j < v_size_j; j := j+1) { if ( ischosen(PX_IMS_USER_DATA[i].userIds[j].telUserId )) { return PX_IMS_USER_DATA[i].userIds[j].telUserId; } // end if } // end for j log("f_getTelUserId: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getTelUserId: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } function f_getSipUserId(integer p_productIdx) return ImsUserInfo { var integer v_size := sizeof(PX_IMS_USER_DATA); const ImsUserInfo c_dummyInfo := { "dummy", "dummy", "dummy", "dummy", "dummy" }; var ImsUserIdentity v_userid; for(var integer i := 0; i < v_size; i := i+1) { if(PX_IMS_USER_DATA[i].productIndex == p_productIdx) { var integer v_size_j := sizeof(PX_IMS_USER_DATA[i].userIds); for(var integer j := 0; j < v_size_j; j := j+1) { if ( ischosen(PX_IMS_USER_DATA[i].userIds[j].sipUserId )) { return PX_IMS_USER_DATA[i].userIds[j].sipUserId; } // end if } // end for j log("f_getSipUserId: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getSipUserId: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } function f_getHoldUser(integer p_productIdx) return ImsUserInfo { const ImsUserInfo c_dummyInfo := { "dummy", "dummy", "dummy", "dummy", "dummy" }; // TODO return c_dummyInfo; } function f_getHostname(integer p_productIdx, charstring p_entity, out charstring p_hostname) return boolean { // TODO return true; } // TODO function f_getUEHostname(integer p_ID, out charstring p_hostname) return boolean { // TODO return true; } /** * @desc * Preamble to handle user registration in home network from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @return true in case of successfull execution otherwise false */ function f_PR_user_home_registration(EquipmentUser p_userCompRef, ImsUserInfo p_userInfo) runs on TestCoordinator return boolean { var boolean v_status := true; if( p_userInfo.publicId == "" ) { return false; } v_status := f_mtc_userRegister(p_userCompRef, p_userInfo.publicId, p_userInfo.privateId, p_userInfo.password); return v_status; } /** * @desc * Postamble to handle user deregistration in home network from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @return true in case of successfull execution otherwise false */ function f_PO_user_home_deregistration(EquipmentUser p_userCompRef) runs on ImsTestCoordinator return boolean { var boolean v_status := true; v_status := f_mtc_userDeregister(p_userCompRef, "*"); // deregister all previous users return v_status; } /** * @desc * Preamble to handle user registration in roaming network from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @return true in case of successfull execution otherwise false */ function f_PR_user_roaming_registration(EquipmentUser p_userCompRef, ImsUserInfo p_userInfo) runs on TestCoordinator return boolean { var boolean v_status := true; if( p_userInfo.publicId == "" ) { return false; } // TODO check roaming registration v_status := f_mtc_userRegister(p_userCompRef, p_userInfo.publicId, p_userInfo.privateId, p_userInfo.password); return v_status; } /** * @desc * Postamble to handle user deregistration in roaming network from test coordinator * @param p_userCompRef Reference ot IMS UE user component * @return true in case of successfull execution otherwise false */ function f_PO_user_roaming_deregistration(EquipmentUser p_userCompRef) runs on ImsTestCoordinator return boolean { var boolean v_status := true; // TODO check roaming de-registration v_status := f_mtc_userDeregister(p_userCompRef, "*"); // deregister all previous users return v_status; } /** * @desc Get the S-CSCF FQDN address of referenced EUT * @return if a S-CSCF is avaiable, the domainname of the S-CSCF, * otherwise error_string */ function f_GetEUTScscfAddress(integer p_ProductIdx) return charstring { // TODO function not tested var integer v_size_interfaces := sizeof(PX_PRODUCTS[p_ProductIdx].monitorInterfaces); var integer v_size_ipinterfaceinfo; var integer v_interface := -1; var integer v_ipinterfaceinfo := -1; var charstring v_domainname; for(var integer i := 0; i < v_size_interfaces; i := i+1) { if (PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName == "Mw"){ v_interface := i; } } if (v_interface > -1) { v_size_ipinterfaceinfo := sizeof(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo); for(var integer i := 0; i < v_size_ipinterfaceinfo; i := i+1) { v_domainname := PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName; if (match(substr(v_domainname, 0, 5), pattern "[Ss][Cc][Ss][Cc][Ff]")) { v_ipinterfaceinfo := i; } } } else { return "S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } if (v_ipinterfaceinfo > -1) { return PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[v_ipinterfaceinfo].domainName; } else { return "S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } /** * @desc Get the P-CSCF FQDN address of referenced EUT * @return if a PCSCF is avaiable, the domainname of the PCSCF, * otherwise error_string */ function f_GetEUTPcscfAddress(integer p_ProductIdx) return charstring { // TODO function not tested var integer v_size_interfaces := sizeof(PX_PRODUCTS[p_ProductIdx].monitorInterfaces); var integer v_size_ipinterfaceinfo; var integer v_interface := -1; var integer v_ipinterfaceinfo := -1; var charstring v_domainname; for(var integer i := 0; i < v_size_interfaces; i := i+1) { if (PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName == "Gm"){ v_interface := i; } } if (v_interface > -1) { v_size_ipinterfaceinfo := sizeof(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo); for(var integer i := 0; i < v_size_ipinterfaceinfo; i := i+1) { v_domainname := PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName; if (match(substr(v_domainname, 0, 5), pattern "[Pp][Cc][Ss][Cc][Ff]")) { v_ipinterfaceinfo := i; } } } else { return "P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } if (v_ipinterfaceinfo > -1) { return PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[v_ipinterfaceinfo].domainName; } else { return "P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } /** * @desc Get the Public Id of referenced UE * @param p_ProductIdx index of the product the UE belongs to * @return PublicID of the UE of the productIdx */ function f_GetUEPublicId(integer p_ProductIdx) return charstring { var ImsUserInfo v_uePublicId := f_getSipUserId(p_ProductIdx); return v_uePublicId.publicId; } /** * @desc Get the Public Id of referenced EUT */ function f_GetEUTPublicId(integer p_ProductIdx) return charstring { // TODO return "TODO"; } /** * @desc Get the AS server FQDN of referenced EUT */ function f_GetEUTASServerAddress(integer p_ProductIdx) return charstring { // TODO return "TODO"; } } group interComponent { /** * @desc * This function waits for a sip message send from a given monitor * component to mtc. * @param p_monitor Reference of Interface Monitor component * @param p_msg The Sip message */ function f_getSipMsgFromMonitor(InterfaceMonitor p_monitor, out SipMessage p_msg) runs on ImsTestCoordinator { timer t_local := PX_MAX_MSG_WAIT; t_local.start; alt { []icpPort.receive (SipMessage:?) from p_monitor -> value p_msg { t_local.stop; setverdict(pass, self, "***f_getMsgFromMonitor: SIP message received***"); } []t_local.timeout { setverdict(fail, self, "***f_getMsgFromMonitor: SIP message not received***"); } } } } }