X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fhoneycomb%2Fsub_interface.robot;h=1b1b80049b4a6ff8a563b55d241454325c8b4776;hb=refs%2Fchanges%2F22%2F6622%2F4;hp=c21b860f648b2b97e6905aaf7b91438d1279a72f;hpb=dbef20c93ad802b07607c9ca1c0e05c232c963f4;p=csit.git diff --git a/resources/libraries/robot/honeycomb/sub_interface.robot b/resources/libraries/robot/honeycomb/sub_interface.robot index c21b860f64..1b1b80049b 100644 --- a/resources/libraries/robot/honeycomb/sub_interface.robot +++ b/resources/libraries/robot/honeycomb/sub_interface.robot @@ -46,7 +46,7 @@ | | interfaceAPI.Create sub interface | ${node} | ${super_interface} | | ... | ${match} | ${tags} | &{sub_interface_settings} -| Sub-interface configuration from Honeycomb should be +| Sub-interface Operational Data From Honeycomb Should Be | | [Documentation] | Retrieves sub-interface configuration through Honeycomb\ | | ... | and compares it with settings supplied in argument. | | ... @@ -58,7 +58,7 @@ | | ... | Type: dictionary | | ... | | ... | *Example:* -| | ... | \| Sub-interface configuration from Honeycomb should be\ +| | ... | \| Sub-interface Operational Data From Honeycomb Should Be\ | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1\ | | ... | \| ${sub_if_1_params} \| | | ... @@ -69,7 +69,50 @@ | | ... | ${node} | ${super_interface} | ${identifier} | | interfaceAPI.Compare Data Structures | ${api_data} | ${sub_if_settings} -| Sub-interface configuration from VAT should be +| Sub-interface Operational Data From Honeycomb Should Be empty +| | [Documentation] | Retrieves sub-interface configuration through Honeycomb \ +| | ... | and expects no data. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_interface - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... +| | ... | *Example:* +| | ... | \| Sub-interface Operational Data From Honeycomb Should Be empty\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| +| | ... +| | [Arguments] | ${node} | ${super_interface} | ${identifier} +| | ... +| | Run keyword and expect error | *KeyError: 'vpp-vlan:sub-interfaces'* +| | ... | interfaceAPI.Get sub interface oper data +| | ... | ${node} | ${super_interface} | ${identifier} + +| Sub-interface state from Honeycomb should be +| | [Documentation] | Retrieves sub-interface configuration through Honeycomb \ +| | ... | and checks the administrative and operational state. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_interface - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... | - admin_state - Required administrative state - up or down. \ +| | ... | Type: string +| | ... | - oper_state - Required operational state - up or down. Type: string +| | ... +| | ... | *Example:* +| | ... | \| Sub-interface state from Honeycomb should be\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| up \| up \| +| | ... +| | [Arguments] | ${node} | ${super_interface} | ${identifier} +| | ... | ${admin_state} | ${oper_state} +| | ... +| | ${api_data}= | interfaceAPI.Get sub interface oper data +| | ... | ${node} | ${super_interface} | ${identifier} +| | Should be equal | ${api_data['admin-status']} | ${admin_state} +| | Should be equal | ${api_data['oper-status']} | ${oper_state} + +| Sub-interface Operational Data From VAT Should Be | | [Documentation] | Retrieves sub-interface configuration through VAT and\ | | ... | compares it with settings supplied in argument. | | ... @@ -81,7 +124,7 @@ | | ... | sub-interface to be checked. Type: dictionary | | ... | | ... | *Example:* -| | ... | \| Sub-interface configuration from VAT should be\ +| | ... | \| Sub-interface Operational Data From VAT Should Be\ | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${sub_if_1_params} \| | | ... | | [Arguments] | ${node} | ${sub_interface} | ${sub_interface_settings} @@ -99,6 +142,35 @@ | | ... | Should be equal as strings | | ... | ${sub_interface_settings['oper-status']} | up +| Sub-interface state from VAT should be +| | [Documentation] | Retrieves sub-interface configuration through VAT and \ +| | ... | checks the administrative and operational state. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - sub_interface - Name of an sub-interface on the specified node. \ +| | ... | Type: string +| | ... | - admin_state - Required administrative state - up or down. \ +| | ... | Type: string +| | ... | - oper_state - Required operational state - up or down. Type: string +| | ... +| | ... | *Example:* +| | ... | \| Sub-interface state from VAT should be \ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| up \| up \| +| | ... +| | [Arguments] | ${node} | ${sub_interface} | ${admin_state} | ${oper_state} +| | ... +| | ${vat_data}= | InterfaceCLI.VPP get interface data +| | ... | ${node} | ${sub_interface} +| | Run keyword if | '${admin_state}' == 'down' +| | ... | Should be equal as strings | ${vat_data['admin_up_down']} | 0 +| | Run keyword if | '${admin_state}' == 'up' +| | ... | Should be equal as strings | ${vat_data['admin_up_down']} | 1 +| | Run keyword if | '${oper_state}' == 'down' +| | ... | Should be equal as strings | ${vat_data['link_up_down']} | 0 +| | Run keyword if | '${oper_state}' == 'up' +| | ... | Should be equal as strings | ${vat_data['link_up_down']} | 1 + | Sub-interface indices from Honeycomb and VAT should correspond | | [Documentation] | Uses VAT and Honeycomb to get operational data about the\ | | ... | given sub-interface and compares the interface indexes. The @@ -196,7 +268,7 @@ | | interfaceAPI.Add bridge domain to sub interface | | ... | ${node} | ${super_if} | ${identifier} | ${sub_bd_setings} -| Sub-interface bridge domain configuration from Honeycomb should be +| Sub-interface bridge domain Operational Data From Honeycomb Should Be | | [Documentation] | Uses Honeycomb API to verify sub-interface assignment to\ | | ... | a bridge domain. | | ... @@ -207,7 +279,7 @@ | | ... | - settings - Bridge domain parameters to be checked. Type: dictionary | | ... | | ... | *Example:* -| | ... | \| Sub-interface bridge domain configuration from Honeycomb should be\ +| | ... | \| Sub-interface bridge domain Operational Data From Honeycomb Should Be\ | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| ${bd_settings} \| | | ... | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings} @@ -217,7 +289,7 @@ | | Should be equal | ${if_data['bridge-domain']} | | ... | ${settings['bridge-domain']} -| Sub-interface bridge domain configuration from VAT should be +| Sub-interface bridge domain Operational Data From VAT Should Be | | [Documentation] | Uses VAT to verify sub-interface assignment to a bridge\ | | ... | domain. | | ... @@ -228,7 +300,7 @@ | | ... | - setings - Parameters to be checked. Type: dictionary | | ... | | ... | *Example:* -| | ... | \| Sub-interface bridge domain configuration from VAT should be\ +| | ... | \| Sub-interface bridge domain Operational Data From VAT Should Be\ | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${sub_bd_setings} \| | | ... | | [Arguments] | ${node} | ${interface} | ${settings} @@ -317,7 +389,8 @@ | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings} | | ${api_data}= | interfaceAPI.Get tag rewrite oper data | | ... | ${node} | ${super_if} | ${identifier} -| | interfaceAPI.Compare Data Structures | ${api_data} | ${settings} +| | interfaceAPI.Compare Data Structures +| | ... | ${api_data} | ${settings} | Rewrite tag from VAT should be | | [Documentation] | Retrieves sub-interface configuration through VAT and\ @@ -375,3 +448,240 @@ | | ... | | ${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 ip address to sub_interface +| | ... | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} | ipv4 + +| 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}= | interfaceCLI.VPP get interface ip addresses +| | ... | ${node} | ${sub_interface} | ipv4 +| | Should be equal | ${data[0]['ip']} | ${address} +| | 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 ip addresses from sub_interface +| | ... | ${node} | ${super_if} | ${identifier} | ipv4 + +| 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: 'ipv4'* +| | ... | 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* +| | ... | interfaceCLI.VPP get interface ip addresses +| | ... | ${node} | ${sub_interface} | ipv4 + +| Honeycomb sets sub-interface ipv6 address +| | [Documentation] | Uses Honeycomb API to configure an ipv6 address on the\ +| | ... | spcified sub-interface. Replaces any existing ipv6 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 - IPv6 address to set. Type: string +| | ... | - prefix - IPv6 network prefix length to set. Type: integer +| | ... +| | ... | *Example:* +| | ... | \| | Honeycomb sets sub-interface ipv6 address\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \ +| | ... | \| 10::10 \| ${64} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} +| | Add ip address to sub_interface +| | ... | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} | ipv6 + +| Sub-interface IPv6 address from Honeycomb should contain +| | [Documentation] | Uses Honeycomb API to verify ipv6 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 - IPv6 address to expect. Type: string +| | ... | - prefix - IPv6 network prefix length to expect. Type: integer +| | ... +| | ... | *Example:* +| | ... | \| sub-interface IPv6 address from Honeycomb should contain\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \ +| | ... | \| 10::10 \| ${64} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} +| | ${if_data}= | interfaceAPI.Get sub interface oper data +| | ... | ${node} | ${super_if} | ${identifier} +| | ${settings}= | Create Dictionary +| | ... | ip=${address} | prefix-length=${prefix} +| | Should contain | ${if_data['ipv6']['address']} | ${settings} + +| Sub-interface IPv6 address from VAT should contain +| | [Documentation] | Uses VAT to verify ipv6 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 - IPv6 address to expect. Type: string +| | ... | - prefix - IPv6 network prefix length to expect. Type: integer +| | ... +| | ... | *Example:* +| | ... | \| sub-interface IPv6 address from VAT should contain\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| +| | ... +| | [Arguments] | ${node} | ${sub_interface} | ${address} | ${prefix} +| | ${data}= | interfaceCLI.VPP get interface ip addresses +| | ... | ${node} | ${sub_interface} | ipv6 +| | Should be equal | ${data[0]['ip']} | ${address} +| | Should be equal | ${data[0]['prefix_length']} | ${prefix} + +| Honeycomb removes all sub-interface ipv6 addresses +| | [Documentation] | Uses Honeycomb API to remove all configured ipv6\ +| | ... | 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 ipv6 addresses\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${identifier} +| | Remove all ip addresses from sub_interface +| | ... | ${node} | ${super_if} | ${identifier} | ipv6 + +| Sub-interface ipv6 address from Honeycomb should be empty +| | [Documentation] | Uses Honeycomb API to verify that ipv6 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 ipv6 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: 'ipv6'* +| | ... | Set Variable | ${if_data['ipv6']['address'][0]['ip']} + +| Sub-interface ipv6 address from VAT should be empty +| | [Documentation] | Uses VAT to verify that ipv6 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 ipv6 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* +| | ... | interfaceCLI.VPP get interface ip addresses +| | ... | ${node} | ${sub_interface} | ipv6