Commit 05ad013e authored by tepelmann's avatar tepelmann
Browse files

Added initial version of TC_464XLAT_PLATLSN_MSSC_BV_001.

parent 5d791654
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -61,4 +61,9 @@ module Ats464XLat_Pixits {
    
    modulepar Ipv4Address PX_PPTP_SERVER_IPV4_ADDRESS := '41d0e4df'O;
    
    /**
     * @desc The MSS value.
     */
    modulepar UInt PX_464XLAT_MSS_SIZE := 1500;
    
} // End of module Ats464XLat_Pixits
 No newline at end of file
+151 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ module Ats464XLat_TestCases {
    import from LibIpv6_Interface_TypesAndValues all;
    import from LibIpv6_Interface_Templates all;
    import from LibIpv6_Rfc2463Icmpv6_Templates all;
    import from LibIpv6_Rfc792Icmpv4_TypesAndValues all;
    import from LibIpv6_Rfc792Icmpv4_Templates all;
    
    // Ats464XLat
    import from Ats464XLat_Functions all;
@@ -252,6 +254,155 @@ module Ats464XLat_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.6 464XLAT Technology Summary
                 * @see     ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/464XLAT/PLAT-LSN/MSSC/VB/01
                 */
                testcase TC_464XLAT_PLATLSN_MSSC_BV_001() runs on FourSixFourXLatComponent 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_PLAT();
                    
                    // Test adapter configuration
                    
                    // Test Body
                    // Start all components
                    f_finalyzeIpv4Packet(
                        m_ipv4Packet_df(
                            1,
                            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[0].srcPort,
                                m_tcpRawPayload(int2oct(42, PX_464XLAT_MSS_SIZE)),
                                m_tcp_flags_syn
                            )
                        ),
                        v_ipv4Packet
                    );
                    
                    vc_lsnComponents[0].start(f_TC_464XLAT_PLATLSN_MSSC_BV_001_lsn(v_ipv4Packet));
                    vc_hostComponents[0].start(f_TC_464XLAT_PLATLSN_MSSC_BV_001_host());
                    
                    f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone });
                    
                    // Postamble
                    f_down();
                    
                } // End of testcase TC_464XLAT_PLATLSN_MSSC_BV_001
                
                group f_TC_464XLAT_PLATLSN_MSSC_BV_001 {
                    
                    /**
                     * @desc Simulates LSN side
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_464XLAT_PLATLSN_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_464XLAT_PLATLSN_MSSC_BV_001_lsn
                    
                    /**
                     * @desc Simulates client side
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_464XLAT_PLATLSN_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 {
                            [] ipPort.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_464XLAT_PLATLSN_MSSC_BV_001_host
                    
                } // End of group f_TC_464XLAT_PLATLSN_MSSC_BV_001 
                
            } // End of group validBehaviour
            
        } // End of group mssClamping