Loading ttcn/AtsNAT64/AtsNat64_Functions.ttcn3 +9 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,15 @@ module AtsNat64_Functions { } // End of group globalSteps group getFunctions { function f_getTcpTimeWait() return float { return PX_TCP_TIME_WAIT; } // End of function f_getTcpTimeWait } // End of group getFunctions group auxiliary { function f_decTcpPacket(in octetstring p_raw, out TcpPacket p_tcpPacket) return FncRetCode { Loading ttcn/AtsNAT64/AtsNat64_Pixits.ttcn3 +2 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,6 @@ module AtsNat64_Pixits { } } modulepar float PX_TCP_TIME_WAIT := 15.0; } // End of module AtsNat64_Pixits No newline at end of file ttcn/AtsNAT64/AtsNat64_TestCases.ttcn3 +191 −4 Original line number Diff line number Diff line Loading @@ -257,7 +257,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_BF_BV_002_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_BF_BV_002_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -598,7 +598,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_AW_BV_001_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_AW_BV_001_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -758,7 +758,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_AW_BV_002_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_AW_BV_002_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -918,7 +918,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_AW_BV_003_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_AW_BV_003_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -1204,6 +1204,193 @@ module AtsNat64_TestCases { group validBehaviour { /** * @desc Check that the IUT TCP_time_wait timer expires when required * @verdict pass on success, inconc on timeout, fail otherwise * <pre> * PICS Selection: none * Initial conditions: * with { * the IUT being properly provisioned * and the interfaces are connected & functional * and the IUT TCP_time_wait timer being set * and the IUT having received an IPv6 packet * containing TCP payload * indicating port numbers * } * Expected behaviour: * ensure that { * when { * the TCP_time_wait timer expires * and the IUT having received a second IPv6 packet * containing source address * indicating a different IPv6 address to the first IPv6 packet * containing TCP payload * indicating the same port numbers as the first originating packet * } * then { * the IUT decapsulates the IPv4 packet * and the IUT forwards it on * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.4.6.4 NAT64 LSN timers * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/NAT64/LSN/NT/VB/01 */ testcase TC_NAT64_LSN_NT_BV_001() runs on Nat64Component system TestAdapter { // Local variables var UInt v_hostNum := 0; var Ipv4Packet v_ipv4Packet; /** IPv4 packets */ var Ipv6Packet v_ipv6Packet; /** IPv6 packets address to IPv4 */ var Ipv6Packet v_ipv6Packet2; /** IPv6 packets address to IPv4 */ // Test control // Test component configuration vc_lsnComponents[v_hostNum] := LSNComponent.create(c_COMP_LSN); vc_hostComponents[v_hostNum] := HostComponent.create(c_COMP_HOST & int2str(v_hostNum)); f_cf01Up(); // Test adapter configuration // Test Body // Start all components v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, PX_IPV4_DESTINATION_INFORMATION.iutAddress, m_tcp_packet( PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_hostNum].srcPort, PX_NAT64_MAPPING_TABLE_1_TO_N.dstPort, PX_IPV4_DESTINATION_INFORMATION.payload, m_tcp_flags_syn ) ); v_ipv6Packet := m_generalIpv6_extHdr_data( c_tcpHdr, PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_hostNum].ip6Address, PX_NAT64_PREFIX & c_4ZeroBytes & PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, omit, v_ipv4Packet.ipv4Payload.rawPacket ); v_ipv6Packet2 := v_ipv6Packet; v_ipv6Packet2.ipv6Hdr.sourceAddress := PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_hostNum+1].ip6Address; vc_lsnComponents[v_hostNum].start(f_TC_NAT64_LSN_NT_BV_001_lsn(v_ipv4Packet)); vc_hostComponents[v_hostNum].start(f_TC_NAT64_LSN_NT_BV_001_host(v_ipv6Packet, v_ipv6Packet2)); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); } // End of testcase TC_NAT64_LSN_NT_BV_001 group f_TC_NAT64_LSN_NT_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_NT_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent { // Local variables var FncRetCode v_result; var Ipv4Address v_localAddress := PX_IPV4_DESTINATION_INFORMATION.iutAddress; // Preamble // Clause 'Initial conditions' f_preamble_lsn(v_localAddress); tc_ac.start; alt { [] ipv4Port.receive( mw_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, v_localAddress, ? ) ) { tc_ac.stop; log("*** " & __SCOPE__ & ": IPv4 packet was correctly forwarded. ***"); } [] tc_ac.timeout { v_result := e_timeout; log("*** " & __SCOPE__ & ": Message was not received in time. ***"); } } // End of 'altstep' statement f_selfOrClientSyncAndVerdict(c_prDone, v_result); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body tc_ac.start; alt { [] ipv4Port.receive( mw_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, v_localAddress, ? ) ) { tc_ac.stop; log("*** " & __SCOPE__ & ": IPv4 packet was correctly forwarded. ***"); } [] tc_ac.timeout { v_result := e_timeout; log("*** " & __SCOPE__ & ": Message was not received in time. ***"); } } // End of 'altstep' statement f_selfOrClientSyncAndVerdict(c_tbDone, v_result); // Postamble f_postamble_lsn(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_NAT64_LSN_NT_BV_001_lsn /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_NT_BV_001_host(Ipv6Packet p_ipv6Packet, Ipv6Packet p_ipv6Packet2) runs on HostComponent { // Local variables timer t_tcpTimeWait := f_getTcpTimeWait(); // Preamble // Clause 'Initial conditions' f_preamble_host(); //TODO needs to be called as it sets length and checksum fields // if(f_setExtensionHeaders(v_ipv6Packet) != e_success) { // log(" **** " & __SCOPE__ & ": Error when calculating length of extension headers ****"); // f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // } ipv6Port.send(p_ipv6Packet); t_tcpTimeWait.start; f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body t_tcpTimeWait.timeout; //TODO needs to be called as it sets length and checksum fields // if(f_setExtensionHeaders(v_ipv6Packet) != e_success) { // log(" **** " & __SCOPE__ & ": Error when calculating length of extension headers ****"); // f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // } ipv6Port.send(p_ipv6Packet2); // Postamble f_postamble_host(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_NAT64_LSN_NT_BV_001_host } // End of group f_TC_NAT64_LSN_NT_BV_001 } // End of group validBehaviour } // End of group natTimers Loading Loading
ttcn/AtsNAT64/AtsNat64_Functions.ttcn3 +9 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,15 @@ module AtsNat64_Functions { } // End of group globalSteps group getFunctions { function f_getTcpTimeWait() return float { return PX_TCP_TIME_WAIT; } // End of function f_getTcpTimeWait } // End of group getFunctions group auxiliary { function f_decTcpPacket(in octetstring p_raw, out TcpPacket p_tcpPacket) return FncRetCode { Loading
ttcn/AtsNAT64/AtsNat64_Pixits.ttcn3 +2 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,6 @@ module AtsNat64_Pixits { } } modulepar float PX_TCP_TIME_WAIT := 15.0; } // End of module AtsNat64_Pixits No newline at end of file
ttcn/AtsNAT64/AtsNat64_TestCases.ttcn3 +191 −4 Original line number Diff line number Diff line Loading @@ -257,7 +257,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_BF_BV_002_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_BF_BV_002_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -598,7 +598,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_AW_BV_001_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_AW_BV_001_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -758,7 +758,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_AW_BV_002_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_AW_BV_002_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -918,7 +918,7 @@ module AtsNat64_TestCases { // Test Body // Start all components vc_lsnComponents[v_host].start(f_TC_NAT64_LSN_AW_BV_003_lsn(v_hostNum)); vc_lsnComponents[0].start(f_TC_NAT64_LSN_AW_BV_003_lsn(v_hostNum)); for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, Loading Loading @@ -1204,6 +1204,193 @@ module AtsNat64_TestCases { group validBehaviour { /** * @desc Check that the IUT TCP_time_wait timer expires when required * @verdict pass on success, inconc on timeout, fail otherwise * <pre> * PICS Selection: none * Initial conditions: * with { * the IUT being properly provisioned * and the interfaces are connected & functional * and the IUT TCP_time_wait timer being set * and the IUT having received an IPv6 packet * containing TCP payload * indicating port numbers * } * Expected behaviour: * ensure that { * when { * the TCP_time_wait timer expires * and the IUT having received a second IPv6 packet * containing source address * indicating a different IPv6 address to the first IPv6 packet * containing TCP payload * indicating the same port numbers as the first originating packet * } * then { * the IUT decapsulates the IPv4 packet * and the IUT forwards it on * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.4.6.4 NAT64 LSN timers * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/NAT64/LSN/NT/VB/01 */ testcase TC_NAT64_LSN_NT_BV_001() runs on Nat64Component system TestAdapter { // Local variables var UInt v_hostNum := 0; var Ipv4Packet v_ipv4Packet; /** IPv4 packets */ var Ipv6Packet v_ipv6Packet; /** IPv6 packets address to IPv4 */ var Ipv6Packet v_ipv6Packet2; /** IPv6 packets address to IPv4 */ // Test control // Test component configuration vc_lsnComponents[v_hostNum] := LSNComponent.create(c_COMP_LSN); vc_hostComponents[v_hostNum] := HostComponent.create(c_COMP_HOST & int2str(v_hostNum)); f_cf01Up(); // Test adapter configuration // Test Body // Start all components v_ipv4Packet := m_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, PX_IPV4_DESTINATION_INFORMATION.iutAddress, m_tcp_packet( PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_hostNum].srcPort, PX_NAT64_MAPPING_TABLE_1_TO_N.dstPort, PX_IPV4_DESTINATION_INFORMATION.payload, m_tcp_flags_syn ) ); v_ipv6Packet := m_generalIpv6_extHdr_data( c_tcpHdr, PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_hostNum].ip6Address, PX_NAT64_PREFIX & c_4ZeroBytes & PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, omit, v_ipv4Packet.ipv4Payload.rawPacket ); v_ipv6Packet2 := v_ipv6Packet; v_ipv6Packet2.ipv6Hdr.sourceAddress := PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_hostNum+1].ip6Address; vc_lsnComponents[v_hostNum].start(f_TC_NAT64_LSN_NT_BV_001_lsn(v_ipv4Packet)); vc_hostComponents[v_hostNum].start(f_TC_NAT64_LSN_NT_BV_001_host(v_ipv6Packet, v_ipv6Packet2)); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); } // End of testcase TC_NAT64_LSN_NT_BV_001 group f_TC_NAT64_LSN_NT_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_NT_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent { // Local variables var FncRetCode v_result; var Ipv4Address v_localAddress := PX_IPV4_DESTINATION_INFORMATION.iutAddress; // Preamble // Clause 'Initial conditions' f_preamble_lsn(v_localAddress); tc_ac.start; alt { [] ipv4Port.receive( mw_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, v_localAddress, ? ) ) { tc_ac.stop; log("*** " & __SCOPE__ & ": IPv4 packet was correctly forwarded. ***"); } [] tc_ac.timeout { v_result := e_timeout; log("*** " & __SCOPE__ & ": Message was not received in time. ***"); } } // End of 'altstep' statement f_selfOrClientSyncAndVerdict(c_prDone, v_result); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body tc_ac.start; alt { [] ipv4Port.receive( mw_ipv4Packet_dummy( PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, v_localAddress, ? ) ) { tc_ac.stop; log("*** " & __SCOPE__ & ": IPv4 packet was correctly forwarded. ***"); } [] tc_ac.timeout { v_result := e_timeout; log("*** " & __SCOPE__ & ": Message was not received in time. ***"); } } // End of 'altstep' statement f_selfOrClientSyncAndVerdict(c_tbDone, v_result); // Postamble f_postamble_lsn(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_NAT64_LSN_NT_BV_001_lsn /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_NT_BV_001_host(Ipv6Packet p_ipv6Packet, Ipv6Packet p_ipv6Packet2) runs on HostComponent { // Local variables timer t_tcpTimeWait := f_getTcpTimeWait(); // Preamble // Clause 'Initial conditions' f_preamble_host(); //TODO needs to be called as it sets length and checksum fields // if(f_setExtensionHeaders(v_ipv6Packet) != e_success) { // log(" **** " & __SCOPE__ & ": Error when calculating length of extension headers ****"); // f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // } ipv6Port.send(p_ipv6Packet); t_tcpTimeWait.start; f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body t_tcpTimeWait.timeout; //TODO needs to be called as it sets length and checksum fields // if(f_setExtensionHeaders(v_ipv6Packet) != e_success) { // log(" **** " & __SCOPE__ & ": Error when calculating length of extension headers ****"); // f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // } ipv6Port.send(p_ipv6Packet2); // Postamble f_postamble_host(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_NAT64_LSN_NT_BV_001_host } // End of group f_TC_NAT64_LSN_NT_BV_001 } // End of group validBehaviour } // End of group natTimers Loading