Commit 1f27fcc3 authored by schulzs's avatar schulzs
Browse files

general revision based on friday code review

parent dc65d650
Loading
Loading
Loading
Loading
+96 −63
Original line number Diff line number Diff line
@@ -29,65 +29,90 @@ module AtsImsIot_Behavior {
	
	//TODO move group to Function module
	group general_td_functions {
		
		
		/**
         * @desc Receive the expected messages on the interfaces.
         * @param p_passCriteria Expected massages which leads to pass
         * @param p_failCriteria Expected message which leads to fail
         * @param p_tpId The Test Purpose ID
         * @param p_msgCount Indicate how many messages should be irgnored
         * @param p_forword Indicate if the received message should be forwarded to the MTC
         * @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.
         * @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
         */     
        function f_receive( 
        function f_imsIot_receive( 
          in template SipMessageList p_passCriteria,
          in template SipMessageList p_failCriteria,
          in charstring p_tpId,
          in charstring p_log,
          in integer p_msgCount,
          in boolean p_forward
          in integer p_skipCount,
          in boolean p_forwardMtc
        ) runs on InterfaceMonitor { 

            var integer v_size := sizeof(valueof(p_failCriteria));
            var DefaultList v_defaultArray;

            v_defaultArray[0] := activate(a_default(p_tpId));
            f_activateDefaults(v_defaultArray, 1, p_failCriteria, fail, p_tpId, p_log, p_forward);
            f_activateDefaults(v_defaultArray, v_size + 1, p_passCriteria, pass, p_tpId, p_log, p_forward);
            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_gen_receive(p_tpId,  p_log, p_skipCount);

			for (var integer i := 0; i < sizeof(v_defaultArray); i := i + 1) {
                deactivate(v_defaultArray[i]);
            }
		}
		
		/**
         * @desc This function implements skipping of messages as well as timeout handling.
		 *       Prior to calling this function the message to be chekd 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 charstring p_log, // TODO: usage? what is in this param?
          in integer p_skipCount,
        ) runs on InterfaceMonitor {
            
			tc_wait.start;
            
            alt {
            	// preamble (consume prior messesages)
            	// preamble (consume prior messages)
            	[p_msgCount > 0] mPort.receive {
            		p_msgCount := p_msgCount - 1;
            		log("***f_Mw_recieve: message skipped****");
            		log("***f_gen_receive: Message skipped (intentionally) when checking for " & p_tpId & " at interface " & vc_interfaceName & " ****");
            		repeat;
            	}
	            [] tc_wait.timeout {
	                setverdict(fail, self, "***" & p_tpId & ": timer expired. " & p_log & " not received***"); 
	            [] tc_wait.timeout { //TODO use oracle
	                setverdict(inconc, "***f_gen_receive: Timer tc_wait expired when waiting for incoming message in " & p_tpId & " at interface " & vc_interfaceName & " ****"); 
	            }
            }
            
            for (var integer i := 0; i < sizeof(v_defaultArray); i := i + 1) {
                deactivate(v_defaultArray[i]);
            }
        }
        
		/**
		* @desc Activate alternatives for the interfaces.
		* @param p_default Record of alternatives.
		* @param p_startIdx Start index where alternatives should be added
		* @param p_list Message List to add
		* @param p_verdict expected verdict
		* @param p_tpId Test Purpose ID
		* @param p_forward Indicate if the recieved message should be forwarded to MTC
		* @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_activateDefaults(
		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 charstring p_log,
			in boolean p_forward
			in charstring p_log
		) runs on InterfaceMonitor {
			var integer v_size := sizeof(valueof(p_list));
			var integer v_idx := p_startIdx;
@@ -95,11 +120,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_request(p_list[i].request,p_verdict, p_tpId, p_log, p_forward)
						a_receive_sipRequest(p_list[i].request,p_verdict, p_tpId, p_log)
					);
				} else {
					p_default[v_idx] := activate(
						a_receive_response(p_list[i].response,p_verdict, p_tpId, p_log, p_forward)
						a_receive_sipResponse(p_list[i].response,p_verdict, p_tpId, p_log)
					);
				}
				v_idx := v_idx + 1;
@@ -112,44 +137,40 @@ module AtsImsIot_Behavior {
		
		altstep a_default(in charstring p_TP) runs on InterfaceMonitor {
			[] mPort.receive {
				log(self, "***" & p_TP & ": message received");
				log(self, "*** a_default: Received/ignored unexpected message when waiting for message complying to " & p_TP );
				repeat; 
			}
		}
        
		/**
		* @desc Receiving SIP request alternative for interfaces.
		* @param p_message the SIP repsonse
		* @param p_verdict the expected verdict
		* @param p_tpId the test purpose ID
		* @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
		*/
		altstep a_receive_request(
		altstep a_receive_sipRequest(
			in template Request p_message,
			in verdicttype p_verdict,
			in charstring p_tpId,
			in charstring p_log,
			in charstring p_log, // TODO ???
			in boolean p_forward
		) runs on InterfaceMonitor {
			var Request v_message;
			[] mPort.receive(p_message) -> value v_message {
				var charstring v_token := ": unexpected ";
				if(p_verdict == pass) {
					v_token := ": expected ";
				}
				setverdict(p_verdict, self, "***" & p_tpId & v_token & p_log & " received***");
				if(p_forward) {
					vPort.send(v_message);
				}
				//TODO use oracle
				setverdict(p_verdict, self, "***a_receive_sipRequest: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
			}
		}
        
		/**
		* @desc Receiving SIP response alternative for interfaces.
		* @param p_message the SIP repsonse
		* @param p_verdict the expected verdict
		* @param p_tpId the test purpose ID
		* @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
		*/
		altstep a_receive_response(
		altstep a_receive_sipResponse(
    		in template Response p_message,
    		in verdicttype p_verdict,
    		in charstring p_tpId,
@@ -158,14 +179,8 @@ module AtsImsIot_Behavior {
		) runs on InterfaceMonitor {
			var Response v_message;
			[] mPort.receive(p_message) -> value v_message {
				var charstring v_token := ": unexpected ";
				if(p_verdict == pass) {
					v_token := ": expected ";
				}
				setverdict(p_verdict, self, "***" & p_tpId & v_token & p_log & " received***");
				if(p_forward) {
					vPort.send(v_message);
				}
				//TODO use oracle
				setverdict(p_verdict, self, "***a_receive_sipResponse: Received expected SIP response complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
			}
		}
        
@@ -180,10 +195,27 @@ module AtsImsIot_Behavior {
          *     greater than 1300 bytes }<br> then { IMS_B receives the MESSAGE
          *     containing the Message_Body greater than 1300 bytes }<br> }
          */
	    function f_check_TP_IMS_4002_01(InterfaceMonitor p_interfaceRef, charstring p_interfaceName) runs on TestCoordinator {
	    function f_mtc_check_TP_IMS_4002_01_gm(InterfaceMonitor p_monitorCompRef) 
		runs on TestCoordinator {
		   	    		
           p_monitorCompRef.start(
            f_imsIot_receive(
                {mw_SipRequest(mdw_TP_IMS_4002_01(?))},//? CallId can be checked
                {mw_SipRequest(mw_MESSAGE_Request_Base(?))},
                "TP_IMS_4002_01 @ " & p_interfaceName,
                "MESSAGE request",
                0,
                false
            )
           );
           p_monitorCompRef.done;
	    }

           p_interfaceRef.start(
            f_receive(
	    function f_mtc_check_TP_IMS_4002_01_mw(InterfaceMonitor p_monitorCompRef) 
		runs on TestCoordinator {
		   	    		
           p_monitorCompRef.start(
            f_imsIot_receive(
                {mw_SipRequest(mdw_TP_IMS_4002_01(?))},//? CallId can be checked
                {mw_SipRequest(mw_MESSAGE_Request_Base(?))},
                "TP_IMS_4002_01 @ " & p_interfaceName,
@@ -192,8 +224,9 @@ module AtsImsIot_Behavior {
                false
            )
           );
           p_interfaceRef.done;
           p_monitorCompRef.done;
	    }

	}


+0 −201
Original line number Diff line number Diff line
/**
 *	@author 	STF 370
 *  @version    $Id: $
 *	@desc		This module provides common functions which describes behavior for each TP reference.
 */
module AtsImsIot_Behavior {
	
	import from LibIot_TypesAndValues {
		type DefaultList, SipMessageList, SipMessage; 
	}
	import from LibIot_Templates {
		template all;
	}
	import from LibIot_TestInterface {
		type TestCoordinator, InterfaceMonitor; 
	}

	import from LibSip_SIPTypesAndValues {type Request, Response;}
	
	import from LibSip_Templates {
		template mw_ACK_Request_Base,
			mw_INVITE_Request_Base,
			mw_MESSAGE_Request_Base,
			mw_NOTIFY_Request_Base,
			mw_REGISTER_Request_Base,
			mw_SUBSCRIBE_Request_Base,
			mw_Response_Base;
	}
	
	//TODO move group to Function module
	group general_td_functions {
		/**
         * @desc Receive the expected messages on the interfaces.
         * @param p_passCriteria Expected massages which leads to pass
         * @param p_failCriteria Expected message which leads to fail
         * @param p_tpId The Test Purpose ID
         * @param p_msgCount Indicate how many messages should be irgnored
         * @param p_forword Indicate if the received message should be forwarded to the MTC
         */     
        function f_receive( 
          in template SipMessageList p_passCriteria,
          in template SipMessageList p_failCriteria,
          in charstring p_tpId,
          in charstring p_log,
          in integer p_msgCount,
          in boolean p_forward
        ) runs on InterfaceMonitor {
            var integer v_size := sizeof(valueof(p_failCriteria));
            var DefaultList v_defaultArray;

            v_defaultArray[0] := activate(a_default(p_tpId));
            f_activateDefaults(v_defaultArray, 1, p_failCriteria, fail, p_tpId, p_log, p_forward);
            f_activateDefaults(v_defaultArray, v_size + 1, p_passCriteria, pass, p_tpId, p_log, p_forward);
            
			tc_wait.start;
            
            alt {
            	// preamble (consume prior messesages)
            	[p_msgCount > 0] mPort.receive {
            		p_msgCount := p_msgCount - 1;
            		log("***f_Mw_recieve: message skipped****");
            		repeat;
            	}
	            [] tc_wait.timeout {
	                setverdict(fail, self, "***" & p_tpId & ": timer expired. " & p_log & " not received***"); 
	            }
            }
            
            for (var integer i := 0; i < sizeof(v_defaultArray); i := i + 1) {
                deactivate(v_defaultArray[i]);
            }
        }
        
		/**
		* @desc Activate alternatives for the interfaces.
		* @param p_default Record of alternatives.
		* @param p_startIdx Start index where alternatives should be added
		* @param p_list Message List to add
		* @param p_verdict expected verdict
		* @param p_tpId Test Purpose ID
		* @param p_forward Indicate if the recieved message should be forwarded to MTC
		*/
		function f_activateDefaults(
			inout DefaultList p_default,
			in integer p_startIdx,
			in template SipMessageList p_list,
			in verdicttype p_verdict,
			in charstring p_tpId,
			in charstring p_log,
			in boolean p_forward
		) runs on InterfaceMonitor {
			var integer v_size := sizeof(valueof(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_request(p_list[i].request,p_verdict, p_tpId, p_log, p_forward)
					);
				} else {
					p_default[v_idx] := activate(
						a_receive_response(p_list[i].response,p_verdict, p_tpId, p_log, p_forward)
					);
				}
				v_idx := v_idx + 1;
			}
		}
        
	}//end group
		
	group altsteps {
		
		altstep a_default(in charstring p_TP) runs on InterfaceMonitor {
			[] mPort.receive {
				log(self, "***" & p_TP & ": message received");
				repeat; 
			}
		}
        
		/**
		* @desc Receiving SIP request alternative for interfaces.
		* @param p_message the SIP repsonse
		* @param p_verdict the expected verdict
		* @param p_tpId the test purpose ID
		*/
		altstep a_receive_request(
			in template Request p_message,
			in verdicttype p_verdict,
			in charstring p_tpId,
			in charstring p_log,
			in boolean p_forward
		) runs on InterfaceMonitor {
			var Request v_message;
			[] mPort.receive(p_message) -> value v_message {
				var charstring v_token := ": unexpected ";
				if(p_verdict == pass) {
					v_token := ": expected ";
				}
				setverdict(p_verdict, self, "***" & p_tpId & v_token & p_log & " received***");
				if(p_forward) {
					vPort.send(v_message);
				}
			}
		}
        
		/**
		* @desc Receiving SIP response alternative for interfaces.
		* @param p_message the SIP repsonse
		* @param p_verdict the expected verdict
		* @param p_tpId the test purpose ID
		*/
		altstep a_receive_response(
    		in template Response p_message,
    		in verdicttype p_verdict,
    		in charstring p_tpId,
    		in charstring p_log,
    		in boolean p_forward
		) runs on InterfaceMonitor {
			var Response v_message;
			[] mPort.receive(p_message) -> value v_message {
				var charstring v_token := ": unexpected ";
				if(p_verdict == pass) {
					v_token := ": expected ";
				}
				setverdict(p_verdict, self, "***" & p_tpId & v_token & p_log & " received***");
				if(p_forward) {
					vPort.send(v_message);
				}
			}
		}
        
	}// end group
	
	group td_IMS_0001 {
		
		 /**
          * @desc
          *     TP_IMS_4002_01 in CFW step 3 (MESSAGE)<br> ensure that {<br>
          *     when { UE_A sends a MESSAGE to UE_B containing a Message_Body
          *     greater than 1300 bytes }<br> then { IMS_B receives the MESSAGE
          *     containing the Message_Body greater than 1300 bytes }<br> }
          */
	    function f_check_TP_IMS_4002_01(InterfaceMonitor p_interfaceRef, charstring p_interfaceName) runs on TestCoordinator {
		   	    		
           p_interfaceRef.start(
            f_receive(
                {mw_SipRequest(mdw_TP_IMS_4002_01(?))},//? CallId can be checked
                {mw_SipRequest(mw_MESSAGE_Request_Base(?))},
                "TP_IMS_4002_01 @ " & p_interfaceName,
                "MESSAGE request",
                0,
                false
            )
           );
           p_interfaceRef.done;
	    }
	}


 	
}// end module
 No newline at end of file
+22 −33
Original line number Diff line number Diff line
@@ -27,6 +27,21 @@ module AtsImsIot_TestCases {
		type EutTrigger, InterfaceMonitor, SystemInterface, TestCoordinator;
	}
	
	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";
		
	}
	
	/**
	 * @desc
	 *     IMS network shall support SIP messages greater than 1500 bytes.
@@ -36,10 +51,14 @@ module AtsImsIot_TestCases {
		// create components
		var EutTrigger v_ueA := f_cf_create_trigger("User A");
		var EutTrigger v_ueB := f_cf_create_trigger("User B");
		var InterfaceMonitor v_gmA := f_cf_create_monitor(c_gm_A);
		var InterfaceMonitor v_mw := f_cf_create_monitor(c_mw);
		
		// map/connect component ports
		f_cf_trigger_up(v_ueA);
		f_cf_trigger_up(v_ueB);
		f_cf_monitor_up(v_gmA);
		f_cf_monitor_up(v_mw);
		
		// preamble
		f_PR_user_home_registration(v_ueA);
@@ -47,7 +66,9 @@ module AtsImsIot_TestCases {
		
		// test body
		f_mtc_userSendMessage(v_ueA, "body>1300Bytes"); // TODO add body here
		f_userCheckMessageReceipt(v_ueB);
		f_mtc_check_TP_IMS_4002_01_gm(v_gmA);
		f_mtc_check_TP_IMS_4002_01_mw(v_mw);
		f_mtc_userCheckMessageReceipt(v_ueB);
		
		// postabmle
		f_PO_user_home_deregistration(v_ueA);
@@ -58,38 +79,6 @@ module AtsImsIot_TestCases {
		f_cf_trigger_down(v_ueB);
	}
	
	/**
	* @desc
	*     IMS network shall support SIP messages greater than 1500 bytes.
	*     (TD_IMS_0001 in ETSI TS 186 011-2 V2.3.1 cause 4.5.1.1)
	*/
	testcase TC_IMS_0001_Monitor() runs on TestCoordinator system SystemInterface {
		// create components
		var InterfaceMonitor v_gmA := f_cf_create_monitor(c_gm_A);
		var InterfaceMonitor v_mw := f_cf_create_monitor(c_mw);
		var InterfaceMonitor v_gmB := f_cf_create_monitor(c_gm_B);
		
		// map/connect component ports
		f_cf_monitor_up(v_gmA);
		f_cf_monitor_up(v_mw);
		f_cf_monitor_up(v_gmB);
		
		//preamble - init
		//TODO
		
		//test body
		f_check_TP_IMS_4002_01(v_gmA, c_gm_A);
		f_check_TP_IMS_4002_01(v_mw, c_mw);
		f_check_TP_IMS_4002_01(v_gmB, c_gm_B);
		
		//postamble - init
		//TODO

		//unmap/disconnet component ports
		f_cf_monitor_down(v_gmA);
		f_cf_monitor_down(v_mw);
		f_cf_monitor_down(v_gmA);
	}
	
	/**
	 * @desc IMS network supports properly application services based on 
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ module LibIot_Functions {
			var Status v_status;
			var charstring v_reason := "";
			
			tPort.call(Trigger:{p_cmd, p_params}, 5.0) {
			tPort.call(Trigger:{p_cmd, p_params}, PX_EUT_TRIGGER_RESPONSE ) {
				[] tPort.getreply(Trigger:{-,-} value Status:{e_success, *}) -> value v_status {
					if(ispresent(v_status.reason)) {
						v_reason := v_status.reason;
+8 −2
Original line number Diff line number Diff line
@@ -19,9 +19,15 @@ module LibIot_PIXITS {
	
	/**
	* 
	* @desc Timer value for enqueuing messages
	* @desc Maximum time limit used by monitor component for waiting for expected incoming messages
	*/
	modulepar float PX_ENQUEUE_TIMER := 5.0;
	modulepar float PX_MAX_MSG_WAIT := 5.0;
	
	/**
	* 
	* @desc Maximum time limit used by trigger component for waiting for EUT response after command has been sent
	*/
	modulepar float PX_EUT_TRIGGER_RESPONSE := 5.0;
	
	group numberOfComponents {
		modulepar {
Loading