Commit 9f2b47f5 authored by garciay's avatar garciay
Browse files

Add TC SI-ID Tunnel Identifiers

Remove useless PIXITs
Add f_cf01Up_br function
parent 2f46d8fa
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -96,6 +96,37 @@ module Ats6RD_Functions {
            activate(a_default_MTC());
        } // End of function f_cf02Up_cpe
        
        /**
         * @desc Setup communication port for BR role
         * @verdict Unchanged
         */
        function f_cf01Up_br() runs on SixRDComponent {
            var integer v_hosts;
            var integer v_host;
            
            // Connect port
            if (isbound(vc_brComponent)) { 
                connect(vc_brComponent:brPort, self:brPort);
            }
            // TODO To be removed
//            if (isbound(vc_hostHttpComponents)) {
//                v_hosts := lengthof(vc_hostHttpComponents);
//                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
//                    connect(vc_hostHttpComponents[v_host]:httpPort, self:httpPort); 
//                }
//            } 
            
            // Map ports
            map(self:ipPort, system:ipPort);
            map(self:ipv4Port, system:ipv4Port);
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            activate(a_default_MTC());
        } // End of function f_cf01Up_br
        
    } // End of group initialiseFunctions
    
    group preambleFunctions {
+47 −15
Original line number Diff line number Diff line
@@ -6,9 +6,7 @@
module Ats6RD_Pixits {
    
    // LibCommon
    import from LibCommon_DataStrings {
        const c_4ZeroBytes, c_16ZeroBytes
    };
    import from LibCommon_DataStrings all;
    
    // LibIPv6
    import from LibIpv6_CommonRfcs_TypesAndValues all;
@@ -24,7 +22,7 @@ module Ats6RD_Pixits {
    /**
     * @desc Indicates the IPv6 address of the CPE equipment
     */
    modulepar Ipv6Address PX_CPE_IPv6_ADDRESS := c_16ZeroBytes;
    modulepar Ipv6Address PX_CPE_IPv6_ADDRESS := c_16ZeroBytes; // TODO To be removed?
    
    /**
     * @desc Indicates the IPv4 address of the CPE equipment
@@ -53,17 +51,6 @@ module Ats6RD_Pixits {
        // TODO Could be extended 
    } // End of modulepar PX_MSSC_HOST_V6_LIST_CPE
    
    /**
     * @desc Defines a list of IPv6 HTTP services
     */
    modulepar HttpV6Descriptions PX_HTTP_V6_LIST_CPE := {
        {
            srcAddress  := c_16ZeroBytes, // Containing the HTTP source address
            dstAddress  := c_16ZeroBytes // Containing WEB server address
        } // Host #0
        // TODO Could be extended 
    } // End of modulepar PX_HTTP_V6_LIST_CPE
    
    /**
     * @desc The host address
     */
@@ -74,4 +61,49 @@ module Ats6RD_Pixits {
     */
    modulepar Ipv6Address PX_WEB_SERVER_IPv6 :=  c_16ZeroBytes; 
    
    /**
     * @desc Indicates IPv4 address of multiple CPE equipments
     * @remark The size os this set shall be equal to the size of PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs, one host per CPE 
     * @see TC_6RD_CPE_TI_BV_001
     */
    modulepar CpeIPv4Addresses PX_MULTIPLE_CPEs_ADDRESS := {
        c_4ZeroBytes, // Such as 10.1.0.1
        c_4ZeroBytes, // Such as 10.1.1.1
        c_4ZeroBytes // Such as 10.1.2.1
    };
    
    /**
     * @desc Defines a list of IPv6 host services with a segment size greater than the IUT MSS value
     * @see TC_6RD_CPE_TI_BV_001
     */
    modulepar HostV6Descriptions PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs := {
        {
            srcAddress  := c_16ZeroBytes, // Containing source address indicating a private IPv6 address from CPE #0
            srcPort     := 0,
            dstAddress  := c_16ZeroBytes, // Containing destination address indicating a public IPv6 address from multiple hosts
            dstPort     := 0,
            payload     := {
                rawPayload := 'CAFEDECA'O 
            } 
        }, // Host #0
        {
            srcAddress  := c_16ZeroBytes, // Containing source address indicating a private IPv6 address from CPE #1
            srcPort     := 0,
            dstAddress  := c_16ZeroBytes, // Containing destination address indicating a public IPv6 address from multiple hosts
            dstPort     := 0,
            payload     := {
                rawPayload := 'CAFEDECA'O 
            } 
        }, // Host #1
        {
            srcAddress  := c_16ZeroBytes, // Containing source address indicating a private IPv6 address from CPE #2
            srcPort     := 0,
            dstAddress  := c_16ZeroBytes, // Containing destination address indicating a public IPv6 address from multiple hosts
            dstPort     := 0,
            payload     := {
                rawPayload := 'CAFEDECA'O 
            } 
        } // Host #2
    } // End of modulepar PX_MSSC_HOST_V6_LIST_CPE
    
} // End of module Ats6RD_Pixits
 No newline at end of file
+145 −50
Original line number Diff line number Diff line
@@ -260,39 +260,6 @@ module Ats6RD_TestCases {
                
                group f_TC_6RD_CPE_BF_BV_001 {
                    
                    /**
                     * @desc Implements multiple host side behavior
                     * @param p_host The host to simulate
                     * @verdict pass on success, inconc on timeout, fail otherwise
                     */
                    function f_TC_6RD_CPE_BF_BV_001_host_http(in Ipv6Address p_srcAddress, in Ipv6Address p_httpServerAddress, in UInt p_noOfDataRequests) runs on HostHTTPv6Component {
                        
                        // Local variables
                        var FncRetCode v_result := e_error;
                        
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_host_httpv6();
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        // Clause 'when': the IUT receives multiple HTML IPv6 packets 
                        v_result := f_httpv6SendData(
                            p_srcAddress,                                   // containing source address indicating a public IPv6 address
                            p_httpServerAddress,                            // containing destination address indicating a public IPv6 address
                            p_noOfDataRequests);                            // from multiple hosts
                        
                        // Clause 'then': Nothing to do
                        f_selfOrClientSyncAndVerdict(c_tbDone, v_result);
                        
                        // Postamble
                        f_postamble_host_httpv6();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of f_TC_6RD_CPE_BF_BV_001_host_http
                    
                    /**
                     * @desc Implements BR side behavior
                     * @param p_hostBrDataMsgs The list of the expected IPv4 packet t be forwarded
@@ -353,6 +320,39 @@ module Ats6RD_TestCases {
                        
                    } // End of function f_TC_6RD_CPE_BF_BV_001_br
                    
                    /**
                     * @desc Implements multiple host side behavior
                     * @param p_host The host to simulate
                     * @verdict pass on success, inconc on timeout, fail otherwise
                     */
                    function f_TC_6RD_CPE_BF_BV_001_host_http(in Ipv6Address p_srcAddress, in Ipv6Address p_httpServerAddress, in UInt p_noOfDataRequests) runs on HostHTTPv6Component {
                        
                        // Local variables
                        var FncRetCode v_result := e_error;
                        
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_host_httpv6();
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        // Clause 'when': the IUT receives multiple HTML IPv6 packets 
                        v_result := f_httpv6SendData(
                            p_srcAddress,                                   // containing source address indicating a public IPv6 address
                            p_httpServerAddress,                            // containing destination address indicating a public IPv6 address
                            p_noOfDataRequests);                            // from multiple hosts
                        
                        // Clause 'then': Nothing to do
                        f_selfOrClientSyncAndVerdict(c_tbDone, v_result);
                        
                        // Postamble
                        f_postamble_host_httpv6();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of f_TC_6RD_CPE_BF_BV_001_host_http
                    
                } // End of group f_TC_6RD_CPE_BF_BV_001
                
            } // End of group validBehaviour
@@ -777,7 +777,7 @@ module Ats6RD_TestCases {
                    function f_TC_6RD_CPE_MSSC_BV_001_br(in HostBrDataMsgs p_hostBrDataMsgs) runs on BRComponent {
                        
                        // Local variables
                        var integer v_hostNum := lengthof(PX_HTTP_V6_LIST_CPE); /** Expected number of IPv6 packets to be forwarded */
                        var integer v_hostNum := lengthof(PX_MSSC_HOST_V6_LIST_CPE);    /** Expected number of IPv6 packets to be forwarded */
                        var Ipv6Packet v_ipv6Packet;                                    /** Received IPv6 packet */
                        var ResultsList v_results;                                      /** List of flags indicating the linked IPv4 packet was forwarded */
                        var integer v_host;                                             /** 'for' statement counter */
@@ -917,7 +917,10 @@ module Ats6RD_TestCases {
                testcase TC_6RD_CPE_TI_BV_001() runs on SixRDComponent system TestAdapter {
                    
                    // Local variables
                    var UInt v_noOfDataRequests := 1;
                    var integer v_hostNum := lengthof(PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs);    /** Expected number of IPv6 packets to be forwarded */
                    var HostBrDataMsgs v_hostBrDataMsgs;                                        /** Expected of IPv6 packets to be forwarded */
                    var Ipv6Packet v_ipv6Packet;                                                /** IPv6 packets to be sent */
                    var integer v_host;                                                         /** 'for' statement counter */
                    
                    // Test control
                    if (not(PICS_ROLE_IS_CPE)) {
@@ -927,25 +930,41 @@ module Ats6RD_TestCases {
                    
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpv6Components[0] := HostHTTPv6Component.create(c_COMP_HTTP);
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        vc_hostComponents[v_host] := HostComponent.create(c_COMP_HOST & int2str(v_host));
                    } // End of 'for' statement 
                    f_cf02Up_cpe();
                    
                    // Test adapter configuration
                    
                    // Build the list of the IPv6packet to be sent
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        // Build IPv6 packet
                        v_ipv6Packet := m_echoRequest_noExtHdr_data(
                            PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs[v_host].srcAddress,
                            PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs[v_host].dstAddress,
                            c_defId,
                            c_defSeqNo,
                            PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs[v_host].payload.rawPayload
                        );
                        f_setExtensionHeaders(v_ipv6Packet);
                        // Add item into the list
                        v_hostBrDataMsgs[v_host].hostId := v_host;
                        v_hostBrDataMsgs[v_host].payload.ipv6Packet := v_ipv6Packet;
                    } // End of 'for' statement 
                    
                    // Start all components
//                    vc_brComponent.start(f_TC_6RD_CPE_TI_BV_001_br(v_noOfDataRequests));
//                    vc_hostHttpv6Components[0].start(f_TC_6RD_CPE_TI_BV_001_host_http(
//                        PX_HTTP_CLIENT_IPV6_ADDRESS,
//                        PX_WEB_SERVER_IPv6,
//                        v_noOfDataRequests
//                    ));
                    vc_brComponent.start(f_TC_6RD_CPE_TI_BV_001_br(v_hostBrDataMsgs));
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        vc_hostComponents[v_host].start(f_TC_6RD_CPE_TI_BV_001_host(v_hostBrDataMsgs[v_host]));
                    } // End of 'for' statement 
                    
                    // Test Body
                    // Clause 'when':  
                    // Clause 'when': Nothing to do 
                    
                    // Clause 'then': Nothing to do, refer to a_default
                    
                    f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone });
                    f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone });
                    
                    // Postamble
                    f_down();
@@ -954,9 +973,85 @@ module Ats6RD_TestCases {
                
                group f_TC_6RD_CPE_TI_BV_001 {
                    
                    function f_TC_6RD_CPE_TI_BV_001_br(in UInt p_noOfDataRequests) runs on BRComponent {} // End of function f_TC_6RD_CPE_TI_BV_001_br
                    function f_TC_6RD_CPE_TI_BV_001_br(in HostBrDataMsgs p_hostBrDataMsgs) runs on BRComponent {
                        // Local variables
                        var integer v_hostNum := lengthof(p_hostBrDataMsgs);    /** Expected number of IPv6 packets to be forwarded */
                        var ResultsList v_results;                              /** List of flags indicating the linked IPv4 packet was forwarded */
                        var Ipv4Packet v_ipv4Packet;                            /** Received IPv4 packet */
                        var integer v_host;                                     /** 'for' statement counter */
                         
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_br();
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                    function f_TC_6RD_CPE_TI_BV_001_host_http(in Ipv6Address p_srcAddress, in Ipv6Address p_httpServerAddress, in UInt p_noOfDataRequests) runs on HostHTTPv6Component {} // End of function f_TC_6RD_CPE_TI_BV_001_http
                        // Test Body
                        // Clause 'when': the IUT receives multiple HTML IPv4 packets 
                        tc_ac.start;
                        alt {
                            [] brPort.receive(
                                mw_ipv4Packet_tcp(
                                    c_tunneledIpHdr,
                                    ?,
                                    ? 
                                
                            )) -> value v_ipv4Packet {
                                tc_ac.stop;
                                for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                                    if (v_ipv4Packet.ipv4Hdr.sourceAddress == PX_MULTIPLE_CPEs_ADDRESS[v_host]) { // Check tunnel identifier
                                        // Check matching host/CPE
                                        if (p_hostBrDataMsgs[v_host].payload.ipv6Packet.ipv6Hdr.sourceAddress == PX_MULTIPLE_HOSTS_FROM_MULTIPLE_CPEs[v_host].srcAddress) {
                                            log("*** " & __SCOPE__ & ": INFO: Receives encapsulated IPv4 packet #", v_host, ". ***");
                                            v_results[v_host] := true;
                                            break;
                                        }
                                   }
                                } // End of 'for' statement 
                                if (lengthof(v_results) == v_hostNum) { // Check current result 
                                    log("*** " & __SCOPE__ & ": PASS: All tunnel identifiers were uniquely associated with a single CPE. ***");
                                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                                } else {
                                    tc_ac.start;
                                    repeat;
                                }
                            }
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***");
                            }
                        } // End of 'altstep' statement
                        
                        // Postamble
                        f_postamble_br();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_6RD_CPE_TI_BV_001_br
                    
                    function f_TC_6RD_CPE_TI_BV_001_host(in HostBrDataMsg p_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
                        // Clause 'when': the IUT receives multiple HTML IPv6 packets 
                        ipv6Port.send(p_host.payload.ipv6Packet);
                        
                        // Clause 'then': Nothing to do 
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success); 
                        
                        // Postamble
                        f_postamble_host();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_6RD_CPE_TI_BV_001_http
                    
                } // End of group f_TC_6RD_CPE_MSSC_BV_001
                
@@ -1035,7 +1130,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpv6Components[0] := HostHTTPv6Component.create(c_COMP_HOST);
                    f_cf01Up_cpe();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
+2 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ module Ats6RD_TypesAndValues {
     */
    type record of HostBrDataMsg HostBrDataMsgs;
    
    type record length(1..infinity) of Ipv4Address CpeIPv4Addresses;
    
    group httpTypes {
        
        /**