Commit d6ace6e4 authored by tepelmann's avatar tepelmann
Browse files

Initial version of TC_NAT64_LSN_MSSC_BV_001.

parent d0fac592
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ module AtsCommon_Interfaces {
            map param (in Ipv4Address p_ip4Address);
            inout
            //Ipv4
            Ipv4Packet, Ipv4EchoRequest
            Ipv4Packet, Ipv4EchoRequest, Ipv4DestinationUnreachable
        }
        
        /**
+4 −0
Original line number Diff line number Diff line
@@ -136,6 +136,10 @@ module AtsCommon_Templates {
                syn     := '1'B
            } // End m_tcp_flags_syn
            
            template (value) TcpPayload m_tcpRawPayload(in template (value) octetstring p_rawPayload) := {
                rawPayload := p_rawPayload
            }
            
        } // End of group tcpDummySendTemplates
        
        group tcpMessagesDummyRecvTemplates {
+11 −3
Original line number Diff line number Diff line
@@ -5,9 +5,12 @@
 */
module AtsNat64_Pixits {
    
    import from LibIpv6_CommonRfcs_TypesAndValues all;

    // LibCommon
    import from LibCommon_DataStrings all;
    import from LibCommon_BasicTypesAndValues all;
    
    // LibIpv6
    import from LibIpv6_CommonRfcs_TypesAndValues all;
    
    // AtsCommon
    import from AtsCommon_TypesAndValues all;
@@ -101,4 +104,9 @@ module AtsNat64_Pixits {
    
    modulepar Ipv4Address PX_PPTP_SERVER_IPV4_ADDRESS := '41d0e4df'O;
    
    /**
     * @desc The MSS value.
     */
    modulepar UInt PX_NAT64_MSS_SIZE := 1500;
    
} // End of module AtsNat64_Pixits
 No newline at end of file
+151 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@ module AtsNat64_TestCases {
    
    // LibIpv6
    import from LibIpv6_Rfc2463Icmpv6_Templates all;
    import from LibIpv6_Rfc792Icmpv4_Templates all;
    import from LibIpv6_Rfc792Icmpv4_TypesAndValues all;
    
    // AtsNat64
    import from AtsNat64_Functions all;
@@ -1045,6 +1047,155 @@ module AtsNat64_TestCases {
            
            group validBehaviour {
                
                /**
                 * @desc Check that the IUT functions with MSS clamping
                 * @verdict pass on success, inconc on timeout, fail otherwise
                 * <pre>        
                 * PICS Selection: none 
                 * Initial conditions:
                 *  with {
                 *      the physical MTU (Phy-MTU) size being equal or greater than the IPv6 packet between all devices
                 *      and the MTU (IPv6-MTU) being lower than the originating IPv6 packet
                 *      and the MSS value is below that of the TCP segment size of the incoming packet
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT receives an HTML IPv4 packet
                 *              containing source address
                 *                  indicating a private IPv4 address
                 *          with a segment size greater than the IUT MSS value
                 *      }
                 *      then {
                 *          the IUT drops the packet and returns a packet-too-big message to the originator
                 *      }
                 *  }
                 * </pre>
                 * 
                 * @version 0.0.1
                 * @reference ETSI TS 101 569-1 Clause 6.4.9 Technical Viability
                 * @see     ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/NAT64/LSN/MSSC/VB/01
                 */
                testcase TC_NAT64_LSN_MSSC_BV_001() runs on Nat64Component system TestAdapter {
                    
                    // Local variables
                    var Ipv4Packet v_ipv4Packet;                                /** IPv4 packets */
                    
                    // Test control
                    
                    // Test component configuration
                    vc_lsnComponents[0] := LSNComponent.create(c_COMP_LSN);
                    vc_hostComponents[0] := HostComponent.create(c_COMP_HOST);
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Test Body
                    // Start all components
                    f_finalyzeIpv4Packet(
                        m_ipv4Packet_df(
                            1,
                            PX_IPV4_DESTINATION_INFORMATION.iutAddress,
                            PX_NAT64_MAPPING_TABLE_1_TO_1.mapInfos[0].ip4Address,
                            m_tcp_packet(
                                PX_IPV4_DESTINATION_INFORMATION.iutPort,
                                PX_NAT64_MAPPING_TABLE_1_TO_1.etsPort,
                                m_tcpRawPayload(int2oct(42, PX_NAT64_MSS_SIZE + 10)),
                                m_tcp_flags_syn
                            )
                        ),
                        v_ipv4Packet
                    );
                    
                    vc_lsnComponents[0].start(f_TC_NAT64_LSN_MSSC_BV_001_lsn(v_ipv4Packet));
                    vc_hostComponents[0].start(f_TC_NAT64_LSN_MSSC_BV_001_host());
                    
                    f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone });
                    
                    // Postamble
                    f_down();
                    
                } // End of testcase TC_NAT64_LSN_MSSC_BV_001
                
                group f_TC_NAT64_LSN_MSSC_BV_001 {
                    
                    /**
                     * @desc Simulates LSN side
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_NAT64_LSN_MSSC_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent {
                        
                        // Local variables
                         
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_lsn(p_ipv4Packet.ipv4Hdr.destinationAddress);
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        ipv4Port.send(p_ipv4Packet);
                        tc_ac.start;
                        alt {
                            [] ipv4Port.receive(mw_ipv4DestinationUnreachable(
                                p_ipv4Packet.ipv4Hdr.destinationAddress,
                                p_ipv4Packet.ipv4Hdr.sourceAddress,
                                c_ipv4IcmpCode4 //fragmentation needed and DF set
                            )) {
                                tc_ac.stop;
                                log("*** " & __SCOPE__ & ": PASS: A 'packet-too-big' was returned. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                            [] tc_ac.timeout {
                                log("*** " & __SCOPE__ & ": PASS: NO 'packet-too-big' was returned. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                        }
                        
                        // Postamble
                        f_postamble_lsn();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_NAT64_LSN_MSSC_BV_001_lsn
                    
                    /**
                     * @desc Simulates client side
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_NAT64_LSN_MSSC_BV_001_host() runs on HostComponent {
                        
                        // Local variables
                         
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_host();
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        tc_ac.start;
                        alt {
                            [] ipv6Port.receive(Ipv6Packet:?) { 
                                tc_ac.stop;
                                log("*** " & __SCOPE__ & ": FAIL: The packet was not dropped. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                                log("*** " & __SCOPE__ & ": PASS: The packet was dropped. ***");
                            }
                        } // End of 'altstep' statement
                        
                        // Postamble
                        f_postamble_host();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_NAT64_LSN_MSSC_BV_001_host
                    
                } // End of group f_TC_NAT64_LSN_MSSC_BV_001 
                
            } // End of group validBehaviour
            
        } // End of group mssClamping