diff options
author | Tibor Frank <tifrank@cisco.com> | 2017-06-16 09:38:28 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2017-06-26 12:37:26 +0000 |
commit | 41bded220766aad6f805a9864ef677abe9ff9004 (patch) | |
tree | 6df32095797eccd6e9e039d0fefaf773d67455cd /resources | |
parent | 2f55e281e2b8f820bfb5939172ba45bbcce6a7fa (diff) |
CSIT-683: Re-organize L2 libraries - func
Change-Id: I5444dfba68ea41d8190d6615e23505f3c08c377c
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r-- | resources/libraries/robot/interfaces.robot | 9 | ||||
-rw-r--r-- | resources/libraries/robot/l2_traffic.robot | 76 | ||||
-rw-r--r-- | resources/libraries/robot/vat/interfaces.robot | 23 | ||||
-rw-r--r-- | resources/libraries/robot/vrf.robot | 75 | ||||
-rw-r--r-- | resources/libraries/robot/vxlan.robot | 4 |
5 files changed, 44 insertions, 143 deletions
diff --git a/resources/libraries/robot/interfaces.robot b/resources/libraries/robot/interfaces.robot index 1161e85174..c2b897d6a0 100644 --- a/resources/libraries/robot/interfaces.robot +++ b/resources/libraries/robot/interfaces.robot @@ -13,13 +13,12 @@ *** Settings *** | Library | resources.libraries.python.InterfaceUtil | Library | resources.libraries.python.NodePath -| Resource | resources/libraries/robot/vat/interfaces.robot +| Library | resources.libraries.python.VatExecutor *** Keywords *** -| Report VPP interfaces | [Arguments] | ${node} -| | VPP reports interfaces through VAT on | ${node} -#| | VPP reports interfaces through ODL on | ${node} -#| | VPP reports interfaces through DEBUGCLI on | ${node} +| VPP reports interfaces through VAT on '${node}' +| | Execute Script | dump_interfaces.vat | ${node} +| | Script Should Have Passed | Configure MTU on TG based on MTU on DUT | | [Documentation] | Type of the tg_node must be TG and dut_node must be DUT diff --git a/resources/libraries/robot/l2_traffic.robot b/resources/libraries/robot/l2_traffic.robot index 75ba532975..bca801778e 100644 --- a/resources/libraries/robot/l2_traffic.robot +++ b/resources/libraries/robot/l2_traffic.robot @@ -12,16 +12,16 @@ # limitations under the License. *** Settings *** -| Documentation | Keywords to send and receive different types of traffic \ -| ... | through L2 network. | Library | resources.libraries.python.topology.Topology | Library | resources.libraries.python.TrafficScriptExecutor +| Documentation | Keywords to send and receive different types of traffic \ +| ... | through L2 network. *** Keywords *** | Send ICMP packet and verify received packet | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to \ -| | ... | destination interface. Packet can be set with Dot1q or -| | ... | Dot1ad tag(s) when required. +| | ... | destination interface. Packet can be set with Dot1q or +| | ... | Dot1ad tag(s) when required. | | ... | | ... | *Arguments:* | | ... @@ -48,20 +48,23 @@ | | ... | | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \| ${tg_to_dut1} \ -| | ... | \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=100 \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \| ${tg_to_dut1} \ -| | ... | \| ${tg_to_dut2} \| encaps=Dot1ad \| vlan1=110 \| vlan2=220 \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \| ${tg_to_dut1} \ -| | ... | \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \| encaps_rx=Dot1q \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \| ${tg_to_dut1} \ -| | ... | \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \| encaps_rx=Dot1q \ -| | ... | \| vlan1_rx=120 \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=100 \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1ad \| vlan1=110 \ +| | ... | \| vlan2=220 \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ +| | ... | \| encaps_rx=Dot1q \| +| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ +| | ... | \| encaps_rx=Dot1q \| vlan1_rx=120 \| | | ... | | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} | | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 | ${encaps}=${EMPTY} | | ... | ${vlan1}=${EMPTY} | ${vlan2}=${EMPTY} | ${encaps_rx}=${EMPTY} | | ... | ${vlan1_rx}=${EMPTY} | ${vlan2_rx}=${EMPTY} +| | ... | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} | | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} | | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} @@ -69,26 +72,26 @@ | | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} | | ${args}= | Run Keyword If | '${encaps}' == '${EMPTY}' -| | | ... | Set Variable | ${args} +| | | ... | Set Variable | ${args} | | ... | ELSE | Catenate | ${args} | --encaps ${encaps} | --vlan1 ${vlan1} | | ${args}= | Run Keyword If | '${vlan2}' == '${EMPTY}' -| | | ... | Set Variable | ${args} +| | | ... | Set Variable | ${args} | | ... | ELSE | Catenate | ${args} | --vlan2 ${vlan2} | | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} +| | | ... | Set Variable | ${args} | | ... | ELSE | Catenate | ${args} | --encaps_rx ${encaps_rx} | | ${args}= | Run Keyword If | '${vlan1_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} +| | | ... | Set Variable | ${args} | | ... | ELSE | Catenate | ${args} | --vlan1_rx ${vlan1_rx} | | ${args}= | Run Keyword If | '${vlan2_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} +| | | ... | Set Variable | ${args} | | ... | ELSE | Catenate | ${args} | --vlan2_rx ${vlan2_rx} | | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} | ICMP packet transmission should fail | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to -| | ... | destination interface and expect failure with -| | ... | ICMP echo Rx timeout error message. +| | ... | destination interface and expect failure with +| | ... | ICMP echo Rx timeout error message. | | ... | | ... | *Arguments:* | | ... @@ -111,6 +114,7 @@ | | ... | | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} | | | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 +| | ... | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} | | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} | | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} @@ -122,8 +126,7 @@ | Send ICMPv4 bidirectionally and verify received packets | | [Documentation] | Send ICMPv4 echo request from both directions, -| | ... | from interface1 to interface2 and -| | ... | from interface2 to interface1. +| | ... | from interface1 to interface2 and from interface2 to interface1. | | ... | | ... | *Arguments:* | | ... @@ -139,20 +142,20 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Send ICMPv4 bidirectionally and verify received packets \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| +| | ... | \| Send ICMPv4 bidirectionally and verify received packets \ +| | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| | | ... | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 | | | ... | ${dst_ip}=192.168.100.2 -| | Send ICMP packet and verify received packet | ${tg_node} | ${int1} | ${int2} | -| | ... | ${src_ip} | ${dst_ip} -| | Send ICMP packet and verify received packet | ${tg_node} | ${int2} | ${int1} | -| | ... | ${dst_ip} | ${src_ip} +| | ... +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} | Send ICMPv6 bidirectionally and verify received packets | | [Documentation] | Send ICMPv6 echo request from both directions, -| | ... | from interface1 to interface2 and -| | ... | from interface2 to interface1. +| | ... | from interface1 to interface2 and from interface2 to interface1. | | ... | | ... | *Arguments:* | | ... @@ -168,12 +171,13 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Send ICMPv6 bidirectionally and verify received packets \| ${nodes['TG']} \ -| | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| +| | ... | \| Send ICMPv6 bidirectionally and verify received packets \ +| | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| | | ... | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 | | | ... | ${dst_ip}=3ffe:63::2 -| | Send ICMP packet and verify received packet | ${tg_node} | ${int1} | ${int2} | -| | ... | ${src_ip} | ${dst_ip} -| | Send ICMP packet and verify received packet | ${tg_node} | ${int2} | ${int1} | -| | ... | ${dst_ip} | ${src_ip} +| | ... +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} +| | Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} diff --git a/resources/libraries/robot/vat/interfaces.robot b/resources/libraries/robot/vat/interfaces.robot deleted file mode 100644 index 3a6c4be205..0000000000 --- a/resources/libraries/robot/vat/interfaces.robot +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*** Settings *** -| Library | resources.libraries.python.VatExecutor - -*** Variables *** -| ${VAT_DUMP_INTERFACES} | dump_interfaces.vat - -*** Keywords *** -| VPP reports interfaces through VAT on -| | [Arguments] | ${node} -| | Execute Script | ${VAT_DUMP_INTERFACES} | ${node} -| | Script Should Have Passed diff --git a/resources/libraries/robot/vrf.robot b/resources/libraries/robot/vrf.robot deleted file mode 100644 index ef6091ec89..0000000000 --- a/resources/libraries/robot/vrf.robot +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -*** Settings *** -#| Resource | resources/libraries/robot/interfaces.robot -| Library | resources.libraries.python.Routing -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPv6Util - -*** Keywords *** -| Setup VRF on DUT -| | [Documentation] -| | ... | The keyword sets a FIB table on a DUT, assigns two interfaces to it,\ -| | ... | adds two ARP items and a route, see example. -| | ... -| | ... | *Arguments* -| | ... | - node - DUT node. Type: dictionary -| | ... | - table - FIB table ID. Type: integer -| | ... | - route_interface - Destination interface to be assigned to FIB.\ -| | ... | Type: string -| | ... | - route_gateway_ip - Route gateway IP address. Type: string -| | ... | - route_gateway_mac - Route gateway MAC address. Type string -| | ... | - route_dst_ip - Route destination IP. Type: string -| | ... | - vrf_src_if - Source interface to be assigned to FIB. Type: string -| | ... | - src_if_ip - IP address of the source interface. Type: string -| | ... | - src_if_mac - MAC address of the source interface. Type: string -| | ... | - prefix_len - Prefix length. Type: int -| | ... -| | ... | *Example:* -| | ... | Three-node topology: -| | ... | TG_if1 - DUT1_if1-DUT1_if2 - DUT2_if1-DUT2_if2 - TG_if2 -| | ... | Create one VRF on each DUT: -| | ... | \| Setup VRF on DUT \| ${dut1_node} \| ${dut1_fib_table} \ -| | ... | \| ${dut1_to_dut2} \| ${dut2_to_dut1_ip4} \| ${dut2_to_dut1_mac} \ -| | ... | \| ${tg2_ip4} \| ${dut1_to_tg} \| ${tg1_ip4} \| ${tg_to_dut1_mac} \ -| | ... | \| 24 \| -| | ... | \| Setup VRF on DUT \| ${dut2_node} \| ${dut2_fib_table} \ -| | ... | \| ${dut2_to_dut1} \| ${dut1_to_dut2_ip4} \| ${dut1_to_dut2_mac} \ -| | ... | \| ${tg1_ip4} \| ${dut2_to_tg} \| ${tg2_ip4} \| ${tg_to_dut2_mac} \ -| | ... | \| 24 \| -| | ... -| | [Arguments] -| | ... | ${node} | ${table} | ${route_interface} | ${route_gateway_ip} -| | ... | ${route_gateway_mac} | ${route_dst_ip} | ${vrf_src_if} | ${src_if_ip} -| | ... | ${src_if_mac} | ${prefix_len} -| | ... -| | ${route_interface_idx}= | Get Interface SW Index -| | ... | ${node} | ${route_interface} -| | ... -| | Add fib table | ${node} -| | ... | ${route_dst_ip} | ${prefix_len} | ${table} -| | ... | via ${route_gateway_ip} sw_if_index ${route_interface_idx} multipath -| | ... -| | Assign Interface To Fib Table -| | ... | ${node} | ${route_interface} | ${table} -| | Assign Interface To Fib Table -| | ... | ${node} | ${vrf_src_if} | ${table} -| | ... -| | Add IP Neighbor | ${node} | ${vrf_src_if} -| | ... | ${src_if_ip} | ${src_if_mac} -| | Add IP Neighbor | ${node} | ${route_interface} -| | ... | ${route_gateway_ip} | ${route_gateway_mac} -| | ... -| | Vpp Route Add | ${node} | ${route_dst_ip} | ${prefix_len} -| | ... | ${route_gateway_ip} | ${route_interface} | vrf=${table} diff --git a/resources/libraries/robot/vxlan.robot b/resources/libraries/robot/vxlan.robot index 0c149fdcda..d867189a15 100644 --- a/resources/libraries/robot/vxlan.robot +++ b/resources/libraries/robot/vxlan.robot @@ -64,10 +64,6 @@ | | [Arguments] | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2} | | Vpp Add L2 Bridge Domain | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2} -| Add interfaces to L2XC -| | [Arguments] | ${DUT} | ${INTERFACE_1} | ${INTERFACE_2} -| | Configure L2XC | ${DUT} | ${INTERFACE_1} | ${INTERFACE_2} - | Create vlan interfaces for VXLAN | | [Documentation] | *Create VLAN subinterface on interfaces on DUTs with given VLAN ID.* | | ... |