Update Honeycomb persistence tests with new Vlan
[csit.git] / resources / libraries / robot / honeycomb / interfaces.robot
index 0768fd3..02d0a49 100644 (file)
 # limitations under the License.
 
 *** Settings ***
-| Library | resources/libraries/python/HoneycombUtil.py
 | Library | resources.libraries.python.InterfaceUtil
-| ... | WITH NAME | interfaceCLI
-| Library | resources.libraries.python.HcAPIKwInterfaces.InterfaceKeywords
-| ... | WITH NAME | InterfaceAPI
+| ...     | WITH NAME | interfaceCLI
+| Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
+| ...     | WITH NAME | InterfaceAPI
 
 *** Keywords ***
 | Interface state is
 | | | interfaceAPI.Configure interface ipv4
 | | | ... | ${node} | ${interface} | ${key} | ${settings['${key}']}
 
+| Honeycomb sets interface ipv4 address with prefix
+| | [Documentation] | Uses Honeycomb API to assign an ipv4 address to the\
+| | ... | specified interface. Any existing addresses will be removed.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - interface - name of an interface on the specified node. Type: string
+| | ... | - address - IP address to set. Type: string
+| | ... | - prefix - length of address network prefix. Type: int
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb sets interface ipv4 address with prefix \
+| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 24 \|
+| | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
+| | interfaceAPI.Add first ipv4 address
+| | ... | ${node} | ${interface} | ${address} | ${prefix}
+
 | IPv4 config from Honeycomb should be
 | | [Documentation] | Retrieves interface ipv4 configuration through Honeycomb\
 | | ... | and compares with state supplied in argument.
 | | [Arguments] | ${node} | ${interface} | ${mtu} | ${vrf-id}
 | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
 | | Should be equal | ${vat_data['mtu']} | ${mtu}
-| | Should be equal | ${vat_data['sub_inner_vlan_id']} | ${vrf-id}
+
+| Interface configuration from Honeycomb should be empty
+| | [Documentation] | Attempts to retrieve interface configuration through\
+| | ... | Honeycomb and expects to get empty dictionary.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - interface - name of a interface on the specified node. Type:\
+| | ... | string
+| | ...
+| | ... | *Example:*
+| | ... | \| Interface configuration from Honeycomb should be empty\
+| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
+| | ...
+| | [Arguments] | ${node} | ${interface}
+| | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
+| | Should be empty | ${api_data}
+
+| Interface configuration from VAT should be empty
+| | [Documentation] | Attempts to retrieve Interface configuration through\
+| | ... | VAT and expects to get empty dictionary.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - interface - name of a Interface on the specified node. Type:\
+| | ... | string
+| | ...
+| | ... | *Example:*
+| | ... | \| Interface configuration from VAT should be empty\
+| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
+| | ...
+| | [Arguments] | ${node} | ${interface} |
+| | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
+| | Should be empty | ${vat_data}
+
+| Interface indices from Honeycomb and VAT should correspond
+| | [Documentation] | Uses VAT and Honeycomb to get operational data about the\
+| | ... | given interface and compares the interface indexes. The interface
+| | ... | index from Honeycomb should be greater than index from VAT by one.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - interface - name of the interface to be checked. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Interface indices from Honeycomb and VAT should correspond \
+| | ... | \| ${nodes['DUT1']} \| vxlan_gpe_tunnel0 \|
+| | ...
+| | [Arguments] | ${node} | ${interface}
+| | ...
+| | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
+| | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
+| | ${sw_if_index}= | EVALUATE | ${vat_data['sw_if_index']} + 1
+| | Should be equal as strings
+| | ... | ${api_data['if-index']} | ${sw_if_index}