Commit 73be814a authored by garciay's avatar garciay
Browse files

Minor bugs fixed

TC_MAPE_CPE_GWA_BV_02 testcase review
parent 01b3c5bd
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2052,6 +2052,7 @@ module AtsDSLite_TestCases {
                                    log("*** " & __SCOPE__ & ": IPv4 packet was correctly forwarded. ***");
                                    log("*** " & __SCOPE__ & ": IPv4 packet was correctly forwarded. ***");
                                    if (v_nbrReceived != p_noOfDataRequests) {
                                    if (v_nbrReceived != p_noOfDataRequests) {
                                        v_nbrReceived := v_nbrReceived + 1;
                                        v_nbrReceived := v_nbrReceived + 1;
                                        tc_ac.start;
                                        repeat;
                                        repeat;
                                    }
                                    }
                                }
                                }
+78 −13
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ module AtsMapE_TestCases {
    import from LibIpv6_Interface_Functions all;
    import from LibIpv6_Interface_Functions all;
    import from LibIpv6_Rfc2463Icmpv6_Templates all;
    import from LibIpv6_Rfc2463Icmpv6_Templates all;
    import from LibIpv6_Rfc792Icmpv4_Templates all;
    import from LibIpv6_Rfc792Icmpv4_Templates all;
    import from LibIpv6_Rfc2461NeighborDiscovery_Templates all;
    
    
    // AtsCommon
    // AtsCommon
    import from AtsCommon_TypesAndValues all;
    import from AtsCommon_TypesAndValues all;
@@ -1653,6 +1654,7 @@ module AtsMapE_TestCases {
                    }
                    }
                    
                    
                    // Test component configuration
                    // Test component configuration
                    vc_brComponents[0] := BRComponent.create(c_COMP_AFTR);
                    vc_dhcpv6Component := HostComponent.create(c_COMP_DHCP);
                    vc_dhcpv6Component := HostComponent.create(c_COMP_DHCP);
                    vc_hostComponents[0] := HostComponent.create(c_COMP_HTTP);
                    vc_hostComponents[0] := HostComponent.create(c_COMP_HTTP);
                    f_mtcUp();
                    f_mtcUp();
