Improve test tag string parsing
[csit.git] / resources / libraries / robot / honeycomb / sub_interface.robot
index 4a9f5c4..8bb95f5 100644 (file)
 
 *** Settings ***
 | Library | resources.libraries.python.InterfaceUtil
-| ...     | WITH NAME | interfaceCLI
+| Library | resources.libraries.python.IPUtil
 | Library | resources.libraries.python.L2Util
 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
-| ...     | WITH NAME | InterfaceAPI
 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
 | Documentation | Keywords used to manipulate sub-interfaces.
 
 | | [Arguments] | ${node} | ${super_interface}
 | | ... | ${match} | ${tags} | ${sub_interface_settings}
 | | ...
-| | interfaceAPI.Create sub interface | ${node} | ${super_interface}
+| | Honeycomb 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.
 | | ...
 | | ... | 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} \|
 | | ...
 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
 | | ... | ${sub_if_settings}
 | | ...
-| | ${api_data}= | interfaceAPI.Get sub interface oper data
+| | ${api_data}= | Get sub interface oper data
 | | ... | ${node} | ${super_interface} | ${identifier}
-| | interfaceAPI.Compare Data Structures | ${api_data} | ${sub_if_settings}
+| | Compare Data Structures | ${api_data} | ${sub_if_settings}
 
-| Sub-interface configuration from Honeycomb should be empty
+| Sub-interface Operational Data From Honeycomb Should Be empty
 | | [Documentation] | Retrieves sub-interface configuration through Honeycomb \
 | | ... | and expects no data.
 | | ...
 | | ... | - identifier - Sub-interface ID. Type: integer or string
 | | ...
 | | ... | *Example:*
-| | ... | \| Sub-interface configuration from Honeycomb should be empty\
+| | ... | \| 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
+| | ... | Get sub interface oper data
 | | ... | ${node} | ${super_interface} | ${identifier}
 
 | Sub-interface state from Honeycomb should be
 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
 | | ... | ${admin_state} | ${oper_state}
 | | ...
-| | ${api_data}= | interfaceAPI.Get sub interface oper data
+| | ${api_data}= | 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 configuration from VAT should be
+| Sub-interface Operational Data From VAT Should Be
 | | [Documentation] | Retrieves sub-interface configuration through VAT and\
 | | ... | compares it with settings supplied in argument.
 | | ...
 | | ... | 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}
 | | ...
-| | ${vat_data}= | InterfaceCLI.VPP get interface data
+| | ${vat_data}= | VPP get interface data
 | | ... | ${node} | ${sub_interface}
 | | Should be equal as strings | ${vat_data['sub_id']}
 | | ... | ${sub_interface_settings['identifier']}
 | | ...
 | | [Arguments] | ${node} | ${sub_interface} | ${admin_state} | ${oper_state}
 | | ...
-| | ${vat_data}= | InterfaceCLI.VPP get interface data
+| | ${vat_data}= | VPP get interface data
 | | ... | ${node} | ${sub_interface}
 | | Run keyword if | '${admin_state}' == 'down'
 | | ... | Should be equal as strings | ${vat_data['admin_up_down']} | 0
 | | ...
 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
 | | ...
-| | ${api_data}= | interfaceAPI.Get sub interface oper data
+| | ${api_data}= | Get sub interface oper data
 | | ... | ${node} | ${super_interface} | ${identifier}
-| | ${vat_data}= | InterfaceCLI.VPP get interface data
+| | ${vat_data}= | VPP get interface data
 | | ... | ${node} | ${super_interface}.${identifier}
 | | ${sw_if_index}= | EVALUATE | ${vat_data['sw_if_index']} + 1
 | | Should be equal as strings
 | | ...
 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
 | | ...
-| | interfaceAPI.Set sub interface state
+| | Set sub interface state
 | | ... | ${node} | ${super_interface} | ${identifier} | up
 
 | Honeycomb sets the sub-interface down
 | | ...
 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
 | | ...
-| | interfaceAPI.Set sub interface state
+| | Set sub interface state
 | | ... | ${node} | ${super_interface} | ${identifier} | down
 
 | Honeycomb fails to set sub-interface up
 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
 | | ...
 | | Run keyword and expect error | *HoneycombError: * was not successful. * 500.
-| | ... | interfaceAPI.Set sub interface state
+| | ... | Set sub interface state
 | | ... | ${node} | ${super_interface} | ${identifier} | up
 
 | Honeycomb adds sub-interface to bridge domain
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${sub_bd_setings}
 | | ...
-| | interfaceAPI.Add bridge domain to sub interface
+| | 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.
 | | ...
 | | ... | - 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}
 | | ...
-| | ${if_data}= | interfaceAPI.Get BD data from sub interface
+| | ${if_data}= | Get BD data from sub interface
 | | ... | ${node} | ${super_if} | ${identifier}
 | | 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 PAPI Should Be
 | | [Documentation] | Uses VAT to verify sub-interface assignment to a bridge\
 | | ... | domain.
 | | ...
 | | ... | - setings - Parameters to be checked. Type: dictionary
 | | ...
 | | ... | *Example:*
