/** * @author STF 370 * @version $Id: $ * @desc This module provides common function for TestCoordinator component. */ module AtsImsIot_Functions { import from AtsImsIot_Templates {template mw_SIP_URI_Base;} import from LibSip_SIPTypesAndValues all; import from AtsImsIot_TestSystem { type ImsTestCoordinator, ImsInterfaceMonitor; } import from LibIot_PIXITS {modulepar PX_MAX_MSG_WAIT, PX_PRODUCTS, PX_AVAILABLE_INTERFACES;} import from LibIot_Functions { function f_setConformanceVerdict; } import from AtsImsIot_TypesAndValues { type SipMessage, SipMessageList, SkipType; } import from LibIms_UpperTester all; import from LibIot_TestInterface { type InterfaceMonitor, TestCoordinator, EquipmentUser; } import from LibIot_Functions {function f_getE2EVerdict;} import from LibIot_TypesAndValues {type DefaultList;} 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_userRegistration(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 * Starts user component behavior for checking that UE * is not registerd. * @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_userCheckNoRegistration(EquipmentUser p_userCompRef, ImsUserInfo p_userInfo) runs on TestCoordinator return boolean { var boolean v_status := true; if( p_userInfo.publicId == "dummy" ) { return true; } v_status := f_mtc_userCheckRegistrationUnsuccessful(p_userCompRef); return v_status; } /** * @desc Trigger UE given by p_ueRef to initiate an MO call * @param p_ueRef 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_userInitiateCall(EquipmentUser p_ueRef, ImsUserInfo p_calledParty) runs on TestCoordinator return boolean { var boolean v_status := true; if( p_calledParty.publicId == "dummy" ) { return true; } v_status := f_mtc_userInitiateCallSuccessful(p_ueRef); return v_status; } /** * * @desc Starts user component behaviour for checking that the User * Call has been initiated * @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_userInitiateCallSuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserCallIsInitiated()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * @desc Answer call * @param p_ueRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_userAnswerCall(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; v_status := f_mtc_userAnswerCallSuccessful(p_ueRef); return v_status; } /** * * @desc Starts user component behaviour for checking that the User * Call has been answered * @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_userAnswerCallSuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserCallIsAnswered()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * @desc End the call * @param p_ueRef Reference to IMS UE user component * @return * true in case of successfull execution of the trigger command * otherwise false */ function f_mtc_EndCall(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; v_status := f_mtc_userEndCallSuccessful(p_ueRef); return v_status; } /** * * @desc Starts user component behaviour for checking that the User * Call has been ended * @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_userEndCallSuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserCallIsEnded()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * @desc Trigger UE given by p_ueRef to add a new media stream * @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_userAddNewMediaStream(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; v_status := f_mtc_userAddNewMediaStreamSuccessful(p_ueRef); return v_status; } /** * * @desc Starts user component behaviour for checking that * a new media stream has been added * @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_userAddNewMediaStreamSuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserAddNewMediaStream()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * @desc Trigger UE given by p_ueRef to remove a media stream * @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_userRemoveMediaStream(EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; v_status := f_mtc_userRemoveNewMediaStreamSuccessful(p_ueRef); return v_status; } /** * * @desc Starts user component behaviour for checking that * a new media stream has been added * @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_userRemoveNewMediaStreamSuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserRemoveNewMediaStream()); p_userCompRef.done; if(f_getE2EVerdict() == pass) { v_success := true; } return v_success; } /** * @desc Trigger UE given by p_ueRef to check the remove of a media stream * @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_userCheckRemoveMediaStream(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 add a new media stream * @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_userModifiyMediaStream(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 add a new media stream * @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_userCheckNewMediaStream(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 loose conectifity * @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_userLooseConnection(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 CANCEL 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_userTriggerCancelCall(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 given by p_ueRef reports a not successfull call establishment * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallCannotBeEstablished(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 terminated * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallTerminated(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 Check that UE by p_ueRef given reports that call has been cancelled * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallCancelled(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 rejected due to ACR * @param p_userCompRef Reference to IMS UE user component * @return true or false */ function f_mtc_userCheckCallRejectedACR(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 checking that the UE * is not registered * @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_userCheckRegistrationUnsuccessful(EquipmentUser p_userCompRef) runs on TestCoordinator return boolean { var boolean v_success := false; p_userCompRef.start(f_checkUserIsNotRegistered()); 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; } /** * @desc Trigger IMS Network to deregister UE given by p_ueRef * @param p_imsRef Reference to IMS network component * @param p_ueRef Reference to IMS UE user component * @return true or false */ function f_mtc_imsTriggerUeDeregistration(EquipmentUser p_imsRef, EquipmentUser p_ueRef) runs on TestCoordinator return boolean { var boolean v_status := true; // TODO return v_status; } /* * * @desc Looks for genUser (any) of a specific product * @param p_productIdx Index of the product * @return genUser */ 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; } /* * * @desc Looks for TelUser of a specific product * @param p_productIdx Index of the product * @return TelUser */ 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; } /* * * @desc Looks for SipUser of a specific product * @param p_productIdx Index of the product * @return SipUser */ 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; } /* * * @desc Looks for ARCUser for a specific product * @param p_productIdx Index of the product * @return ARCUser */ function f_getACRUser(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].acrUserId )) { return PX_IMS_USER_DATA[i].userIds[j].acrUserId; } // end if } // end for j log("f_getACRUser: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getACRUser: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } /* * * @desc Looks for OIPUser for a specific product * @param p_productIdx Index of the product * @return OIPUser */ function f_getOIPUser(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].oipUserId )) { return PX_IMS_USER_DATA[i].userIds[j].oipUserId; } // end if } // end for j log("f_getOIPUser: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getOIPUser: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } /* * * @desc Looks for OIRUser for a specific product * @param p_productIdx Index of the product * @return OIRUser */ function f_getOIRUser(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].oirUserId )) { return PX_IMS_USER_DATA[i].userIds[j].oirUserId; } // end if } // end for j log("f_getOIRUser: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getOIRUser: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } /* * * @desc Looks for HoldUser for a specific product * @param p_productIdx Index of the product * @return HoldUser */ function f_getHoldUser(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].holdUserId )) { return PX_IMS_USER_DATA[i].userIds[j].holdUserId; } // end if } // end for j log("f_getHoldUser: Did not find specified user id in specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // end if } // end for i log("f_getHoldUser: Did not find specified product in PX_IMS_USER_DATA"); return c_dummyInfo; } // 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 { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Mm][Ww]")){ v_interface := i; break; } } 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) { if(ispresent(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName)) { 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]") or match(substr(v_domainname, 0, 5), pattern "[Ss][Tt][Ee][Cc][Hh]")) { v_ipinterfaceinfo := i; break; } } } } else { log ("S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); 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 { log ("S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } /** * @desc Get the S-CSCF FQDN address of referenced EUT * @return if a S-CSCF is avaiable, the IP Address of the S-CSCF, * otherwise error_string */ function f_GetEUTScscfIpAddress(integer p_ProductIdx) return charstring { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Mm][Ww]")){ 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) { if(ispresent(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName)) { 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]") or match(substr(v_domainname, 0, 5), pattern "[Ss][Tt][Ee][Cc][Hh]")) { v_ipinterfaceinfo := i; } } } } else { log ("S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); 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].IpAddress; } else { log ("S-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); 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 { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Gg][Mm]")){ v_interface := i; break; } } 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) { if(ispresent(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName)) { 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]") or match(substr(v_domainname, 0, 5), pattern "[Pp][Tt][Ee][Cc][Hh]")) { v_ipinterfaceinfo := i; } } } } else { log ("P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); 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 { log ("P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } /** * @desc Get the P-CSCF IP address of referenced EUT * @return if a PCSCF is avaiable, the IP address of the PCSCF, * otherwise error_string */ function f_GetEUTPcscfIpAddress(integer p_ProductIdx) return charstring { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Gg][Mm]")){ v_interface := i; break; } } 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) { if(ispresent(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName)) { 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]") or match(substr(v_domainname, 0, 5), pattern "[Pp][Tt][Ee][Cc][Hh]")) { v_ipinterfaceinfo := i; } } } } else { log ("P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); 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].IpAddress; } else { log ("P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "P-CSCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } /** * @desc Get the IBCF FQDN address of referenced EUT * @return if a IBCF is avaiable, the domainname of the IBCF, * otherwise error_string */ function f_GetEUTIbcfAddress(integer p_ProductIdx) return charstring { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Mm][Ww]")){ 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) { if(ispresent(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName)) { v_domainname := PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[i].domainName; if (match(substr(v_domainname, 0, 5), pattern "[Ii][Bb][Cc][Ff]")) { v_ipinterfaceinfo := i; } } } } else { log ("IBCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "IBCF 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 { log ("IBCF of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "IBCF 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 UE URI containing the IP address of referenced EUT */ function f_getUeIpAddress(integer p_ProductIdx) return template SipUrl { // TODO return mw_SIP_URI_Base; } /** * @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 { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Ii][Ss][Cc]")){ 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, 2), pattern "[Aa][Ss]") or match(substr(v_domainname, 2, 2), pattern "[Aa][Ss]") or match(substr(v_domainname, 9, 2), pattern "[Aa][Ss]")) { v_ipinterfaceinfo := i; } } } else { log ("AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "AS 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 { log ("AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } } /** * @desc Get the AS server IP Address of referenced EUT */ function f_GetEUTASServerIpAddress(integer p_ProductIdx) return charstring { 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 (match(PX_PRODUCTS[p_ProductIdx].monitorInterfaces[i].interfaceName, pattern "[Ii][Ss][Cc]")){ 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, 2), pattern "[Aa][Ss]") or match(substr(v_domainname, 2, 2), pattern "[Aa][Ss]") or (lengthof(v_domainname) >= 11 and match(substr(v_domainname, 9, 2), pattern "[Aa][Ss]"))) { v_ipinterfaceinfo := i; } } } else { log ("AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } if (v_ipinterfaceinfo > -1) { return PX_PRODUCTS[p_ProductIdx].monitorInterfaces[v_interface].interfaceInfo.IpInterfaceInfo[v_ipinterfaceinfo].IpAddress; } else { log ("AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."); return "AS of " & PX_PRODUCTS[p_ProductIdx].productName & " not found."; } } 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***"); } } } } group altsteps { altstep a_default(in charstring p_TP) runs on ImsInterfaceMonitor { [] dPort.receive(Request:?) { log(self, "### a_default: Request default for " & p_TP ); repeat; } [] dPort.receive(Response:?) { log(self, "### a_default: Response default for " & p_TP ); repeat; } [] dPort.receive { log(self, "*** a_default: Received/ignored unexpected message when waiting for message complying to " & p_TP ); //setverdict(fail, self, "### YANN: If execution is here, this means that the message was not properly decoded due to sip/sdp-codets exception, check MMagic logs"); //stop; // YANN: If execution is here, this means that the message was not properly decoded repeat; } } /** * @desc This altstep add one alternative checking for a very specifc SIP request. If it matches then the conformance verdict is set to requested verdict * @param p_message The expected SIP request * @param p_verdict Verdict to be used in case of match * @param p_tpId The test purpose identifier * * @param p_forwardMtc indicates if the received request should be forwarded to mtc */ altstep a_receive_sipRequest( in template Request p_message, in verdicttype p_verdict, in charstring p_tpId, in boolean p_forwardMtc, in boolean p_checkMessage ) runs on ImsInterfaceMonitor { var Request v_message; [not p_checkMessage] dPort.receive(p_message) -> value v_message { f_setConformanceVerdict(p_verdict, "***a_receive_sipRequest: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***"); if(p_forwardMtc) { var SipMessage v_msg; v_msg.request := v_message; log("### Forwarding message to MTC"); icpPort.send(v_msg); } } [p_checkMessage] dPort.check(receive(p_message) -> value v_message) { f_setConformanceVerdict(p_verdict, "***a_receive_sipRequest: Checked expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***"); if(p_forwardMtc) { var SipMessage v_msg; v_msg.request := v_message; log("### Forwarding message to MTC"); icpPort.send(v_msg); } } } /** * @desc This altstep add one alternative checking for a very specifc SIP response. If it matches then the conformance verdict is set to requested verdict * @param p_message The expected SIP response * @param p_verdict Verdict to be used in case of match * @param p_tpId The test purpose identifier * @param p_forwardMtc indicates if the received reponse should be forwarded to mtc */ altstep a_receive_sipResponse( in template Response p_message, in verdicttype p_verdict, in charstring p_tpId, in boolean p_forwardMtc, in boolean p_checkMessage ) runs on ImsInterfaceMonitor { var Response v_message; [not p_checkMessage] dPort.receive(p_message) -> value v_message { f_setConformanceVerdict(p_verdict, "***a_receive_sipResponse: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***"); if(p_forwardMtc) { var SipMessage v_msg; v_msg.response := v_message; icpPort.send(v_msg); } } [p_checkMessage] dPort.check(receive(p_message) -> value v_message) { f_setConformanceVerdict(p_verdict, "***a_receive_sipResponse: Checked expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***"); if(p_forwardMtc) { var SipMessage v_msg; v_msg.response := v_message; icpPort.send(v_msg); } } } }// end group function f_setInterfaceNameOnComponent(charstring p_name) runs on ImsInterfaceMonitor{ vc_interfaceName := p_name; } group general_td_functions { /** * @desc * Generic function for reading and verifying messages on the * interface associated to the ImsInterfaceMonitor instance. This * functions works as follows: First, messages are skipped according * to the p_skip template. The p_skip template contains a message * template and a counter indicating the number of received messages * matching the message template to be skipped. If not enough * messages matching the message template arrive at the interface, * the function fails after timout. Next, messages are consumed from * the interface and matched against the p_passCriteria template * list and the p_failCriteria template list. The function * terminates with pass if a message is received matching a * pass-template and terminates with fail if a fail-template * matches. Matching against pass-templates occurs bevor matching * agains fail-templates. If neither pass-templates nor * fail-templates match, then the functions continues reading from * the interface until a match arises, or timeout. The timeout value * is given by PX_MAX_MSG_WAIT [5.0 seconds, FFS]. Finally, if * p_forwardMtc is set to true, the last received message is stored * to be fetched and used later by the main test component. Some * special use cases: - Set p_skip.skipCounter to 0 to avoid * skipping, i.e. no skippin - Set p_skip.skipCounter to 0 and * p_skip.skipMessage to ? to skip exactly one message of any type * will be skipped. - If the list of fail-templates is empty, then * the function will wait for the first message maching a * pass-message, or fail after timeout. * @param p_passCriteria list of message templates which lead to pass * @param p_failCriteria list of message templates which lead to fail * @param p_skip * Indicate how many messages from a specific sip template should be * skipped prior to checking * @param p_tpId The Test Purpose identifier * @param p_forwardMtc * indicate if the received Sip message should be forwarded to the * mtc * @param p_checkMessage * indicate if the incomming message should only be checked * (port.check) or consumed (port.receive). The check operation * allows read access to the top element of incoming port queues * without removing the top element from the queue. */ function f_imsIot_receive( in template SipMessageList p_passCriteria, in template SipMessageList p_failCriteria, in template SkipType p_skip, in charstring p_tpId, in boolean p_forwardMtc, in boolean p_checkMessage ) runs on ImsInterfaceMonitor { var integer v_size := sizeof(p_failCriteria); var DefaultList v_defaultArray; var integer i := 0; var integer v_size_ai := sizeof(PX_AVAILABLE_INTERFACES); log ("### f_imsIot_receive: passCriteria=", p_passCriteria); log ("### f_imsIot_receive: failCriteria=", p_failCriteria); // check if interface is available for(i := 0; i < v_size_ai; i := i+1) { if (PX_AVAILABLE_INTERFACES[i].interfaceName == vc_interfaceName) { if (PX_AVAILABLE_INTERFACES[i].available == false) { setverdict(inconc, self, "******f_imsIot_receive: Interface " & PX_AVAILABLE_INTERFACES[i].interfaceName & " not available and is not evaluated******" ); } else { // Interface is available v_defaultArray[0] := activate(a_default(p_tpId)); f_activateImsSipDefaults(v_defaultArray, 1, p_failCriteria, fail, p_tpId, p_forwardMtc, p_checkMessage); f_activateImsSipDefaults(v_defaultArray, v_size + 1, p_passCriteria, pass, p_tpId, p_forwardMtc, p_checkMessage); f_gen_receive(p_tpId, p_skip); for (i := 0; i < sizeof(v_defaultArray); i := i + 1) { deactivate(v_defaultArray[i]); } } break; // Exit loop } } // 'for' loop } /** * @desc This function implements skipping of messages as well as timeout handling. * Prior to calling this function the message to be cheked for should be added * as defaults. * This function is independent of a specific interface component. * @param p_tpId The Test Purpose identifier * @param p_skipCount Indicate how many messages should be skipped prior to checking */ function f_gen_receive( in charstring p_tpId, in template SkipType p_skip ) runs on ImsInterfaceMonitor { var integer skipCount := valueof(p_skip.skipCount); tc_wait.start; alt { // preamble (consume prior messages) [skipCount > 0 and ischosen(p_skip.skipMessage.request)] dPort.receive (p_skip.skipMessage.request) { skipCount := skipCount - 1; log("***f_gen_receive: Message skipped (intentionally) when checking for " & p_tpId & " at interface " & vc_interfaceName & " ****"); repeat; } [skipCount > 0 and ispresent(p_skip.skipMessage) and ischosen(p_skip.skipMessage.response)] dPort.receive (p_skip.skipMessage.response) { skipCount := skipCount - 1; log("***f_gen_receive: Message skipped (intentionally) when checking for " & p_tpId & " at interface " & vc_interfaceName & " ****"); repeat; } [] tc_wait.timeout { f_setConformanceVerdict(inconc, "***f_gen_receive: Timer tc_wait expired when waiting for incoming message in " & p_tpId & " at interface " & vc_interfaceName & " ****"); } } } /** * @desc Activates for each entry in a expected IMS SIP message list a default * for receiving that message and setting the verdict as desired * @param p_default Reference to default array where deaults are to be added * @param p_startIdx Index into default array after which references for * defaults created in this function should be added * @param p_list List of expected messages to be checked in default * @param p_verdict Verdict to be set in case the incoming message matches any of the expcted messages * @param p_tpId Test Purpose identifir */ function f_activateImsSipDefaults( inout DefaultList p_default, in integer p_startIdx, in template SipMessageList p_list, in verdicttype p_verdict, in charstring p_tpId, in boolean p_forwardMtc, in boolean p_checkMessage ) runs on ImsInterfaceMonitor { var integer v_size := sizeof(p_list); var integer v_idx := p_startIdx; for (var integer i := 0; i < v_size; i := i + 1) { if (ischosen(p_list[i].request)) { p_default[v_idx] := activate( a_receive_sipRequest(p_list[i].request,p_verdict, p_tpId, p_forwardMtc, p_checkMessage) ); } else { p_default[v_idx] := activate( a_receive_sipResponse(p_list[i].response,p_verdict, p_tpId, p_forwardMtc, p_checkMessage) ); } v_idx := v_idx + 1; } //log ("### f_activateImsSipDefaults: ended"); } }//end group group misc { /** * @desc * This function generate a charstring with a given length used as * message body. * @param p_length length of the message body * @return message body (charstring) */ function f_getMessageBody(in integer p_length) return charstring { var charstring v_rtn := ""; for(var integer i := 0; i < p_length; i:=i+1) { v_rtn := v_rtn & "a"; } return v_rtn; } function f_getContactAddr(in Contact contact) return SipUrl { var SipUrl v_SipUrl; var ContactAddress addr := contact.contactBody.contactAddresses[0]; if (ischosen (addr.addressField.nameAddr)) { v_SipUrl := addr.addressField.nameAddr.addrSpec; } else { v_SipUrl := addr.addressField.addrSpecUnion; } return (v_SipUrl); } } }