@@ -1660,6 +1662,7 @@ module AtsMapE_TestCases {
                    // Test adapter configuration
                    // Test adapter configuration
                    
                    
                    // Start all components
                    // Start all components
                    vc_brComponents[0].start(f_TC_MAPE_CPE_GWA_BV_02_br());
                    vc_dhcpv6Component.start(f_TC_MAPE_CPE_GWA_BV_01_dhcpv6());
                    vc_dhcpv6Component.start(f_TC_MAPE_CPE_GWA_BV_01_dhcpv6());
                    vc_hostComponents[0].start(f_TC_MAPE_CPE_GWA_BV_02_host_http(
                    vc_hostComponents[0].start(f_TC_MAPE_CPE_GWA_BV_02_host_http(
                        PX_MAPE_MAPPING_TABLE_A_PLUS_P.mapInfos[0].ip4Address,
                        PX_MAPE_MAPPING_TABLE_A_PLUS_P.mapInfos[0].ip4Address,
@@ -1667,7 +1670,7 @@ module AtsMapE_TestCases {
                        v_noOfDataRequests
                        v_noOfDataRequests
                    ));
                    ));
                    
                    
                    f_serverSyncNClientsAndStop(2, { c_prDone, c_startDefaultRouteCheck, c_tbDone, c_poDone });
                    f_serverSyncNClientsAndStop(3, { c_prDone, c_startDefaultRouteCheck, c_tbDone, c_poDone });
                    
                    
                    // Test Body
                    // Test Body
                    action("the IUT goes online");
                    action("the IUT goes online");
@@ -1681,6 +1684,57 @@ module AtsMapE_TestCases {
                
                
                group f_TC_MAPE_CPE_GWA_BV_02 {
                group f_TC_MAPE_CPE_GWA_BV_02 {
                    
                    
                    /**
                     * @desc Implements BR side behavior
                     * @verdict pass on success, inconc on timeout, fail otherwise
                     */
                    function f_TC_MAPE_CPE_GWA_BV_02_br() runs on BRComponent {
                        
                        // Local variables
                        var FncRetCode v_result := e_success;
                        
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_br(c_4ZeroBytes/*Not used*/);
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        tc_ac.start;
                        alt {
                            [] ipPort.receive(
                                mw_rtAdv_noExtHdr(
                                    ?, // TODO Check the rtAdv values
                                    ?
                            )) { 
                                tc_ac.stop;
                                // Nothing to do
                                log("*** " & __SCOPE__ & ": INFO: RA message was sent by the IUT. ***");
                            }
                            [] ipPort.receive(Ipv6Packet:?) { 
                                tc_ac.stop;
                                tc_ac.start;
                                repeat;
                            }
                            [] tc_ac.timeout {
                                v_result := e_timeout;
                                log("*** " & __SCOPE__ & ": PASS: The IUT drops the packets. ***");
                            }
                        } // End of 'altstep' statement
                        
                        // Check the default route configuration using v_ia_naAddress
                        f_selfOrClientSyncAndVerdict(c_startDefaultRouteCheck, e_success);
                        
                        f_selfOrClientSyncAndVerdict(c_tbDone, v_result);
                        log("*** " & __SCOPE__ & ": PASS: Successfully received DHCPv6 Reply from the DHCPv6 Server. ***");
                        
                        // Postamble
                        f_postamble_br();
                        f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                    
                    } // End of function f_TC_MAPE_CPE_GWA_BV_02
                    
                    /**
                    /**
                     * @desc Implement DHCPv6 client/server protocol
                     * @desc Implement DHCPv6 client/server protocol
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
@@ -1690,6 +1744,7 @@ module AtsMapE_TestCases {
                        // Local variables
                        // Local variables
                        var DHCPv6Msg   v_dhcpMsg;
                        var DHCPv6Msg   v_dhcpMsg;
                        var Ipv6Address v_ia_naAddress;
                        var Ipv6Address v_ia_naAddress;
                        var FncRetCode v_result := e_success;
                        
                        
                        // Preamble
                        // Preamble
                        // Clause 'Initial conditions'
                        // Clause 'Initial conditions'
@@ -1707,15 +1762,15 @@ module AtsMapE_TestCases {
                            )) { 
                            )) { 
                                tc_ac.stop;
                                tc_ac.stop;
                                // Nothing to do
                                // Nothing to do
                                log("*** " & __SCOPE__ & ": PASS: Solicit DHCPv6 Request was sent by the IUT. ***");
                                log("*** " & __SCOPE__ & ": INFO: Solicit DHCPv6 Request was sent by the IUT. ***");
                            }
                            }
                            [] tc_ac.timeout {
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                                v_result := e_timeout;
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***");
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***");
                            }
                            }
                        } // End of 'altstep' statement
                        } // End of 'altstep' statement
                        
                        
                        // Clause 'when': the IUT adds the LSN GW IPv6 address to the default route configuration
                        // Clause 'when': the IUT adds the GW IPv6 address to the default route configuration
                        tc_ac.start;
                        tc_ac.start;
                        alt { 
                        alt { 
                            [] dhcpv6Port.receive(                              // Await Reply DHCPv6 message to store IPv6 addresses
                            [] dhcpv6Port.receive(                              // Await Reply DHCPv6 message to store IPv6 addresses
@@ -1723,9 +1778,9 @@ module AtsMapE_TestCases {
                                    mw_dhcpv6_options_dummy
                                    mw_dhcpv6_options_dummy
                            )) -> value v_dhcpMsg {
                            )) -> value v_dhcpMsg {
                                tc_ac.stop;
                                tc_ac.stop;
                                // Prepare data to be sent to the DNS component
                                // Extract 
                                if (f_getDHCPv6RetrievedIpv6Address(v_dhcpMsg, v_ia_naAddress)==e_error) {
                                if (f_getDHCPv6RetrievedIpv6Address(v_dhcpMsg, v_ia_naAddress)==e_error) {
                                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                                    v_result := e_error;
                                    log("*** " & __SCOPE__ & ": FAIL: Message did not include IA_NA option. ***");
                                    log("*** " & __SCOPE__ & ": FAIL: Message did not include IA_NA option. ***");
                                }
                                }
                            }
                            }
@@ -1734,8 +1789,13 @@ module AtsMapE_TestCases {
                                log("*** " & __SCOPE__ & ": INFO: Skip unprocessed DHCPv6 message. ***");
                                log("*** " & __SCOPE__ & ": INFO: Skip unprocessed DHCPv6 message. ***");
                                repeat;
                                repeat;
                            }
                            }
                            [] dhcpv6Port.receive(DHCPv6Msg:?) { // Skip unprocessed DHCPv6 message
                                // Do not re-start timer
                                log("*** " & __SCOPE__ & ": INFO: Skip unprocessed DHCPv6 message. ***");
                                repeat;
                            }
                            [] tc_ac.timeout {
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                                v_result := e_timeout;
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***");
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***");
                            }
                            }
                        } // End of 'altstep' statement
                        } // End of 'altstep' statement
@@ -1743,7 +1803,7 @@ module AtsMapE_TestCases {
                        // Check the default route configuration using v_ia_naAddress
                        // Check the default route configuration using v_ia_naAddress
                        f_selfOrClientSyncAndVerdict(c_startDefaultRouteCheck, e_success);
                        f_selfOrClientSyncAndVerdict(c_startDefaultRouteCheck, e_success);
                        
                        
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        f_selfOrClientSyncAndVerdict(c_tbDone, v_result);
                        log("*** " & __SCOPE__ & ": PASS: Successfully received DHCPv6 Reply from the DHCPv6 Server. ***");
                        log("*** " & __SCOPE__ & ": PASS: Successfully received DHCPv6 Reply from the DHCPv6 Server. ***");
                        
                        
                        // Postamble
                        // Postamble
@@ -1764,7 +1824,7 @@ module AtsMapE_TestCases {
                        
                        
                        // Local variables
                        // Local variables
                        var Ipv4Packet v_ipv4Packet;    /** Used to store received IPv4 messages */
                        var Ipv4Packet v_ipv4Packet;    /** Used to store received IPv4 messages */
                        var InterCompDataMsg v_data;    /** Used to send received IPv4 messages to BRComponent */
                        var integer v_nbrReceived := 0;
                        
                        
                        // Preamble
                        // Preamble
                        // Clause 'Initial conditions'
                        // Clause 'Initial conditions'
@@ -1791,9 +1851,14 @@ module AtsMapE_TestCases {
                                    p_srcAddress,
                                    p_srcAddress,
                                    p_httpServerAddress
                                    p_httpServerAddress
                            )) -> value v_ipv4Packet {
                            )) -> value v_ipv4Packet {
                                v_data.address_.ipv4Address := v_ipv4Packet.ipv4Hdr.sourceAddress;
                                tc_ac.stop;
                                v_data.ipv4Packet := v_ipv4Packet;
                                if (v_nbrReceived != p_noOfDataRequests) {
                                dataPort.send(v_data);
                                    v_nbrReceived := v_nbrReceived + 1;
                                    tc_ac.start;
                                    repeat;
                                } else {
                                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                                }
                            }
                            }
                            [] tc_ac.timeout { 
                            [] tc_ac.timeout { 
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);