Loading ttcn/Ats464XLat/Ats464XLat_TestCases.ttcn3 +191 −4 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ module Ats464XLat_TestCases { * @reference [TS:6.6.9.3] Feature: DHCP * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2014-01) TP/464XLAT/CLAT-B4/BF/BV/01 */ testcase TC_464XLAT_CLAT_B4_BF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { testcase TC_464XLAT_CLATB4_BF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { // Local variables Loading @@ -99,7 +99,7 @@ module Ats464XLat_TestCases { // Postamble f_down(); } // End of testcase TC_464XLAT_CLAT_B4_BF_BV_001 } // End of testcase TC_464XLAT_CLATB4_BF_BV_001 group f_TC_464XLAT_CLAT_B4_BF_BV_001 { Loading Loading @@ -189,6 +189,193 @@ module Ats464XLat_TestCases { group validBehaviour { /** * @desc Check that the IUT fragments an HTML IPv4 packet when DF bit is not set * @verdict pass on success, inconc on timeout, fail otherwise * <pre> * PICS Selection: none * Initial conditions: * with { * the IUT is properly provisioned * the interfaces are connected & functional * the physical MTU size is set at 1400 * and the CLAT MTU being lower than the encapsulated softwired packet * } * Expected behaviour: * ensure that { * when { * the IUT receives an HTML IPv4 packet * containing source address * indicating a private IPv4 address * containing the DF bit * indicating the value 0 * with a packet size greater than the CLAT-MTU * } * then { * the IUT fragments that packet before it translates it to IPv6 * and the IUT forwards correctly formatted fragmented packets to the LSN * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.6 464XLAT Technology Summary * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/464XLAT/CLAT-B4/PF/VB/01 */ testcase TC_464XLAT_CLATB4_PF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { // Local variables var Ipv4Packet v_ipv4Packet; /** IPv4 packets */ var integer v_index := 0; // Test control // Test component configuration vc_lsnComponents[v_index] := LSNComponent.create(c_COMP_LSN); vc_hostComponents[v_index] := HostComponent.create(c_COMP_HOST); f_cf01Up_CLAT_B4(); // Test adapter configuration // Test Body // Start all components //TODO introduce new PIXITs for address/port information f_finalyzeIpv4Packet( m_ipv4Packet_df( 0, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_464XLAT_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].srcPort, m_tcpHttpPayload(int2oct(42, PX_464XLAT_PLAT_MTU)), m_tcp_flags_syn ) ), v_ipv4Packet ); vc_lsnComponents[v_index].start(f_TC_464XLAT_CLATB4_PF_BV_001_b4(v_ipv4Packet)); vc_hostComponents[v_index].start(f_TC_464XLAT_CLATB4_PF_BV_001_host(v_ipv4Packet, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].ip6Address)); f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); } // End of testcase TC_464XLAT_CLATB4_PF_BV_001 group f_TC_464XLAT_CLATB4_PF_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_CLATB4_PF_BV_001_b4(Ipv4Packet p_ipv4Packet) runs on LSNComponent { // Local variables // Preamble // Clause 'Initial conditions' f_preamble_b4(p_ipv4Packet.ipv4Hdr.destinationAddress); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body ipv4Port.send(p_ipv4Packet); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_postamble_lsn(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_CLATB4_PF_BV_001_b4 /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_CLATB4_PF_BV_001_host(Ipv4Packet p_ipv4Packet, Ipv6Address p_ipv6Address) runs on HostComponent { // Local variables var boolean v_firstReceived := false; var boolean v_lastReceived := false; var template(present) Ipv4Packet v_firstFragment; var template(present) Ipv4Packet v_lastFragment; // Preamble // Clause 'Initial conditions' f_preamble_host(); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': //construct encapsulated fragments v_firstFragment := p_ipv4Packet; v_firstFragment.ipv4Hdr.totalLength := PX_464XLAT_PLAT_MTU; v_firstFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1; v_firstFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, 0, PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength); v_lastFragment := p_ipv4Packet; v_lastFragment.ipv4Hdr.totalLength := p_ipv4Packet.ipv4Hdr.headerLength + p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag0; v_lastFragment.ipv4Hdr.fragmentOffset := PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, v_lastFragment.ipv4Hdr.fragmentOffset, p_ipv4Packet.ipv4Hdr.headerLength); //receive encapsulated fragments tc_ac.start; alt { [v_firstReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, omit, v_firstFragment // containing first fragment )) { log("*** " & __SCOPE__ & ": First fragmented packet received. ***"); tc_ac.stop; v_firstReceived := true; if (v_lastReceived == false) { tc_ac.start; repeat; } } [v_lastReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, omit, v_lastFragment // containing last fragment )) { log("*** " & __SCOPE__ & ": Last fragmented packet received. ***"); tc_ac.stop; v_lastReceived := true; if (v_firstReceived == false) { tc_ac.start; repeat; } } [] tc_ac.timeout { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***"); } } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); log("*** " & __SCOPE__ & ": PASS: IUT correctly forwarded fragmented packets. ***"); // Postamble f_postamble_host(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_CLATB4_PF_BV_001_host } // End of group f_TC_464XLAT_CLATB4_PF_BV_001 } // End of group validBehaviour } // End of group packetFragmentation Loading Loading @@ -1600,7 +1787,7 @@ module Ats464XLat_TestCases { mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, omit, v_firstFragment // containing first fragment )) { log("*** " & __SCOPE__ & ": First fragmented packet received. ***"); Loading @@ -1615,7 +1802,7 @@ module Ats464XLat_TestCases { mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, omit, v_lastFragment // containing last fragment )) { log("*** " & __SCOPE__ & ": Last fragmented packet received. ***"); Loading ttcn/Ats464XLat/Ats464XLat_TestControl.ttcn3 +3 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,9 @@ module Ats464XLat_TestControl { control { // CLAT CPE execute(TC_464XLAT_CLAT_B4_BF_BV_001()); execute(TC_464XLAT_CLATB4_BF_BV_001()); execute(TC_464XLAT_CLATB4_PF_BV_001()); execute(TC_464XLAT_CLATB4_MSSC_BV_001()); Loading Loading
ttcn/Ats464XLat/Ats464XLat_TestCases.ttcn3 +191 −4 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ module Ats464XLat_TestCases { * @reference [TS:6.6.9.3] Feature: DHCP * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2014-01) TP/464XLAT/CLAT-B4/BF/BV/01 */ testcase TC_464XLAT_CLAT_B4_BF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { testcase TC_464XLAT_CLATB4_BF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { // Local variables Loading @@ -99,7 +99,7 @@ module Ats464XLat_TestCases { // Postamble f_down(); } // End of testcase TC_464XLAT_CLAT_B4_BF_BV_001 } // End of testcase TC_464XLAT_CLATB4_BF_BV_001 group f_TC_464XLAT_CLAT_B4_BF_BV_001 { Loading Loading @@ -189,6 +189,193 @@ module Ats464XLat_TestCases { group validBehaviour { /** * @desc Check that the IUT fragments an HTML IPv4 packet when DF bit is not set * @verdict pass on success, inconc on timeout, fail otherwise * <pre> * PICS Selection: none * Initial conditions: * with { * the IUT is properly provisioned * the interfaces are connected & functional * the physical MTU size is set at 1400 * and the CLAT MTU being lower than the encapsulated softwired packet * } * Expected behaviour: * ensure that { * when { * the IUT receives an HTML IPv4 packet * containing source address * indicating a private IPv4 address * containing the DF bit * indicating the value 0 * with a packet size greater than the CLAT-MTU * } * then { * the IUT fragments that packet before it translates it to IPv6 * and the IUT forwards correctly formatted fragmented packets to the LSN * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.6 464XLAT Technology Summary * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/464XLAT/CLAT-B4/PF/VB/01 */ testcase TC_464XLAT_CLATB4_PF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { // Local variables var Ipv4Packet v_ipv4Packet; /** IPv4 packets */ var integer v_index := 0; // Test control // Test component configuration vc_lsnComponents[v_index] := LSNComponent.create(c_COMP_LSN); vc_hostComponents[v_index] := HostComponent.create(c_COMP_HOST); f_cf01Up_CLAT_B4(); // Test adapter configuration // Test Body // Start all components //TODO introduce new PIXITs for address/port information f_finalyzeIpv4Packet( m_ipv4Packet_df( 0, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_464XLAT_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].srcPort, m_tcpHttpPayload(int2oct(42, PX_464XLAT_PLAT_MTU)), m_tcp_flags_syn ) ), v_ipv4Packet ); vc_lsnComponents[v_index].start(f_TC_464XLAT_CLATB4_PF_BV_001_b4(v_ipv4Packet)); vc_hostComponents[v_index].start(f_TC_464XLAT_CLATB4_PF_BV_001_host(v_ipv4Packet, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].ip6Address)); f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); } // End of testcase TC_464XLAT_CLATB4_PF_BV_001 group f_TC_464XLAT_CLATB4_PF_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_CLATB4_PF_BV_001_b4(Ipv4Packet p_ipv4Packet) runs on LSNComponent { // Local variables // Preamble // Clause 'Initial conditions' f_preamble_b4(p_ipv4Packet.ipv4Hdr.destinationAddress); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body ipv4Port.send(p_ipv4Packet); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_postamble_lsn(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_CLATB4_PF_BV_001_b4 /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_CLATB4_PF_BV_001_host(Ipv4Packet p_ipv4Packet, Ipv6Address p_ipv6Address) runs on HostComponent { // Local variables var boolean v_firstReceived := false; var boolean v_lastReceived := false; var template(present) Ipv4Packet v_firstFragment; var template(present) Ipv4Packet v_lastFragment; // Preamble // Clause 'Initial conditions' f_preamble_host(); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': //construct encapsulated fragments v_firstFragment := p_ipv4Packet; v_firstFragment.ipv4Hdr.totalLength := PX_464XLAT_PLAT_MTU; v_firstFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1; v_firstFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, 0, PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength); v_lastFragment := p_ipv4Packet; v_lastFragment.ipv4Hdr.totalLength := p_ipv4Packet.ipv4Hdr.headerLength + p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag0; v_lastFragment.ipv4Hdr.fragmentOffset := PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, v_lastFragment.ipv4Hdr.fragmentOffset, p_ipv4Packet.ipv4Hdr.headerLength); //receive encapsulated fragments tc_ac.start; alt { [v_firstReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, omit, v_firstFragment // containing first fragment )) { log("*** " & __SCOPE__ & ": First fragmented packet received. ***"); tc_ac.stop; v_firstReceived := true; if (v_lastReceived == false) { tc_ac.start; repeat; } } [v_lastReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, omit, v_lastFragment // containing last fragment )) { log("*** " & __SCOPE__ & ": Last fragmented packet received. ***"); tc_ac.stop; v_lastReceived := true; if (v_firstReceived == false) { tc_ac.start; repeat; } } [] tc_ac.timeout { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***"); } } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); log("*** " & __SCOPE__ & ": PASS: IUT correctly forwarded fragmented packets. ***"); // Postamble f_postamble_host(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_CLATB4_PF_BV_001_host } // End of group f_TC_464XLAT_CLATB4_PF_BV_001 } // End of group validBehaviour } // End of group packetFragmentation Loading Loading @@ -1600,7 +1787,7 @@ module Ats464XLat_TestCases { mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, omit, v_firstFragment // containing first fragment )) { log("*** " & __SCOPE__ & ": First fragmented packet received. ***"); Loading @@ -1615,7 +1802,7 @@ module Ats464XLat_TestCases { mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, omit, v_lastFragment // containing last fragment )) { log("*** " & __SCOPE__ & ": Last fragmented packet received. ***"); Loading
ttcn/Ats464XLat/Ats464XLat_TestControl.ttcn3 +3 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,9 @@ module Ats464XLat_TestControl { control { // CLAT CPE execute(TC_464XLAT_CLAT_B4_BF_BV_001()); execute(TC_464XLAT_CLATB4_BF_BV_001()); execute(TC_464XLAT_CLATB4_PF_BV_001()); execute(TC_464XLAT_CLATB4_MSSC_BV_001()); Loading