Commit ca22a947 authored by garciay's avatar garciay
Browse files

Re-organise ports mapping in DSLite

Bug fixed in 6RD
parent aa68f8ed
Loading
Loading
Loading
Loading
+44 −58
Original line number Diff line number Diff line
@@ -34,39 +34,50 @@ module Ats6RD_Functions {
    group initialiseFunctions {
        
        /**
         * @desc Setup communication port
         * @desc Setup communication port for CPE role
         * @verdict Unchanged
         */
        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);
        function f_cf01Up_cpe() runs on SixRDComponent {
            
            // Connect InterCompDataPort
            if (isbound(vc_hostHttpComponents) and isbound(vc_brComponent)) {
                var integer v_hosts;
                var integer v_host;
                v_hosts := lengthof(vc_hostComponents);
                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
                    connect(vc_hostHttpComponents[v_host]:dataPort, vc_brComponent:dataPort);
                }
            } 
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            activate(a_default_MTC());
        } // End of function f_cf01Up
        } // End of function f_cf01Up_cpe
        
        /**
         * @desc Setup communication port for BR role
         * @verdict Unchanged
         */
        function f_cf01Up_br() runs on SixRDComponent {
            
            // Connect InterCompDataPort
            if (isbound(vc_hostHttpComponents) and isbound(vc_brComponent)) {
                var integer v_hosts;
                var integer v_host;
                v_hosts := lengthof(vc_hostComponents);
                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
                    connect(vc_hostHttpComponents[v_host]:dataPort, vc_brComponent:dataPort);
                }
            } 
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            activate(a_default_MTC());
        } // End of function f_cf01Up_br
        
    } // End of group initialiseFunctions
    
@@ -78,6 +89,7 @@ module Ats6RD_Functions {
         * @see BRComponent
         */
        function f_preamble_br() runs on BRComponent {
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
@@ -252,41 +264,15 @@ module Ats6RD_Functions {
         * TODO enable functionality!
         */
        altstep a_default_MTC() runs on SixRDComponent {
            var Ipv6Packet v_ipv6Pkt;
            var Ipv4Packet v_ipv4Pkt;
            var DHCPv6Msg v_dhcpMsg;
            var DnsMsg v_dnsMsg;
            
//            [] ipv4HostPort.receive(Ipv4Packet:?) -> value v_ipv4Pkt {
//                ipv4Port.send(v_ipv4Pkt);
//                repeat;
//            }
//            [] ipv6HostPort.receive(Ipv6Packet:?) -> value v_ipv6Pkt {
//                ipPort.send(v_ipv6Pkt);
//                repeat;
//            }
            [] ipPort.receive { // Unsupported IPv6 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);
            }
            [] tc_wait.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() {
                log("*** " & __SCOPE__ & "INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_MTC 
        
        /**
@@ -321,7 +307,7 @@ module Ats6RD_Functions {
            }
            [] a_shutdown() {
                f_postamble_br();
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                log("*** " & __SCOPE__ & "INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_br
@@ -358,7 +344,7 @@ module Ats6RD_Functions {
            }
            [] a_shutdown() {
                f_postamble_host();
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                log("*** " & __SCOPE__ & "INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_host
@@ -390,7 +376,7 @@ module Ats6RD_Functions {
            }
            [] a_shutdown() {
                f_postamble_host_http();
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                log("*** " & __SCOPE__ & "INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of altstep a_default_host_ftp
+15 −15
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();
                    f_cf01Up_cpe();
                    
                    
                    // 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_cf01Up();
                    f_cf01Up_cpe();
                    
                    // 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); // TODO Add support of multiple host
                    f_cf01Up();
                    f_cf01Up_cpe();
                    
                    // Test adapter configuration
                    
@@ -672,7 +672,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    f_cf01Up();
                    f_cf01Up_cpe();
                    
                    // Test adapter configuration
                    
@@ -818,7 +818,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();
                    f_cf01Up_cpe();
                    
                    // Test adapter configuration
                    
@@ -1017,7 +1017,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();
                    f_cf01Up_cpe();
                    
                    // Test adapter configuration
                    
@@ -1227,7 +1227,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();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -1445,7 +1445,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();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -1652,7 +1652,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP); // TODO Add support of multiple host
                    f_cf01Up();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -1782,7 +1782,7 @@ module Ats6RD_TestCases {
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    f_cf01Up();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -1932,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();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -2164,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_cf01Up();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -2382,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();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -2601,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();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
@@ -2820,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();
                    f_cf01Up_br();
                    
                    // Test adapter configuration
                    
+4 −0
Original line number Diff line number Diff line
@@ -49,9 +49,13 @@ module AtsCommon_Functions {
         * @see DHCPv6Component
         */
        function f_preamble_dhcpv6() runs on DHCPv6Component {
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:dhcpv6Port, system:dhcpv6Port);
            
            activate(a_dhcpv6Default());
            
        } // End of function f_preamble_dhcpv6
+146 −164

File changed.

Preview size limit exceeded, changes collapsed.

+1 −13
Original line number Diff line number Diff line
@@ -41,9 +41,7 @@ module AtsDSLite_Interfaces {
        
        /**
         * @desc 
         * @member dhcpv6Port
         * @member dnsPort
         * @member aftrPort

         * @member ipv6HostPort
         * @member ipv4HostPort
         * @member vc_aftrComponent
@@ -52,16 +50,6 @@ module AtsDSLite_Interfaces {
         * @member vc_dnsComponent
         */
        type component DSLiteComponent extends UtComponent, LibIpv6Node {
            /** DHCPv6 port for DHCPv6Msg message exchanges */
            port DHCPv6Port dhcpv6Port;
            /** DNSv4 port for DNSv4Msg message exchanges */
            port DNSPort dnsPort;
            /** AFTR port */
            port Ipv6Port aftrPort;
            /** Host IPv6 port to simulate IPv6 client */
            port Ipv6Port ipv6HostPort;
            /** Host IPv4 port to simulate IPv4 client */
            port Ipv4Port ipv4HostPort;
            /** AFTR component reference */
            var AFTRComponent vc_aftrComponent := null;
            /** Host component reference */
Loading