diff options
author | selias <samelias@cisco.com> | 2016-06-30 16:29:25 +0200 |
---|---|---|
committer | Matej Klotton <mklotton@cisco.com> | 2016-07-11 12:33:38 +0000 |
commit | d5e00c67d229e6f6fd9461755423cee800a1635e (patch) | |
tree | a892530d93916bc75cd5b1403958a9f5eca76cf2 /resources/libraries/robot/honeycomb/sub_interface.robot | |
parent | 3bb84bee3516c1e7326becfc3c2f70bf6e3f59ce (diff) |
CSIT-184: Add Honeycomb sub-interface ipv4 tests
- add tests for sub-interface ipv4 support
- add keywords and methods used in tests
Change-Id: I98af193a4c4f0d3822eb9637f01acead37accb8c
Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'resources/libraries/robot/honeycomb/sub_interface.robot')
-rw-r--r-- | resources/libraries/robot/honeycomb/sub_interface.robot | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/resources/libraries/robot/honeycomb/sub_interface.robot b/resources/libraries/robot/honeycomb/sub_interface.robot index bdadad8b8b..e4844deabb 100644 --- a/resources/libraries/robot/honeycomb/sub_interface.robot +++ b/resources/libraries/robot/honeycomb/sub_interface.robot @@ -447,3 +447,122 @@ | | ... | | ${sw_if_index}= | interfaceCLI.Get sw if index | ${node} | ${sub_interface} | | L2 tag rewrite | ${node} | ${sw_if_index} | disable + +| Honeycomb sets sub-interface ipv4 address +| | [Documentation] | Uses Honeycomb API to configure an ipv4 address on the\ +| | ... | spcified sub-interface. Replaces any existing ipv4 addresses. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_if - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... | - address - IPv4 address to set. Type: string +| | ... | - prefix - IPv4 network prefix length to set. Type: integer +| | ... +| | ... | *Example:* +| | ... | \| | Honeycomb sets sub-interface ipv4 address\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \ +| | ... | \| 192.168.0.2 \| ${24} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} +| | Add ipv4 address to sub_interface +| | ... | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} + +| Sub-interface ipv4 address from Honeycomb should be +| | [Documentation] | Uses Honeycomb API to verify ipv4 address configuration\ +| | ... | on the specified sub-interface. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_if - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... | - address - IPv4 address to expect. Type: string +| | ... | - prefix - IPv4 network prefix length to expect. Type: integer +| | ... +| | ... | *Example:* +| | ... | \| sub-interface ipv4 address from Honeycomb should be\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \ +| | ... | \| 192.168.0.2 \| ${24} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} +| | ${if_data}= | interfaceAPI.Get sub interface oper data +| | ... | ${node} | ${super_if} | ${identifier} +| | Should be equal +| | ... | ${if_data['ipv4']['address'][0]['ip']} | ${address} +| | Should be equal +| | ... | ${if_data['ipv4']['address'][0]['prefix-length']} | ${prefix} + +| Sub-interface ipv4 address from VAT should be +| | [Documentation] | Uses VAT to verify ipv4 address configuration\ +| | ... | on the specified sub-interface. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - sub_interface - Name of an sub-interface on the specified node.\ +| | ... | Type: string +| | ... | - address - IPv4 address to expect. Type: string +| | ... | - prefix - IPv4 network prefix length to expect. Type: integer +| | ... +| | ... | *Example:* +| | ... | \| sub-interface ipv4 address from VAT should be\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| +| | ... +| | [Arguments] | ${node} | ${sub_interface} | ${address} | ${prefix} +| | ${data}= | VPP get interface ip addresses +| | ... | ${node} | ${sub_interface} | ipv4 +| | Should be equal | ${data[0]['ip']} | ${address} +#TODO: update based on resolution of bug https://jira.fd.io/browse/VPP-132 +| | Should be equal | ${data[0]['prefix_length']} | ${prefix} + +| Honeycomb removes all sub-interface ipv4 addresses +| | [Documentation] | Uses Honeycomb API to remove all configured ipv4\ +| | ... | addresses from the sub-interface. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_if - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... +| | ... | *Example:* +| | ... | \| Honeycomb removes all sub-interface ipv4 addresses\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} +| | Remove all ipv4 addresses from sub_interface +| | ... | ${node} | ${super_if} | ${identifier} + +| Sub-interface ipv4 address from Honeycomb should be empty +| | [Documentation] | Uses Honeycomb API to verify that ipv4 address\ +| | ... | configuration on the specified sub-interface is empty. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_if - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... +| | ... | *Example:* +| | ... | \| sub-interface ipv4 address from Honeycomb should be empty\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} +| | ${if_data}= | interfaceAPI.Get sub interface oper data +| | ... | ${node} | ${super_if} | ${identifier} +| | Run keyword and expect error | *KeyError: 'address'* +| | ... | Set Variable | ${if_data['ipv4']['address'][0]['ip']} + +| Sub-interface ipv4 address from VAT should be empty +| | [Documentation] | Uses VAT to verify that ipv4 address\ +| | ... | configuration on the specified sub-interface is empty. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - sub_interface - Name of an sub-interface on the specified node.\ +| | ... | Type: string +| | ... +| | ... | *Example:* +| | ... | \| sub-interface ipv4 address from VAT should be empty\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| +| | ... +| | [Arguments] | ${node} | ${sub_interface} +| | Run keyword and expect error | *No JSON object could be decoded* +| | ... | VPP get interface ip addresses | ${node} | ${sub_interface} | ipv4 |