Commit 60d41949 authored by poglitsch's avatar poglitsch
Browse files

new function for message exchange between monitor components and mtc added

parent b8f13a7a
Loading
Loading
Loading
Loading
+41 −21
Original line number Diff line number Diff line
@@ -5,9 +5,11 @@
 */
module AtsImsIot_Behavior {
	
	import from LibIot_PIXITS {modulepar PX_MAX_MSG_WAIT;}

	import from AtsImsIot_Templates {template all;}

	import from AtsImsIot_TypesAndValues {type SipMessageList;}
	import from AtsImsIot_TypesAndValues {type SipMessage, SipMessageList;}

	import from LibIot_TypesAndValues {type DefaultList;}
	import from LibIot_TestInterface {type TestCoordinator, InterfaceMonitor;}
@@ -28,17 +30,20 @@ module AtsImsIot_Behavior {
	//TODO move group to Function module
	group general_td_functions {
	 	
		
		/**
         * @desc This is a generic function that adds checks for IMS IOT messages 
		 * @desc
		 *     This is a generic function that adds checks for IMS IOT messages
		 *     to be checked by this interface monitor component via default
		 *       activation.It then calls the f_gen_receive function and deactivates
		 *       all added defaults again.
		 *     activation.It then calls the f_gen_receive function and
		 *     deactivates all added defaults again.
		 * @param p_passCriteria Expected messages which lead to pass
		 * @param p_failCriteria Expected messages which lead to fail
		 * @param p_tpId The Test Purpose identifier
         * @param p_skipCount Indicate how many messages should be skipped prior 
		                      to checking
		 * @param p_skipCount
		 *     Indicate how many messages should be skipped prior to checking
		 * @param p_forwardMtc
		 *     indicate if the received Sip message should be forwarded to the
		 *     mtc
		 */     
        function f_imsIot_receive( 
          in template SipMessageList p_passCriteria,
@@ -53,8 +58,8 @@ module AtsImsIot_Behavior {
            var DefaultList v_defaultArray;

            v_defaultArray[0] := activate(a_default(p_tpId));
            f_activateImsSipDefaults(v_defaultArray, 1, p_failCriteria, fail, p_tpId, p_log);
            f_activateImsSipDefaults(v_defaultArray, v_size + 1, p_passCriteria, pass, p_tpId, p_log);
            f_activateImsSipDefaults(v_defaultArray, 1, p_failCriteria, fail, p_tpId, p_log, p_forwardMtc);
            f_activateImsSipDefaults(v_defaultArray, v_size + 1, p_passCriteria, pass, p_tpId, p_log, p_forwardMtc);

			f_gen_receive(p_tpId,  p_log, p_skipCount);

@@ -110,7 +115,8 @@ module AtsImsIot_Behavior {
			in template SipMessageList p_list,
			in verdicttype p_verdict,
			in charstring p_tpId,
			in charstring p_log
			in charstring p_log,
			in boolean p_forwardMtc
		) runs on InterfaceMonitor {
			var integer v_size := sizeof(valueof(p_list));
			var integer v_idx := p_startIdx;
@@ -118,11 +124,11 @@ module AtsImsIot_Behavior {
			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_log)
						a_receive_sipRequest(p_list[i].request,p_verdict, p_tpId, p_log, p_forwardMtc)
					);
				} else {
					p_default[v_idx] := activate(
						a_receive_sipResponse(p_list[i].response,p_verdict, p_tpId, p_log)
						a_receive_sipResponse(p_list[i].response,p_verdict, p_tpId, p_log, p_forwardMtc)
					);
				}
				v_idx := v_idx + 1;
@@ -146,17 +152,24 @@ module AtsImsIot_Behavior {
		* @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 charstring p_log // TODO ???
			in charstring p_log, // TODO ???
			in boolean p_forwardMtc
		) runs on InterfaceMonitor {
			var Request v_message;
			[] mPort.receive(p_message) -> value v_message {
				//TODO use oracle
				setverdict(p_verdict, self, "***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;
					xPort.send(v_msg);
				}
			}
		}
        
@@ -166,17 +179,24 @@ module AtsImsIot_Behavior {
		* @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 charstring p_log
    		in charstring p_log,
    		in boolean p_forwardMtc
		) runs on InterfaceMonitor {
			var Response v_message;
			[] mPort.receive(p_message) -> value v_message {
				//TODO use oracle
				setverdict(p_verdict, self, "***a_receive_sipResponse: Received expected SIP response complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.response := v_message;
					xPort.send(v_msg);
				}
			}
		}
        
+30 −1
Original line number Diff line number Diff line
@@ -5,11 +5,17 @@
 */
module AtsImsIot_Functions {
 
 	import from LibIot_PIXITS {modulepar PX_MAX_MSG_WAIT;}

 	import from AtsImsIot_TypesAndValues {type SipMessage;}

 	import from LibIot_TypesAndValues {type TriggerCommand;}

 	import from LibIms_ConfigAndTrigger all;

 	import from LibIot_TestInterface {type EutTrigger, TestCoordinator;}
 	import from LibIot_TestInterface {
		 type EutTrigger, InterfaceMonitor, TestCoordinator;
	 }
 	
 	group ue {
 		
@@ -198,4 +204,27 @@ module AtsImsIot_Functions {
 	}
 
 
 	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 template SipMessage p_msg) runs on TestCoordinator {
            timer t_local := PX_MAX_MSG_WAIT;
            t_local.start;            
            alt {
            	[]xPort.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***");    
            	}
            }
        }	
 	}
 
}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ module AtsImsIot_Templates {
			mw_Response_Base;
	}
	
	group SIPTemplates {
	group sipTemplates {
    
		/**
		* @desc SIP request template
@@ -39,7 +39,7 @@ module AtsImsIot_Templates {
		}
	}//end group
	
	group ModifiedSIPBaseTemplates {
	group modifiedSIPBaseTemplates {
		
		/**
		*