diff options
author | selias <samuel.elias@pantheon.tech> | 2016-04-29 12:50:33 +0200 |
---|---|---|
committer | Matej Klotton <mklotton@cisco.com> | 2016-05-06 17:23:41 +0200 |
commit | c478afc5aec0161cc66e837c1ab919542b68ebbc (patch) | |
tree | 7817c20b6b81807a1999ca5330959911da272bc3 | |
parent | 07c0ae2e49665961af4a8b9734218e9c5f8cd3ca (diff) |
Add Honeycomb interface management tests (ipv4, ipv6, ethernet, routing)
- add test cases for managing ipv4, ipv6, ethernet and routing
configuration on VPP interface
- add keywords used in these tests to set and verify configuration
- add method and vat template for dumping an interface's
configured IP addresses
- add method for converting between ipv4 netmasks and
network prefixes
- clean up documentation of older Honeycomb keywords
Note: Test cases are tagged with a placeholder tag to allow manual
test runs locally. It should be replaced with the appropriate
environment tags once Honeycomb service is deployed on virl.
Change-Id: I99ce1e72c8550f520f8c35ef4a93eaebb530db78
Signed-off-by: selias <samelias@cisco.com>
Signed-off-by: Matej Klotton <mklotton@cisco.com>
-rw-r--r-- | resources/libraries/python/IPUtil.py | 19 | ||||
-rw-r--r-- | resources/libraries/python/InterfaceUtil.py | 31 | ||||
-rw-r--r-- | resources/libraries/robot/honeycomb/honeycomb.robot | 12 | ||||
-rw-r--r-- | resources/libraries/robot/honeycomb/interfaces.robot | 302 | ||||
-rw-r--r-- | resources/templates/vat/ip_address_dump.vat | 1 | ||||
-rw-r--r-- | tests/suites/honeycomb/interface_management.robot | 50 |
6 files changed, 380 insertions, 35 deletions
diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index 8ad01c491b..00a7000c65 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -12,6 +12,7 @@ # limitations under the License. """Common IP utilities library.""" +from ipaddress import IPv4Network from resources.libraries.python.ssh import SSH from resources.libraries.python.constants import Constants @@ -40,3 +41,21 @@ class IPUtil(object): if int(ret_code) != 0: raise Exception('VPP ip probe {dev} {ip} failed on {h}'.format( dev=interface, ip=addr, h=node['host'])) + + +def convert_ipv4_netmask_prefix(netmask): + """Convert network mask to equivalent network prefix length or vice versa. + + Example: mask 255.255.0.0 -> prefix length 16 + :param netmask: network mask or network prefix length. + :type netmask: str or int + :return: network mask or network prefix length. + :rtype: str or int + """ + temp_address = "0.0.0.0" + net = IPv4Network(u"{0}/{1}".format(temp_address, netmask), False) + + if isinstance(netmask, int): + return net.netmask + elif isinstance(netmask, basestring): + return net.prefixlen diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index 021e8ed74f..ec2ef69dfc 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -18,6 +18,7 @@ from time import time, sleep from robot.api import logger from resources.libraries.python.ssh import SSH +from resources.libraries.python.IPUtil import convert_ipv4_netmask_prefix from resources.libraries.python.ssh import exec_cmd_no_error from resources.libraries.python.topology import NodeType, Topology from resources.libraries.python.VatExecutor import VatExecutor, VatTerminal @@ -201,6 +202,36 @@ class InterfaceUtil(object): return data @staticmethod + def vpp_get_interface_ip_addresses(node, interface, ip_version): + """Get list of IP addresses from an interface on a VPP node. + + :param node: VPP node to get data from. + :param interface: Name of an interface on the VPP node. + :param ip_version: IP protocol version (ipv4 or ipv6). + :type node: dict + :type interface: str + :type ip_version: str + :return: List of dictionaries, each containing IP address, subnet + prefix length and also the subnet mask for ipv4 addresses. + Note: A single interface may have multiple IP addresses assigned. + :rtype: list + """ + sw_if_index = Topology.get_interface_sw_index(node, interface) + + with VatTerminal(node) as vat: + response = vat.vat_terminal_exec_cmd_from_template( + "ip_address_dump.vat", ip_version=ip_version, + sw_if_index=sw_if_index) + + data = response[0] + + if ip_version == "ipv4": + for item in data: + item["netmask"] = convert_ipv4_netmask_prefix( + item["prefix_length"]) + return data + + @staticmethod def tg_set_interface_driver(node, pci_addr, driver): """Set interface driver on the TG node. diff --git a/resources/libraries/robot/honeycomb/honeycomb.robot b/resources/libraries/robot/honeycomb/honeycomb.robot index 741807877d..54aff2febf 100644 --- a/resources/libraries/robot/honeycomb/honeycomb.robot +++ b/resources/libraries/robot/honeycomb/honeycomb.robot @@ -18,7 +18,7 @@ *** Keywords *** | Setup Honeycomb service on DUTs -| | [Documentation] | *Setup environment for honeycomb testing* +| | [Documentation] | *Setup environment for honeycomb testing.* | | ... | | ... | _Setup steps:_ | | ... | - 1. Login to each honeycomb node using ssh @@ -28,10 +28,12 @@ | | ... | connection refused -> 404 -> 401 -> 503 or 500 -> 200 (pass) | | ... | - 4. Configure honeycomb nodes using HTTP PUT request | | ... +| | ... | _Arguments:_ +| | ... | - ${duts} - list of nodes to setup Honeycomb on +| | ... | | ... | _Used global constants and variables:_ | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory | | ... | - HTTPCodes - HTTP protocol status codes -| | ... | - ${nodes} - dictionary of all nodes in topology.YAML file | | ... | | [Arguments] | @{duts} | | Start honeycomb on DUTs | @{duts} @@ -39,7 +41,7 @@ | | ... | Check honeycomb startup state | @{duts} | Stop honeycomb service on DUTs -| | [Documentation] | *Cleanup environment after honeycomb testing* +| | [Documentation] | *Cleanup environment after honeycomb testing.* | | ... | | ... | _Teardown steps:_ | | ... | - 1. Login to each honeycomb node using ssh @@ -48,10 +50,12 @@ | | ... | Expected sequence of HTTP replies: | | ... | 200 -> 404 -> connection refused (pass) | | ... +| | ... | _Arguments:_ +| | ... | - ${duts} - list of nodes to stop Honeycomb on +| | ... | | ... | _Used global constants and variables:_ | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory | | ... | - HTTPCodes - HTTP protocol status codes -| | ... | - ${nodes} - dictionary of all nodes in topology.YAML file | | ... | | [Arguments] | @{duts} | | Stop honeycomb on DUTs | @{duts} diff --git a/resources/libraries/robot/honeycomb/interfaces.robot b/resources/libraries/robot/honeycomb/interfaces.robot index 338c3cfc24..0768fd3021 100644 --- a/resources/libraries/robot/honeycomb/interfaces.robot +++ b/resources/libraries/robot/honeycomb/interfaces.robot @@ -14,63 +14,307 @@ *** Settings *** | Library | resources/libraries/python/HoneycombUtil.py | Library | resources.libraries.python.InterfaceUtil -| ... | WITH NAME | InterfaceCLI -| Library | resources.libraries.python.HoneycombAPIKeywords.InterfaceKeywords -| ... | WITH NAME | interfaceAPI +| ... | WITH NAME | interfaceCLI +| Library | resources.libraries.python.HcAPIKwInterfaces.InterfaceKeywords +| ... | WITH NAME | InterfaceAPI *** Keywords *** -| Honeycomb sets interface state +| Interface state is +| | [Documentation] | Uses VPP binary API to ensure that the interface under\ +| | ... | test is in the specified admin state. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - state - state to set on interface. Type:string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Interface state is \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \ +| | ... | \| up \| | | [Arguments] | ${node} | ${interface} | ${state} -| | [Documentation] | Uses Honeycomb API to change the admin state +| | interfaceCLI.Set interface state | ${node} | ${interface} | ${state} + +| Honeycomb sets interface state +| | [Documentation] | Uses Honeycomb API to change the admin state\ | | ... | of the specified interface. | | ... | | ... | *Arguments:* -| | ... | - state - state to set on interface -| | ... | - node - dictionary of information about a DUT node -| | ... | - interface - name of an interface on the specified node +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - state - state to set on interface. Type:string | | ... +| | ... | *Example:* +| | ... +| | ... | \| Honeycomb sets interface state \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| up \| +| | [Arguments] | ${node} | ${interface} | ${state} | | interfaceAPI.Set interface state | ${node} | ${interface} | ${state} | Interface state from Honeycomb should be -| | [Arguments] | ${node} | ${interface} | ${state} -| | [Documentation] | Retrieves interface admin state through Honeycomb and -| | ... | compares with state supplied in argument +| | [Documentation] | Retrieves interface admin state through Honeycomb and\ +| | ... | compares with state supplied in argument. | | ... | | ... | *Arguments:* -| | ... | - state - expected interface state -| | ... | - node - dictionary of information about a DUT node -| | ... | - interface - name of an interface on the specified node +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - state - expected interface state. Type: string +| | ... +| | ... | *Example:* | | ... -| | ${api_data}= | interfaceAPI.Get interface oper info | ${node} | ${interface} +| | ... | \| Interface state from Honeycomb should be \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| up \| +| | [Arguments] | ${node} | ${interface} | ${state} +| | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface} | | ${api_state}= | Set Variable | ${api_data['admin-status']} | | Should be equal | ${api_state} | ${state} | Interface state from VAT should be -| | [Arguments] | ${node} | ${interface} | ${state} -| | [Documentation] | Retrieves interface admin state through VAT and compares -| | ... | with state supplied in argument +| | [Documentation] | Retrieves interface admin state through VAT and compares\ +| | ... | with state supplied in argument. | | ... | | ... | *Arguments:* -| | ... | - state - expected interface state -| | ... | - node - dictionary of information about a DUT node -| | ... | - interface - name of an interface on the specified node +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - state - expected interface state. Type: string | | ... | | ... | _NOTE:_ Vat returns state as int (1/0) instead of string (up/down). | | ... | This keyword also handles translation. | | ... +| | ... | *Example:* +| | ... +| | ... | \| Interface state from VAT should be \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| up \| +| | [Arguments] | ${node} | ${interface} | ${state} | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface} | | ${vat_state}= | Set Variable if | | ... | ${vat_data['admin_up_down']} == 1 | up | down | | Should be equal | ${vat_state} | ${state} -| Interface state is -| | [Arguments] | ${node} | ${interface} | ${state} -| | [Documentation] | Uses VPP binary API to ensure that the interface under -| | ... | test is in the specified admin state. +| Honeycomb sets interface ipv4 configuration +| | [Documentation] | Uses Honeycomb API to change ipv4 configuration\ +| | ... | of the specified interface. | | ... | | ... | *Arguments:* -| | ... | - state - state to set on interface -| | ... | - node - dictionary of information about a DUT node -| | ... | - interface - name of an interface on the specified node +| | ... | - 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 +| | ... | - netmask - subnet mask to set. Type: string +| | ... | - fib_address - IP address to add to fib table. Type: string +| | ... | - fib_mac - MAC address to add to fib table. Type: string +| | ... | - settings - ipv4 interface settings. Type: dictionary | | ... -| | interfaceAPI.Set interface state | ${node} | ${interface} | ${state} +| | ... | *Example:* +| | ... +| | ... | \| Honeycomb sets interface ipv4 configuration \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 255.255.255.0 \ +| | ... | \| 192.168.0.3 \| 08:00:27:c0:5d:37 \ +| | ... | \| ${{'enabled': True, 'mtu': 1500}} \| +| | [Arguments] | ${node} | ${interface} | ${address} | ${netmask} +| | ... | ${fib_address} | ${fib_mac} | ${settings} +| | interfaceAPI.Add first ipv4 address +| | ... | ${node} | ${interface} | ${address} | ${netmask} +| | interfaceAPI.Add first ipv4 neighbor +| | ... | ${node} | ${interface} | ${fib_address} | ${fib_mac} +| | :FOR | ${key} | IN | @{settings.keys()} +| | | interfaceAPI.Configure interface ipv4 +| | | ... | ${node} | ${interface} | ${key} | ${settings['${key}']} + +| IPv4 config from Honeycomb should be +| | [Documentation] | Retrieves interface ipv4 configuration through Honeycomb\ +| | ... | and compares with state supplied in argument. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - address - IP address to expect. Type: string +| | ... | - netmask - subnet mask to expect. Type: string +| | ... | - fib_address - IP address to expect in fib table. Type: string +| | ... | - fib_mac - MAC address to expect in fib table. Type: string +| | ... | - settings - ipv4 interface settings to expect. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv4 config from Honeycomb should be \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 255.255.255.0 \ +| | ... | \| 192.168.0.3 \| 08:00:27:c0:5d:37 \ +| | ... | \| ${{'enabled': True, 'mtu': 1500}} \| +| | [Arguments] | ${node} | ${interface} | ${address} | ${netmask} +| | ... | ${fib_address} | ${fib_mac} | ${settings} +| | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface} +| | Should be equal | ${address} +| | ... | ${api_data['ietf-ip:ipv4']['address'][0]['ip']} +| | Should be equal | ${netmask} +| | ... | ${api_data['ietf-ip:ipv4']['address'][0]['netmask']} +| | Should be equal | ${fib_address} +| | ... | ${api_data['ietf-ip:ipv4']['neighbor'][0]['ip'] +| | Should be equal | ${fib_mac} +| | ... | ${api_data['ietf-ip:ipv4']['neighbor'][0]['link-layer-address'] +| | :FOR | ${key} | IN | @{settings.keys()} +| | | Should be equal +| | | ... | ${settings['{key']} | ${api_data['ietf-ip:ipv4']['{$key}']} + +| IPv4 config from VAT should be +| | [Documentation] | Retrieves interface ipv4 configuration through VAT and\ +| | ... | compares with state supplied in argument. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - address - IP address to expect. Type: string +| | ... | - netmask - subnet mask to expect. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv4 config from VAT should be \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 255.255.255.0 \| +| | [Arguments] | ${node} | ${interface} | ${address} | ${netmask} +| | ${vpp_data}= | interfaceCLI.VPP get interface ip addresses +| | ... | ${node} | ${interface} | ipv4 +| | Should be equal | ${vpp_data[0]['ip']} | ${address} +| | Should be equal | ${vpp_data[0]['netmask']} | ${netmask} + +| Honeycomb sets interface ipv6 configuration +| | [Documentation] | Uses Honeycomb API to change ipv6 configuration\ +| | ... | of the specified interface. +| | ... +| | ... | *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 subnet prefix to set. Type: string +| | ... | - fib_address - IP address to add to fib table. Type: string +| | ... | - fib_mac - MAC address to add to fib table. Type: string +| | ... | - settings - ipv6 interface settings. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Honeycomb sets interface ipv6 configuration \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \ +| | ... | \| 10::11 \| 08:00:27:c0:5d:37 \| ${{'enabled': True, 'mtu': 1500}} \| +| | [Arguments] | ${node} | ${interface} | ${address} | ${prefix} +| | ... | ${fib_address} | ${fib_mac} | ${settings} +| | interfaceAPI.Add first ipv6 address +| | ... | ${node} | ${interface} | ${address} | ${prefix} +| | interfaceAPI.Add first ipv6 neighbor +| | ... | ${node} | ${interface} | ${fib_address} | ${fib_mac} +| | :FOR | ${key} | IN | @{settings.keys()} +| | | interfaceAPI.Configure interface ipv6 +| | | ... | ${node} | ${interface} | ${key} | ${settings['${key}']} + +| IPv6 config from Honeycomb should be +| | [Documentation] | Retrieves interface ipv6 configuration through Honeycomb\ +| | ... | and compares with state supplied in argument. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - address - IP address to expect. Type: string +| | ... | - prefix - length of subnet prefix to expect. Type: string +| | ... | - fib_address - IP address to expect in fib table. Type: string +| | ... | - fib_mac - MAC address to expect in fib table. Type: string +| | ... | - settings - ipv6 interface settings to expect. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv6 config from Honeycomb should be \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \ +| | ... | \| 10::11 \| 08:00:27:c0:5d:37 \| ${{'enabled': True, 'mtu': 1500}} \| +| | [Arguments] | ${node} | ${interface} | ${address} | ${prefix} +| | ... | ${fib_address} | ${fib_mac} | ${settings} +| | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface} +| | Should be equal | ${address} +| | ... | ${api_data['ietf-ip:ipv6']['address'][0]['ip']} +| | Should be equal | ${prefix} +| | ... | ${api_data['ietf-ip:ipv6']['address'][0]['prefix-length']} +| | Should be equal | ${fib_address} +| | ... | ${api_data['ietf-ip:ipv6']['neighbor'][0]['ip'] +| | Should be equal | ${fib_mac} +| | ... | ${api_data['ietf-ip:ipv6']['neighbor'][0]['link-layer-address'] +| | :FOR | ${key} | IN | @{settings.keys()} +| | | Should be equal +| | ... | ${settings['{key']} | ${api_data['ietf-ip:ipv6']['{$key}']} + +| IPv6 config from VAT should be +| | [Documentation] | Retrieves interface ipv6 configuration through VAT and\ +| | ... | compares with state supplied in argument. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - address - IP address to expect. Type: string +| | ... | - prefix - length of subnet prefix to expect. Type: string +| | ... +| | ... | *Example:* +| | ... +| | ... | \| IPv6 config from VAT should be \| ${nodes['DUT1']} \ +| | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \| +| | [Arguments] | ${node} | ${interface} | ${address} | ${prefix} +| | ${vpp_data}= | interfaceCLI.VPP get interface ip addresses +| | ... | ${node} | ${interface} | ipv6 +| | Should be equal | ${vpp_data[0]['ip']} | ${address} +| | Should be equal | ${vpp_data[0]['prefix-length']} | ${prefix} + +| Honeycomb sets interface ethernet and routing configuration +| | [Documentation] | Uses Honeycomb API to change interface configuration. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - ethernet - interface ethernet settings. Type: dictionary +| | ... | - routing - interface routing settings. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Honeycomb sets interface ethernet and routing configuration \ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${{'mtu': 1500}} \ +| | ... | \| ${{'vrf-if': 2}} \| +| | [Arguments] | ${node} | ${interface} | ${ethernet} | ${routing} +| | :FOR | ${key} | IN | @{ethernet.keys()} +| | | interfaceAPI.Configure interface ethernet +| | | ... | ${node} | ${interface} | ${key} | ${ethernet['${key}']} +| | :FOR | ${key} | IN | @{routing.keys()} +| | | interfaceAPI.Configure interface routing +| | | ... | ${node} | ${interface} | ${key} | ${routing['${key}']} + +| Interface ethernet and routing configuration from Honeycomb should be +| | [Documentation] | Retrieves interface routing and ethernet configuration\ +| | ... | through Honeycomb and compares with settings supplied in arguments. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - ethernet - interface ethernet settings. Type: dictionary +| | ... | - routing - interface routing settings. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Interface ethernet and routing configuration from Honeycomb \ +| | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \ +| | ... | \| ${{'mtu': 1500}} \| ${{'vrf-id': 2}} \| +| | [Arguments] | ${node} | ${interface} | ${ethernet} | ${routing} +| | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface} +| | :FOR | ${key} | IN | @{ethernet.keys()} +| | | Should be equal | ${api_data['${key}']} | ${ethernet['${key}']} +| | :FOR | ${key} | IN | @{routing.keys()} +| | | Should be equal | ${api_data['${key}']} | ${routing['${key}']} + +| Interface ethernet and routing configuration from VAT should be +| | [Documentation] | Retrieves interface routing and ethernet configuration\ +| | ... | through VAT and compares with settings supplied in arguments. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... | - interface - name of an interface on the specified node. Type: string +| | ... | - mtu - value of maximum transmission unit expected. Type: integer +| | ... | - vrf-id - ID number of a VPN expected on interface. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Interface ethernet and routing configuration from VAT \ +| | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1500} \ +| | ... | \| ${2} \| +| | [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} diff --git a/resources/templates/vat/ip_address_dump.vat b/resources/templates/vat/ip_address_dump.vat new file mode 100644 index 0000000000..60585edc3a --- /dev/null +++ b/resources/templates/vat/ip_address_dump.vat @@ -0,0 +1 @@ +ip_address_dump {ip_version} sw_if_index {sw_if_index} diff --git a/tests/suites/honeycomb/interface_management.robot b/tests/suites/honeycomb/interface_management.robot index 37200d023f..f741f9543b 100644 --- a/tests/suites/honeycomb/interface_management.robot +++ b/tests/suites/honeycomb/interface_management.robot @@ -12,8 +12,19 @@ # limitations under the License. *** Variables *** +# Node and interface to run tests on. | ${node}= | ${nodes['DUT1']} | ${interface}= | ${node['interfaces'].values()[0]['name']} +# Configuration which will be set and verified during tests. +| @{ipv4_address}= | 192.168.0.2 | 255.255.255.0 +| @{ipv4_neighbor}= | 192.168.0.3 | 08:00:27:c0:5d:37 +| &{ipv4_settings}= | enabled=${True} | forwarding=${True} | mtu=9000 +| @{ipv6_address}= | 10::10 | 64 +| @{ipv6_neighbor}= | 10::11 | 08:00:27:c0:5d:37 +| &{ipv6_settings}= | enabled=${True} | forwarding=${True} | mtu=9000 +| ... | dup-addr-detect-transmits=5 +| &{ethernet}= | mtu=9000 +| &{routing}= | vrf-id=27 *** Settings *** | Resource | resources/libraries/robot/default.robot @@ -27,8 +38,8 @@ | ... | Test suite uses the first interface of the first DUT node. *** Test Cases *** -| Honeycomb modifies interface state -| | [Documentation] | Check if Honeycomb API can modify the admin state of +| Honeycomb configures and reads interface state +| | [Documentation] | Check if Honeycomb API can modify the admin state of\ | | ... | VPP interfaces. | | [Tags] | honeycomb_sanity | | Given Interface state is | ${node} | ${interface} | down @@ -40,3 +51,38 @@ | | Then Interface state from Honeycomb should be | | ... | ${node} | ${interface} | down | | And Interface state from VAT should be | ${node} | ${interface} | down + +| Honeycomb modifies interface configuration - ipv4 +| | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4. +| | [Tags] | honeycomb_sanity +| | When Honeycomb sets interface ipv4 configuration +| | ... | ${node} | ${interface} | @{ipv4_address} | @{ipv4_neighbor} +| | ... | ${ipv4_settings} +| | Then IPv4 config from Honeycomb should be +| | ... | ${node} | ${interface} | @{ipv4_address} | @{ipv4_neighbor} +| | ... | ${ipv4_settings} +| | And IPv4 config from VAT should be +| | ... | ${node} | ${interface} | @{ipv4_address} + +| Honeycomb modifies interface configuration - ipv6 +| | [Documentation] | Check if Honeycomb API can configure interfaces for ipv6. +| | [Tags] | honeycomb_sanity +| | When Honeycomb sets interface ipv6 configuration +| | ... | ${node} | ${interface} | @{ipv6_address} | @{ipv6_neighbor} +| | ... | ${ipv6_settings} +| | Then IPv6 config from Honeycomb should be +| | ... | ${node} | ${interface} | @{ipv6_address} | @{ipv6_neighbor} +| | ... | ${ipv6_settings} +| | And IPv6 config from VAT should be +| | ... | ${node} | ${interface} | @{ipv6_address} + +| Honeycomb modifies interface configuration - ethernet,routing +| | [Documentation] | Check if Honeycomb API can configure interface ethernet\ +| | ... | and routing settings. +| | [Tags] | honeycomb_sanity +| | When Honeycomb sets interface ethernet and routing configuration +| | ... | ${node} | ${interface} | ${ethernet} | ${routing} +| | Then Interface ethernet and routing configuration from Honeycomb should be +| | ... | ${node} | ${interface} | ${ethernet} | ${routing} +| | And Interface ethernet and routing configuration from VAT should be +| | ... | ${node} | ${interface} | ${ethernet['mtu']} | ${routing['vrf-id']} |