Commit 61951ce6 authored by garciay's avatar garciay
Browse files

Re-organise ports mapping

parent 3eabda1e
Loading
Loading
Loading
Loading
+153 −101
Original line number Diff line number Diff line
@@ -37,113 +37,36 @@ module Ats6RD_Functions {
         * @desc Setup communication port
         * @verdict Unchanged
         */
        function f_cf01Up_cpe() runs on SixRDComponent {
            var integer v_hosts;
            var integer v_host;
            
            // Connect port
            if (isbound(vc_brComponent)) { 
                connect(vc_brComponent:brPort, self:brPort);
            }
            if (isbound(vc_dhcpv4Component)) { 
                connect(vc_dhcpv4Component:dhcpv4Port, self:dhcpv4Port);
            } 
            if (isbound(vc_hostComponents)) {
                v_hosts := lengthof(vc_hostComponents);
                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
                    connect(vc_hostComponents[v_host]:ipv6Port, self:ipv6HostPort); 
                    connect(vc_hostComponents[v_host]:ipv4Port, self:ipv4HostPort); 
                }
            } 
            
            // Map ports
            map(self:ipPort, system:ipPort);
            map(self:ipv4Port, system:ipv4Port);
            map(self:utPort, system:utPort);
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            activate(a_default_MTC());
        } // End of function f_cf01Up_cpe
        
        /**
         * @desc Setup communication port
         * @verdict Unchanged
         */
        function f_cf02Up_cpe() runs on SixRDComponent {
            var integer v_hosts;
            var integer v_host;
            
            // Connect port
            if (isbound(vc_brComponent)) { 
                connect(vc_brComponent:brPort, self:brPort);
            }
            if (isbound(vc_hostComponents)) {
                v_hosts := lengthof(vc_hostComponents);
                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
                    connect(vc_hostComponents[v_host]:ipv6Port, self:ipv6HostPort); 
                    connect(vc_hostComponents[v_host]:ipv4Port, self:ipv4HostPort); 
                }
            } 
            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]:ipv6Port, self:ipv6HostPort); 
                    connect(vc_hostHttpComponents[v_host]:ipv4Port, self:ipv4HostPort); 
                }
            } 
            
            // Map ports
            map(self:ipPort, system:ipPort);
            map(self:ipv4Port, system:ipv4Port);
            map(self:utPort, system:utPort);
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            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);
            }
            if (isbound(vc_hostComponents)) {
                v_hosts := lengthof(vc_hostComponents);
                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
                    connect(vc_hostComponents[v_host]:ipv6Port, self:ipv6HostPort); 
                    connect(vc_hostComponents[v_host]:ipv4Port, self:ipv4HostPort); 
                }
            } 
            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]:ipv6Port, self:ipv6HostPort); 
                    connect(vc_hostHttpComponents[v_host]:ipv4Port, self:ipv4HostPort); 
                }
            } 
            
            // Map ports
            map(self:ipPort, system:ipPort);
            map(self:ipv4Port, system:ipv4Port);
        function f_cf01Up() runs on SixRDComponent {
//            var integer v_hosts;
//            var integer v_host;
//            
//            // Connect port
//            if (isbound(vc_brComponent)) { 
//                connect(vc_brComponent:brPort, self:brPort);
//            }
//            if (isbound(vc_dhcpv4Component)) { 
//                connect(vc_dhcpv4Component:dhcpv4Port, self:dhcpv4Port);
//            } 
//            if (isbound(vc_hostComponents)) {
//                v_hosts := lengthof(vc_hostComponents);
//                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
//                    connect(vc_hostComponents[v_host]:ipv6Port, self:ipv6HostPort); 
//                    connect(vc_hostComponents[v_host]:ipv4Port, self:ipv4HostPort); 
//                }
//            } 
//            
//            // Map ports
//            map(self:ipPort, system:ipPort);
//            map(self:ipv4Port, system:ipv4Port);
//            map(self:utPort, system:utPort);
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            activate(a_default_MTC());
        } // End of function f_cf01Up_br
        } // End of function f_cf01Up
        
    } // End of group initialiseFunctions
    
