CSIT-506: HC Test- Update and cleanup all suites
[csit.git] / resources / libraries / robot / honeycomb / interfaces.robot
index 706da54..3c91c77 100644 (file)
 | ...     | WITH NAME | InterfaceAPI
 
 *** Keywords ***
-| 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}
-| | interfaceCLI.Set interface state | ${node} | ${interface} | ${state}
-| | ... | if_type=name
-
 | Honeycomb sets interface state
 | | [Documentation] | Uses Honeycomb API to change the admin state\
 | | ... | of the specified interface.
 
 | IPv4 neighbor from Honeycomb should be
 | | [Documentation] | Retrieves ipv4 neighbor list through Honeycomb\
-| | and compares with neighbor list supplied in argument.
+| | ... | and compares the first entry with addresses supplied in arguments.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - information about a DUT node. Type: dictionary
 | | ... | - interface - name of an interface on the specified node. Type: string
-| | ... | - neighbors - list of ipv4 neighbor dictionaries. Type: list
+| | ... | - ip_address - ipv4 address of expected neighbor entry. Type: string
+| | ... | - mac_address - MAC address of expected neighbor entry. Type: string
 | | ...
 | | ... | *Example:*
 | | ...
 | | ... | \| IPv4 neighbor from Honeycomb should be \| ${nodes['DUT1']} \
 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.4 \| 08:00:27:60:26:ab \|
-| | [Arguments] | ${node} | ${interface} | @{neighbors}
+| | [Arguments] | ${node} | ${interface} | ${ip_address} | ${mac_address}
 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
-| | ${data_neighbors}= | Set Variable | ${api_data['ietf-ip:ipv4']['neighbor']}
-| | Compare data structures
-| | ... | ${data_neighbors} | ${neighbors} | list_order=${False}
-| | Should be equal | ${neighbor['fib_address']}
+| | Should be equal | ${ip_address}
 | | ... | ${api_data['ietf-ip:ipv4']['neighbor'][0]['ip']}
-| | Should be equal | ${neighbor['fib_mac']}
+| | Should be equal | ${mac_address}
 | | ... | ${api_data['ietf-ip:ipv4']['neighbor'][0]['link-layer-address']}
 
 | Honeycomb clears all interface ipv4 neighbors
 | | ... | \| Honeycomb clears all interface ipv4 neighbors \| ${nodes['DUT1']} \
 | | ... | \| GigabitEthernet0/8/0 \|
 | | [Arguments] | ${node} | ${interface}
-| | interfaceAPI.clear all ipv4 neighbors | ${node} | ${interface}
+| | interfaceAPI.Remove all ipv4 neighbors | ${node} | ${interface}
 
 | Honeycomb sets interface ipv6 address
 | | [Documentation] | Uses Honeycomb API to change ipv6 address\
 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
 | | ${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}
+| | ${settings}= | Create Dictionary
+| | ... | ip=${address} | prefix-length=${prefix}
+| | Should contain | ${api_data['ietf-ip:ipv6']['address']} | ${settings}
 
 | IPv6 address from VAT should be
 | | [Documentation] | Retrieves interface ipv6 address through VAT and\
 | | [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}
+| | ${settings}= | Create Dictionary
+| | ... | ip=${address} | prefix_length=${prefix}
+| | Should contain | ${vpp_data} | ${settings}
 
-| Honeycomb sets interface ethernet and routing configuration
-| | [Documentation] | Uses Honeycomb API to change interface configuration.
+| Honeycomb sets interface ethernet configuration
+| | [Documentation] | Uses Honeycomb API to change interface ethernet\
+| | ... | 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}
+| | [Arguments] | ${node} | ${interface} | ${ethernet}
 | | :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\
+| Interface ethernet configuration from Honeycomb should be
+| | [Documentation] | Retrieves interface 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}
+| | ... | \| ${{'mtu': 1500}} \|
+| | [Arguments] | ${node} | ${interface} | ${ethernet}
 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
 | | :FOR | ${key} | IN | @{ethernet.keys()}
 | | | Should be equal
 | | | ... | ${api_data['v3po:ethernet']['${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\
+| Interface ethernet configuration from VAT should be
+| | [Documentation] | Retrieves interface 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}
+| | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1500} \|
+| | [Arguments] | ${node} | ${interface} | ${mtu}
 | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
 | | Should be equal | ${vat_data['mtu']} | ${mtu}
 
 | | ${sw_if_index}= | EVALUATE | ${vat_data['sw_if_index']} + 1
 | | Should be equal as strings
 | | ... | ${api_data['if-index']} | ${sw_if_index}
+
+| Get Interface index from oper data
+| | [Documentation] | Retrieves interface operational data and returns\
+| | ... | if-index of the specified interface.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - interface - name of the interface. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Get Interface index from oper data \| ${nodes['DUT1']} \| local0 \|
+| | [Arguments] | ${node} | ${interface}
+| | ${data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
+| | Return from keyword | ${data['if-index']}
+
+| Honeycomb should show disabled interface in oper data
+| | [Documentation] | Retrieves list of disabled interfaces\
+| | ... | and verifies that there is at least one.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - index - index of the interface to be checked. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb should show disabled interface in oper data \
+| | ... | \|${nodes['DUT1']} \| ${vx_interface} \|
+| | [Arguments] | ${node} | ${index}
+| | interfaceAPI.check disabled interface | ${node} | ${index}
+
+| Honeycomb should not show disabled interface in oper data
+| | [Documentation] | Retrieves list of disabled interfaces\
+| | ... | and expects to fail with a 404 - not found.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - information about a DUT node. Type: dictionary
+| | ... | - index - index of the interface to be checked. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb should not show disabled interface in oper data \
+| | ... | \|${nodes['DUT1']} \| ${vx_interface} \|
+| | [Arguments] | ${node} | ${index}
+| | Run keyword and expect error | *
+| | ... | Honeycomb should show disabled interface in oper data
+| | ... | ${node} | ${index}