Commit 5bb34067 authored by mullers's avatar mullers
Browse files

transitioning added

parent 17b2aa93
Loading
Loading
Loading
Loading
+149 −0
Original line number Diff line number Diff line
/*
 *	@author 	STF 276
 *  @version 	$Id$
 *	@desc		This module contains test cases (TC) for ICMPv6 Functions 
 *              Each test case shall be grouped in case 
 *              it requires also TC functions. Each test case function shall
 *              invokes the appropriate configuration function for its test 
 *              component, then preamble, test purpose, and postamble functions 
 *              and finally the teardown of its configuration.
 */
module AtsIpv6_Protoype_Testcases {
	//LibCommon
	import from LibCommon_Sync all;
	import from LibCommon_VerdictControl all;
	//LibIpv6
	import from LibIpv6_Interface_TypesAndValues all;
	import from LibIpv6_Interface_Functions all;
	import from LibIpv6_Interface_Templates all;
	import from LibIpv6_ExternalFunctions all;
	import from LibIpv6_CommonRfcs_TypesAndValues all;
	import from LibIpv6_Rfc2463Icmpv6_Templates all;
	import from LibIpv6_Rfc792Icmpv4_Templates all;
	//LibScop
	import from LibScop_Functions all;
	//AtsIpv6
	import from AtsIpv6_TestSystem all;
	import from AtsIpv6_TestConfiguration_TypesAndValues all;
	import from AtsIpv6_ModuleParameters all;
	import from AtsIpv6_TestConfiguration all;
	import from AtsIpv6_Defaults all;
	import from AtsIpv6_Preambles all;
	import from AtsIpv6_Postambles all;
	import from AtsIpv6_Core_Tp_Functions {function all};
	import from AtsIpv6_Common_Functions all;


	/*
	 * @desc  Sends IPv4 Packet which includes IPv6 Packet
	 *        Uses test configuration 1.
	*/
	testcase TC_TRANS_IPv4withTunneledIPv6() runs on Ipv6Node system NodeTestAdapter {
		//Variables
		var CfMessage v_cfMsg;
		var FncRetCode v_ret := e_error;

		//Configuration
		f_cfCore01Up(v_cfMsg);

		activate(a_tn_nut(v_cfMsg, v_cfMsg.paramsRt01, v_cfMsg.paramsIut));

		//Preamble
		f_PR_tn_nut(v_cfMsg, e_cleanGla, v_cfMsg.paramsRt01, v_cfMsg.paramsIut);

		// test body
		v_ret := f_sendIpv4Packet ( 
			m_ipv4Packet_tunneledIpv6 (
				'00000000'O,//TODO configure and set ipv4 address
				'00000000'O,
				m_echoRequest_noExtHdr_noData (
					v_cfMsg.paramsRt01.gla,
					v_cfMsg.paramsIut.gla,
					c_defId,
					c_defSeqNo
				)
			)
		);
		if(v_ret != e_success) {log("**** TC_TRANS_IPv4withTunneledIPv6: Error in send ****");}

		tc_ac.start;
		alt{
			[] ipPort.receive(mw_ipv4Packet_tunneledIpv6 (
									'00000000'O,//TODO configure and set ipv4 address
									'00000000'O,
									mw_echoReply_noExtHdr_noData (
										v_cfMsg.paramsIut.gla,
										v_cfMsg.paramsRt01.gla,
										c_defId,
										c_defSeqNo
									)
								)) {
				log("**** TC_TRANS_IPv4withTunneledIPv6: Timeout ****");
				tc_ac.stop;
			}
			[] tc_ac.timeout {
				log("**** TC_TRANS_IPv4withTunneledIPv6: Timeout ****");	
			}
			
		}//end alt


		// postamble
		f_PO_tn_nut(v_cfMsg, c_cleanOnlyLla, v_cfMsg.paramsRt01, v_cfMsg.paramsIut);

		deactivate;

		f_cfPtcDown();

	}//end TC_TRANS_IPv4withTunneledIPv6

		/*
	 * @desc  Sends IPv4 Packet without IPv6 Packet
	 *        Uses test configuration 1.
	*/
	testcase TC_TRANS_PING_IPv4() runs on Ipv6Node system NodeTestAdapter {
		//Variables
		var CfMessage v_cfMsg;
		var FncRetCode v_ret := e_error;

		//Configuration
		f_cfCore01Up(v_cfMsg);

		activate(a_tn_nut(v_cfMsg, v_cfMsg.paramsRt01, v_cfMsg.paramsIut));

		//Preamble
		f_PR_tn_nut(v_cfMsg, e_cleanGla, v_cfMsg.paramsRt01, v_cfMsg.paramsIut);

		// test body
		v_ret := f_sendIpv4Packet ( 
			m_ipv4EchoRequest_noData (
				'00000000'O,//TODO configure and set ipv4 address
				'00000000'O
			)
		);
		if(v_ret != e_success) {log("**** TC_TRANS_PING_IPv4: Error in send ****");}

		tc_ac.start;
		alt{
			[] ipPort.receive(mw_ipv4EchoReply_noData (
									'00000000'O,//TODO configure and set ipv4 address
									'00000000'O )) {
				log("**** TC_TRANS_PING_IPv4: Timeout ****");
				tc_ac.stop;
			}
			[] tc_ac.timeout {
				log("**** TC_TRANS_PING_IPv4: Timeout ****");	
			}
			
		}//end alt

		// postamble
		f_PO_tn_nut(v_cfMsg, c_cleanOnlyLla, v_cfMsg.paramsRt01, v_cfMsg.paramsIut);

		deactivate;

		f_cfPtcDown();

	}//end TC_TRANS_PING_IPv4

} //end module AtsIpv6_Protoype_Testcases