@@ -158,6 +81,13 @@ module Ats6RD_Functions {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:ipPort, system:ipv6Port);
            map(self:brPort, system:ipv4Port);
            map(self:utPort, system:utPort);
            
            activate(a_default_br());
            
        } // End of function f_preamble_aftr
        
        /**
@@ -169,6 +99,13 @@ module Ats6RD_Functions {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:ipv6Port, system:ipv6Port);
            map(self:ipv4Port, system:ipv4Port);
            map(self:utPort, system:utPort);
            
            activate(a_default_host());
            
        } // End of function f_preamble_host
        
        /**
@@ -180,6 +117,9 @@ module Ats6RD_Functions {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:dhcpv4Port, system:dhcpv4Port);
            
        } // End of function f_preamble_dhcpv4
        
        /**
@@ -191,6 +131,12 @@ module Ats6RD_Functions {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:httpPort, system:httpPort);
            map(self:utPort, system:utPort);
            
            activate(a_default_host_http());
            
        } // End of function f_preamble_host_httpv4
        
    } // End of group preambleFunctions
@@ -343,6 +289,112 @@ module Ats6RD_Functions {
            }
        } // End of altstep a_default_MTC 
        
        /**
         * @desc 
         */
        altstep a_default_br() runs on BRComponent {
            [] ipPort.receive  { // Unsolicited messages
                tc_ac.stop;
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected IPv6 message, process it as an error ***");
                f_selfOrClientSyncAndVerdict("error", e_error);
            }
            [] brPort.receive  { // Unsolicited messages
                tc_ac.stop;
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected IPv4 message, process it as an error ***");
                f_selfOrClientSyncAndVerdict("error", e_error);
            }
            [] utPort.receive {
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected UT command, ignoring it ***");
                repeat;
            }
            [] tc_twait.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] tc_ac.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] any timer.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] a_shutdown() {
                f_postamble_br();
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_br
        
        /**
         * @desc 
         */
        altstep a_default_host() runs on HostComponent {
            [] ipv6Port.receive  { // Unsolicited messages
                tc_ac.stop;
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected IPv6 message, process it as an error ***");
                f_selfOrClientSyncAndVerdict("error", e_error);
            }
            [] ipv4Port.receive  { // Unsolicited messages
                tc_ac.stop;
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected IPv4 message, process it as an error ***");
                f_selfOrClientSyncAndVerdict("error", e_error);
            }
            [] utPort.receive {
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected UT command, ignoring it ***");
                repeat;
            }
            [] tc_twait.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] tc_ac.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] any timer.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] a_shutdown() {
                f_postamble_host();
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_host
        
        /**
         * @desc 
         */
        altstep a_default_host_http() runs on HostHTTPComponent {
            [] httpPort.receive  { // Unsolicited messages
                tc_ac.stop;
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected IPv6 message, process it as an error ***");
                f_selfOrClientSyncAndVerdict("error", e_error);
            }
            [] utPort.receive {
                log("*** " & __SCOPE__ & "ERROR: Received an unexpected UT command, ignoring it ***");
                repeat;
            }
            [] tc_twait.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] tc_ac.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] any timer.timeout {
                log("*** " & __SCOPE__ & "ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] a_shutdown() {
                f_postamble_host_http();
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_host_ftp
        
    } // End of group globalSteps
    
    group getFunctions {
+66 −24
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ module Ats6RD_TestCases {
                    
                    // Test component configuration
                    vc_dhcpv4Component := DHCPv4Component.create(c_COMP_DHCPv4);
                    f_cf01Up_cpe();
                    f_cf01Up();
                    
                    
                    // Test adapter configuration
@@ -233,7 +233,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HOST);
                    f_cf02Up_cpe();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -456,7 +456,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    f_cf02Up_cpe();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -615,7 +615,7 @@ module Ats6RD_TestCases {
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_6RD_CPE_PF_BV_001_http
                    } // End of function f_TC_6RD_CPE_PF_BV_001_host_http
                    
                } // End of group f_TC_6RD_CPE_PF_BV_001
                
@@ -671,8 +671,8 @@ module Ats6RD_TestCases {
                    
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    f_cf02Up_cpe();
                    vc_hostComponents[0] := HostComponent.create(c_COMP_HTTP);
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -698,17 +698,59 @@ module Ats6RD_TestCases {
                
                group f_TC_6RD_CPE_PF_BV_002 {
                    
                    function f_TC_6RD_CPE_PF_BV_002_br(in UInt p_noOfDataRequests) runs on BRComponent {
                    function f_TC_6RD_CPE_PF_BV_002_br() runs on BRComponent {
                        
                        // TODO
                        // Local variables
                        
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_br();
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        // Clause when:
                        // TODO brPort.send();
                        
                        // Postamble
                        f_postamble_br();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                            
                    } // End of function f_TC_6RD_CPE_PF_BV_002_br
                    
                    function f_TC_6RD_CPE_PF_BV_002_host_http(in Ipv6Address p_srcAddress, in Ipv6Address p_httpServerAddress, in UInt p_noOfDataRequests) runs on HostHTTPComponent {
                    function f_TC_6RD_CPE_PF_BV_002_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
                            {
                                tc_ac.stop;
                                
                                
                            }
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                                log("*** " & __SCOPE__ & ": INCONC: The IUT drops the packets. ***");
                            }
                        } // End of 'altstep' statement
                        
                        // Postamble
                        f_postamble_host();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                        // TODO

                    } // End of function f_TC_6RD_CPE_PF_BV_002_http
                    } // End of function f_TC_6RD_CPE_PF_BV_002_host
                    
                } // End of group f_TC_6RD_CPE_PF_BV_002
                
@@ -781,7 +823,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_cpe();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -980,7 +1022,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_cpe();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -1190,7 +1232,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -1408,7 +1450,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -1615,7 +1657,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    f_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -1687,7 +1729,7 @@ module Ats6RD_TestCases {
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_6RD_BR_PF_BV_001_http
                    } // End of function f_TC_6RD_BR_PF_BV_001_host_http
                    
                } // End of group f_TC_6RD_BR_PF_BV_001
                
@@ -1744,7 +1786,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    f_cf02Up_cpe();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -1816,7 +1858,7 @@ module Ats6RD_TestCases {
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                        
                    } // End of function f_TC_6RD_BR_PF_BV_002_http
                    } // End of function f_TC_6RD_BR_PF_BV_002_host_http
                    
                } // End of group f_TC_6RD_BR_PF_BV_002
                
@@ -1890,7 +1932,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostComponents[0] := HostComponent.create(c_COMP_HOST);
                    f_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -2122,7 +2164,7 @@ module Ats6RD_TestCases {
                    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();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -2340,7 +2382,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -2559,7 +2601,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
@@ -2778,7 +2820,7 @@ module Ats6RD_TestCases {
                    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_cf01Up_br();
                    f_cf01Up();
                    
                    // Test adapter configuration