-| | ... | \| Sub-interface bridge domain configuration from VAT should be\
+| | ... | \| Sub-interface bridge domain Operational Data From PAPI Should Be\
 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${sub_bd_setings} \|
 | | ...
 | | [Arguments] | ${node} | ${interface} | ${settings}
 | | ...
 | | ${bd_data}= | VPP get bridge domain data | ${node}
 | | ${bd_intf}= | Set Variable | ${bd_data[0]}
-| | ${sw_if_data}= | Set Variable | ${bd_intf['sw_if'][0]}
+| | ${sw_if_data}= | Set Variable | ${bd_intf['sw_if_details'][0]}
 | | Should be equal as integers | ${bd_intf['flood']} | ${bd_settings['flood']}
 | | Should be equal as integers | ${bd_intf['forward']}
 | | ... | ${bd_settings['forward']}
 | | Should be equal as integers | ${bd_intf['learn']} | ${bd_settings['learn']}
-| | Should be equal as strings | ${sw_if_data['shg']}
+# interface[1] = sw_if_index, interface[2] = shg
+| | Should be equal as strings | ${sw_if_data[2]}
 | | ... | ${settings['split-horizon-group']}
 
 | Honeycomb fails to remove all sub-interfaces
 | | [Arguments] | ${node} | ${super_if}
 | | ...
 | | Run keyword and expect error | *HoneycombError:*not successful. * code: 500.
-| | ... | interfaceAPI.Remove all sub interfaces
+| | ... | Remove all sub interfaces
 | | ... | ${node} | ${super_if}
 
 | Honeycomb configures tag rewrite
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
 | | ...
-| | interfaceAPI.Configure tag rewrite
+| | Configure tag rewrite
 | | ... | ${node} | ${super_if} | ${identifier} | ${settings}
 
 | Rewrite tag from Honeycomb should be empty
 | | [Arguments] | ${node} | ${super_if} | ${identifier}
 | | ...
 | | Run keyword and expect error | *Hon*Error*oper*does not contain*tag-rewrite*
-| | ... | interfaceAPI.Get tag rewrite oper data
+| | ... | Get tag rewrite oper data
 | | ... | ${node} | ${super_if} | ${identifier}
 
 | Rewrite tag from Honeycomb should be
 | | ... | \| ${tag_rewrite_push_oper} \|
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
-| | ${api_data}= | interfaceAPI.Get tag rewrite oper data
+| | ${api_data}= | Get tag rewrite oper data
 | | ... | ${node} | ${super_if} | ${identifier}
-| | interfaceAPI.Compare Data Structures
+| | Compare Data Structures
 | | ... | ${api_data} | ${settings}
 
 | Rewrite tag from VAT should be
 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${rw_params} \|
 | | ...
 | | [Arguments] | ${node} | ${interface} | ${rw_settings}
-| | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
-| | interfaceAPI.Compare Data Structures | ${vat_data} | ${rw_settings}
+| | ${vat_data}= | VPP get interface data | ${node} | ${interface}
+| | Compare Data Structures | ${vat_data} | ${rw_settings}
 
 | Honeycomb fails to set wrong rewrite tag
 | | [Documentation] | Honeycomb tries to set wrong rewrite tag and expects\
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
 | | Run keyword and expect error | *HoneycombError: * was not successful. *00.
-| | ... | interfaceAPI.Configure tag rewrite
+| | ... | Configure tag rewrite
 | | ... | ${node} | ${super_if} | ${identifier} | ${settings}
 
-| VAT disables tag-rewrite
-| | [Documentation] | The keyword disables the tag-rewrite using VAT.
-| | ...
-| | ... | *Arguments:*
-| | ... | - node - Information about a DUT node. Type: dictionary
-| | ... | - sub_interface - Name of an sub-interface on the specified node.\
-| | ... | Type: string
-| | ...
-| | ... | *Example:*
-| | ... | \| VAT disables tag-rewrite\
-| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \|
-| | ...
-| | [Arguments] | ${node} | ${sub_interface}
-| | ...
-| | ${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.
 | | ... | \| 192.168.0.2 \| ${24} \|
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix}
-| | Add ipv4 address to sub_interface
-| | ... | ${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\
 | | ... | \| 192.168.0.2 \| ${24} \|
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix}
-| | ${if_data}= | interfaceAPI.Get sub interface oper data
+| | ${if_data}= | Get sub interface oper data
 | | ... | ${node} | ${super_if} | ${identifier}
 | | Should be equal
 | | ... | ${if_data['ipv4']['address'][0]['ip']} | ${address}
 | | ${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
 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier}
-| | Remove all ipv4 addresses from sub_interface
-| | ... | ${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\
 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
 | | ...
 | | [Arguments] | ${node} | ${super_if} | ${identifier}
-| | ${if_data}= | interfaceAPI.Get sub interface oper data
+| | ${if_data}= | Get sub interface oper data
 | | ... | ${node} | ${super_if} | ${identifier}
 | | Run keyword and expect error | *KeyError: 'ipv4'*
 | | ... | Set Variable | ${if_data['ipv4']['address'][0]['ip']}
 | | ... | \| ${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
+| | ${data}= | VPP get interface ip addresses
+| | ... | ${node} | ${sub_interface} | ipv4
+| | Should be empty | ${data}
+
+| 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}= | 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}= | 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}= | 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}
+| | ${data}= | VPP get interface ip addresses
+| | ... | ${node} | ${sub_interface} | ipv6
+| | Should be empty | ${data}