Commit 17eb85e2 authored by garciay's avatar garciay
Browse files

Implement first 6RD test cases (DHCPv4)

Rename Dhcpv4Msg into DHCPv4Msg (aligned with DCHPv6Msg)
parent 81bda383
Loading
Loading
Loading
Loading
+31 −12
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ module Ats6RD_TestCases {
    import from AtsCommon_Interfaces all;
    import from AtsCommon_Functions all;
    import from AtsCommon_Templates all;
    import from AtsCommon_Dhcpv4_CommonRfcs_TypesAndValues {
        type DHCPv4Msg
    };
    
    // Ats6RD
    import from Ats6RD_Pixits all;
@@ -99,7 +102,7 @@ module Ats6RD_TestCases {
                    function f_TC_6RD_GWPA_BV_001_dhcpv4() runs on DHCPv4Component {
                        
                        // Local variables
//                        var DHCPv4Msg v_dhcpMsg;
                        var DHCPv4Msg v_dhcpv4Msg;
                        
                        // Preamble
                        // Clause 'Initial conditions'
@@ -111,16 +114,32 @@ module Ats6RD_TestCases {
                        // Clause 'when': the IUT sends a DHCPv6 Request to DHCPv6 Server
                        tc_ac.start;
                        alt {
//                            [] dhcpv4Port.receive(
//                                mdw_dhcpv4_Request_options(                    // Await Solicit DHCPv6 Request to DHCPv6 Server
//                                    mw_dhcpv4_options_optionRequest(           //     containing the Option field
//                                        mdw_dhcpv4_optionRequest_aftrName      //         indicating the AFTR-name DHCPv6 Option (value 64)
//                            ))) { 
//                                tc_ac.stop;
//                                // Nothing to do
//                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
//                                log("*** " & __SCOPE__ & ": PASS: Solicit DHCPv6 Request with AFTR-name option set was sent by the IUT. ***");
//                            }
                            [] dhcpv4Port.receive(
                                mdw_dhcpv4_Discover_options(                    // Await Solicit DHCPv4 Request to DHCPv4 Server
                                    mdw_dhcpv4_options_discover_6rd             //     containing the Option field
                                                                                //         indicating the OPTION_6RD option field
                            )) -> value v_dhcpv4Msg { 
                                // Do not re-start timer;
                                repeat;
                            }
                            [] dhcpv4Port.receive(
                                mdw_dhcpv4_Ack_options(                         // Await address assignment
                                    mdw_dhcpv4_AckHeader(
                                        v_dhcpv4Msg.bootpHeader.xid
                                    ),
                                    mdw_dhcpv4_options_discover_6rd             //     containing the Option field
                                                                                //         indicating the OPTION_6RD option field
                            )) { 
                                tc_ac.stop;
                                // Nothing to do
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                                log("*** " & __SCOPE__ & ": PASS: The IUT obtained its 6rd configuration parameters via DHCP. ***");
                            }
                            [] dhcpv4Port.receive(DHCPv4Msg:?) { // Skip unprocessed DHCPv4 message
                                // Do not re-start timer
                                log("*** " & __SCOPE__ & ": INFO: Skip unprocessed DHCPv4 message. ***");
                                repeat;
                            }
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***");
+5 −0
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@ module Ats6RD_TestControl {
    
    control {
        
        /**
         * @desc Check that IUT sends a DHCPv4 Request to the DHCPv4 Server after initialization
         * @reference ETSI TS 101 569-1 Clause 6.8.9.3 Feature: 6RD Configuration
         */
        execute(TC_6RD_GWPA_BV_001());
        
    } // End of 'control' statement
    
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
   * @desc Dynamic Host Configuration Protocol Message with BOOTP header
   * @reference http://tools.ietf.org/html/rfc2131 cl. 2
  */  
  type record Dhcpv4Msg {
  type record DHCPv4Msg {
      BootpHeader   bootpHeader,
      Oct4          magicCookie('63825363'O), //DHCP
      DHCPv4Options options
+5 −1
Original line number Diff line number Diff line
@@ -30,7 +30,10 @@ module AtsCommon_Interfaces {
        type AFTRNameOption
    };
    
    // DS-Lite
    // AtsCommon
    import from AtsCommon_Dhcpv4_CommonRfcs_TypesAndValues {
        type DHCPv4Msg
    };
    import from AtsCommon_DNS_CommonRfcs_TypesAndValues {
        type DnsMsg
    };
@@ -59,6 +62,7 @@ module AtsCommon_Interfaces {
             * @desc DHCPv4 messages port
             */
            type port DHCPv4Port message {
                inout DHCPv4Msg
            } // End of port DHCPv4Port
            
            /**
+165 −1
Original line number Diff line number Diff line
@@ -5,12 +5,176 @@
 */
module AtsCommon_Templates {
    
    // LibCommon
    import from LibCommon_DataStrings {
        type Oct4
    };
    
    // LibIPv6
    import from LibIpv6_CommonRfcsDhcp_TypesAndValues all;
    import from AtsCommon_Dhcpv4_CommonRfcs_TypesAndValues all;
    import from AtsCommon_Dhcpv4_Rfc1533_TypesAndValues all;
    import from AtsCommon_Dhcpv4_Rfc5969_TypesAndValues all;
    import from LibIpv6_Rfc3315Dhcp_TypesAndValues all;
    import from LibIpv6_Rfc3646Dhcp_TypesAndValues all;
    import from LibIpv6_Rfc6334Dhcp_TypesAndValues all;
    
    group dhcpv4MessageTemplates {
        
        group dhcpv4DummySendTemplates {
            
        } // End of group dhcpv4DummySendTemplates
        
        group dhcpv4MessagesDummyRecvTemplates {
            
            /**
             * @desc Genercic receive DHCP Client/Server message
             * @reference http://tools.ietf.org/html/rfc1533
             */
            template (present) DHCPv4Msg mw_dhcpv4_dummy := {
                bootpHeader := ?,
                magicCookie := '63825363'O, //DHCP
                options     := ?
            } // End of template mw_dhcpv4_dummy
            
            /**
             * @desc Genercic receive DHCP Client/Request message
             * @reference http://tools.ietf.org/html/rfc1533
             */  
            template (present) DHCPv4Msg mdw_dhcpv4_Discover_dummy modifies mw_dhcpv4_dummy := {
                bootpHeader := mw_dhcpv4_DiscoverHeader_dummy
            } // End of template mdw_dhcpv4_Discover_dummy
            
            /**
             * @desc Genercic receive DHCP Client/Request message
             * @reference http://tools.ietf.org/html/rfc1533
             */  
            template (present) DHCPv4Msg mdw_dhcpv4_Ack_dummy modifies mw_dhcpv4_dummy := {
                bootpHeader := mdw_dhcpv4_AckHeader_dummy
            } // End of template mdw_dhcpv4_Ack_dummy
            
        } // End of group dhcpv4OptionsDummyRecvTemplates
        
        group dhcpv4BootHeaderDummyRecvTemplates {
            
            template (present) BootpHeader mw_dhcpv4_DiscoverHeader_dummy := {
                op      := e_BOOTREQUEST,
                htype   := 1, // Ethernet
                hlen    := ?,
                hops    := ?,
                xid     := ?,
                secs    := ?,
                flags   := ?,
                ciaddr  := ?,
                yiaddr  := ?,
                siaddr  := ?,
                giaddr  := ?,
                chaddr  := ?,
                sname   := ?, 
                file    := ? 
            } // End of template mw_dhcpv4_Discover_dummy
            
        } // End of group dhcpv4BootHeaderDummyRecvTemplates
        
        group dhcpv4OptionsDummyRecvTemplates {
            
            /**
             * @desc Genercic receive DHCPv4 options
             */  
            template (present) DHCPv4Options mw_dhcpv4_options_dummy := {
                {
                    dhcpMessageType := mw_dhcpv4_option_message_type_dummy
                },
                {
                    end := ?
                },
                *
            } // End of template mw_dhcpv4_options_dummy
            
        } // End of group dhcpv4OptionsDummyRecvTemplates
        
        group dhcpv4MessagesRecvTemplates {
            
            /**
             * @desc Receive DHCP Client/Request message to check DHCPv4 options values
             * @param p_options Expected DHCPv4 options
             */  
            template (present) DHCPv4Msg mdw_dhcpv4_Discover_options(
                                                                     in template (present) DHCPv4Options p_options
            ) modifies mdw_dhcpv4_Discover_dummy := {
                options := p_options
            } // End of template mdw_dhcpv4_Discover_options
            
            /**
             * @desc Receive DHCP Client/Request message to check DHCPv4 options values
             * @param p_options Expected DHCPv4 options
             */  
            template (present) DHCPv4Msg mdw_dhcpv4_Ack_options(
                                                                in template (present) BootpHeader p_bootpHeader, 
                                                                in template (present) DHCPv4Options p_options
            ) modifies mdw_dhcpv4_Ack_dummy := {
                bootpHeader := p_bootpHeader,
                options := p_options
            } // End of template mdw_dhcpv4_Ack_options
            
        } // End of group dhcpv4MessagesRecvTemplates 
        
        group dhcpv4BootHeaderRecvTemplates {
            
            template (present) BootpHeader mdw_dhcpv4_AckHeader(
                                                                in template (value) Oct4 p_xid
            ) modifies mw_dhcpv4_DiscoverHeader_dummy := {
                xid := p_xid
            } // End of template mdw_dhcpv4_AckHeader
            
            template (present) BootpHeader mdw_dhcpv4_AckHeader_dummy modifies mw_dhcpv4_DiscoverHeader_dummy := {
                op      := e_BOOTREPLY
            } // End of template mw_dhcpv4_Discover_dummy
            
        } // End of group dhcpv4BootHeaderRecvTemplates
        
        group dhcpv4OptionsRecvTemplates {
            
            /**
             * @desc Receive DHCPv4 options with DISCOVER messaeg type and OPTION_6RD option field
             */  
            template (present) DHCPv4Options mdw_dhcpv4_options_discover_6rd modifies mw_dhcpv4_options_dummy:= {
                {
                    dhcpMessageType := mdw_dhcpv4_option_message_type_discover
                },
                {
                    sixrdDHCPv4 := mw_dhcpv4_option_6rd
                },
                *
            } // End of template mdw_dhcpv4_options_discover_6rd
            
            template (present) DHCPMessageTypeOption mw_dhcpv4_option_message_type_dummy :=  {
                optionCode  := e_OPTION_DHCP_MESSAGE_TYPE,
                optionLen   := 1,
                messageType := ?
            } // End of template mw_dhcpv4_option_message_type_dummy
            
            template (present) DHCPMessageTypeOption mdw_dhcpv4_option_message_type_discover modifies mw_dhcpv4_option_message_type_dummy := {
                messageType := e_DHCPDISCOVER
            } // End of template mdw_dhcpv4_option_message_type_discover
            
            /**
             * @desc Genercic receive 6rd DHCPv4 Option
             * @reference http://tools.ietf.org/html/rfc5969#section-7.1.1
             */
            template (present) SixrdDHCPv4Option mw_dhcpv4_option_6rd := {
                optionCode              := e_OPTION_6RD,
                optionLen               := ?,
                ipv4MaskLen             := ?,
                sixrdPrefixLen          := ?,
                sixrdPrefix             := ?,
                sixrdBRIPv4Addresses    := ?
            } // End of template mw_dhcpv4_option_6rd
            
        } // End of group dhcpv4OptionsRecvTemplates
        
    } // End of group dhcpv4MessageTemplates
    
    group dhcpv6MessageTemplates {
        
        group dhcpv6DummySendTemplates {
@@ -37,7 +201,7 @@ module AtsCommon_Templates {
             */  
            template (present) DHCPv6Msg mdw_dhcpv6_Request_dummy modifies mw_dhcpv6_dummy := {
                msgType     := e_REQUEST
            } // End of template mdw_dhcpv6_Sollicit_dummy
            } // End of template mdw_dhcpv6_Request_dummy
            
            /**
             * @desc Genercic receive DHCP Client/Reply message