aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot
diff options
context:
space:
mode:
authorStefan Kobza <skobza@cisco.com>2016-02-11 19:09:06 +0100
committerStefan Kobza <skobza@cisco.com>2016-02-11 19:09:06 +0100
commitb92a827b1c7f48da4214e992e5503ebe1c182416 (patch)
treecf272e0cd0354d0f13bbcb65c170545e9492c60c /resources/libraries/robot
parent33499c81c94c2d3baef9d3e9f061cd76ef86fa74 (diff)
Update of latest tests.
Change-Id: Ifb04651ff4a3c1ba9aaa725eb9a309278ebc1140 Signed-off-by: Stefan Kobza <skobza@cisco.com>
Diffstat (limited to 'resources/libraries/robot')
-rw-r--r--resources/libraries/robot/bridge_domain.robot43
-rw-r--r--resources/libraries/robot/ipv4.robot41
-rw-r--r--resources/libraries/robot/l2_xconnect.robot50
-rw-r--r--resources/libraries/robot/vat/interfaces.robot2
4 files changed, 116 insertions, 20 deletions
diff --git a/resources/libraries/robot/bridge_domain.robot b/resources/libraries/robot/bridge_domain.robot
index fc3705700e..da669c42ce 100644
--- a/resources/libraries/robot/bridge_domain.robot
+++ b/resources/libraries/robot/bridge_domain.robot
@@ -12,16 +12,18 @@
# limitations under the License.
*** Settings ***
-| Library | resources/libraries/python/VatExecutor.py
-| Library | resources/libraries/python/VatConfigGenerator.py
+| Library | resources.libraries.python.VatExecutor
+| Library | resources.libraries.python.VatConfigGenerator
| Library | resources.libraries.python.topology.Topology
-| Library | resources/libraries/python/TrafficScriptExecutor.py
+| Library | resources.libraries.python.TrafficScriptExecutor
+| Library | resources.libraries.python.L2Util
| Variables | resources/libraries/python/constants.py
*** Variables ***
| ${VAT_BD_TEMPLATE} | ${Constants.RESOURCES_TPL_VAT}/l2_bridge_domain.vat
+| ${VAT_BD_STATIC_TPL} | ${Constants.RESOURCES_TPL_VAT}/l2_bridge_domain_static.vat
| ${VAT_BD_GEN_FILE} | ${Constants.RESOURCES_TPL_VAT}/l2_bridge_domain_gen.vat
-| ${VAT_BD_REMOTE_PATH} | ${Constants.REMOTE_FW_DIR}/l2_bridge_domain_gen.vat
+| ${VAT_BD_REMOTE_PATH} | ${Constants.REMOTE_FW_DIR}/${Constants.RESOURCES_TPL_VAT}/l2_bridge_domain_gen.vat
*** Keywords ***
| Setup l2 bridge on node "${node}" via links "${link_names}"
@@ -32,6 +34,14 @@
| | Execute Script | l2_bridge_domain_gen.vat | ${node} | json_out=False
| | Script Should Have Passed
+| Setup l2 bridge with static fib on node "${node}" via links "${link_names}" on bd with index "${bd_id}"
+| | ${vat_template_dict}= | Create dict used in bridge domain template file for node "${node}" with links "${link_names}" and bd_id "${bd_id}"
+| | ${commands}= | Generate Vat Config File | ${VAT_BD_STATIC_TPL} | ${vat_template_dict} | ${VAT_BD_GEN_FILE}
+| | Copy Config To Remote | ${node} | ${VAT_BD_GEN_FILE} | ${VAT_BD_REMOTE_PATH}
+# TODO: will be removed once v4 is merged to master.
+| | Execute Script | l2_bridge_domain_gen.vat | ${node} | json_out=False
+| | Script Should Have Passed
+
| Send traffic on node "${node}" from link "${link1}" to link "${link2}"
| | ${src_port}= | Get Interface By Link Name | ${node} | ${link1}
| | ${dst_port}= | Get Interface By Link Name | ${node} | ${link2}
@@ -39,16 +49,21 @@
| | ${dst_ip}= | Set Variable | 192.168.100.2
| | ${src_mac}= | Get Node Link Mac | ${node} | ${link1}
| | ${dst_mac}= | Get Node Link Mac | ${node} | ${link2}
-| | ${args}= | Traffic Script Gen Arg | ${src_port} | ${src_port} | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
+| | ${args}= | Traffic Script Gen Arg | ${dst_port} | ${src_port} | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
| | Run Traffic Script On Node | send_ip_icmp.py | ${node} | ${args}
| Setup TG "${tg}" DUT1 "${dut1}" and DUT2 "${dut2}" for 3 node l2 bridge domain test
-| | ${DUT1_DUT2_link}= | Get first active connecting link between node "${dut1}" and "${dut2}"
-| | ${DUT1_TG_link}= | Get first active connecting link between node "${dut1}" and "${tg}"
-| | ${DUT2_TG_link}= | Get first active connecting link between node "${dut2}" and "${tg}"
-| | ${tg_traffic_links}= | Create List | ${DUT1_TG_link} | ${DUT2_TG_link}
-| | ${DUT1_BD_links}= | Create_list | ${DUT1_DUT2_link} | ${DUT1_TG_link}
-| | ${DUT2_BD_links}= | Create_list | ${DUT1_DUT2_link} | ${DUT2_TG_link}
-| | Setup l2 bridge on node "${dut1}" via links "${DUT1_BD_links}"
-| | Setup l2 bridge on node "${dut2}" via links "${DUT2_BD_links}"
-| | [Return] | ${tg_traffic_links} \ No newline at end of file
+| | ${topology_links}= | Get link data useful in circular topology test from tg "${tg}" dut1 "${dut1}" dut2 "${dut2}"
+| | Setup l2 bridge on node "${dut1}" via links "${topology_links['DUT1_BD_LINKS']}"
+| | Setup l2 bridge on node "${dut2}" via links "${topology_links['DUT2_BD_LINKS']}"
+| | [Return] | ${topology_links['TG_TRAFFIC_LINKS']}
+
+| Setup TG "${tg}" DUT1 "${dut1}" and DUT2 "${dut2}" for 3 node static l2fib test
+| | ${topology_links}= | Get link data useful in circular topology test from tg "${tg}" dut1 "${dut1}" dut2 "${dut2}"
+| | ${dst_mac}= | Get Node Link Mac | ${tg} | ${topology_links["DUT2_TG_LINK"]}
+| | ${bd_index}= | Set Variable | 1
+| | Setup l2 bridge with static fib on node "${dut1}" via links "${topology_links['DUT1_BD_LINKS']}" on bd with index "${bd_index}"
+| | Setup static L2FIB entry on node "${dut1}" for MAC "${dst_mac}" link "${topology_links['DUT1_DUT2_LINK']}" pair on bd_index "${bd_index}"
+| | Setup l2 bridge with static fib on node "${dut2}" via links "${topology_links['DUT2_BD_LINKS']}" on bd with index "${bd_index}"
+| | Setup static L2FIB entry on node "${dut2}" for MAC "${dst_mac}" link "${topology_links['DUT2_TG_LINK']}" pair on bd_index "${bd_index}"
+| | [Return] | ${topology_links["TG_TRAFFIC_LINKS"]}
diff --git a/resources/libraries/robot/ipv4.robot b/resources/libraries/robot/ipv4.robot
index a4e1086d38..60d729fa7f 100644
--- a/resources/libraries/robot/ipv4.robot
+++ b/resources/libraries/robot/ipv4.robot
@@ -13,15 +13,16 @@
*** Settings ***
| Resource | resources/libraries/robot/default.robot
| Resource | resources/libraries/robot/counters.robot
-| Library | resources/libraries/python/IPv4Util.py
+| Library | resources.libraries.python.IPv4Util
+| Library | resources.libraries.python.TrafficScriptExecutor
| Variables | resources/libraries/python/IPv4NodeAddress.py
*** Keywords ***
-| Setup IPv4 adresses on all nodes in topology
+| Setup IPv4 adresses on all DUT nodes in topology
| | [Documentation] | Setup IPv4 address on all DUTs and TG in topology
| | [Arguments] | ${nodes} | ${nodes_addr}
-| | Nodes setup IPv4 addresses | ${nodes} | ${nodes_addr}
+| | DUT nodes setup IPv4 addresses | ${nodes} | ${nodes_addr}
| Interfaces needed for IPv4 testing are in "${state}" state
| | Node "${nodes['DUT1']}" interface "${nodes['DUT1']['interfaces']['port1']['name']}" is in "${state}" state
@@ -41,11 +42,41 @@
| Setup nodes for IPv4 testing
| | Interfaces needed for IPv4 testing are in "up" state
-| | Setup IPv4 adresses on all nodes in topology | ${nodes} | ${nodes_ipv4_addr}
+| | Setup IPv4 adresses on all DUT nodes in topology | ${nodes} | ${nodes_ipv4_addr}
+| | Setup ARP on all DUTs | ${nodes}
| | Routes are set up for IPv4 testing
| TG interface "${tg_port}" can route to node "${node}" interface "${port}" "${hops}" hops away using IPv4
| | Node "${nodes['TG']}" interface "${tg_port}" can route to node "${node}" interface "${port}" "${hops}" hops away using IPv4
| Node "${from_node}" interface "${from_port}" can route to node "${to_node}" interface "${to_port}" "${hops}" hops away using IPv4
-| | After ping is sent from node "${from_node}" interface "${from_port}" with destination IPv4 address of node "${to_node}" interface "${to_port}" a ping response arrives and TTL is decreased by "${hops}"
+| | After ping is sent in topology "${nodes}" from node "${from_node}" interface "${from_port}" with destination IPv4 address of node "${to_node}" interface "${to_port}" a ping response arrives and TTL is decreased by "${hops}"
+
+| Ipv4 icmp echo sweep
+| | [Documentation] | Type of the src_node must be TG and dst_node must be DUT
+| | [Arguments] | ${src_node} | ${dst_node} | ${src_port} | ${dst_port}
+| | ${src_ip}= | Get IPv4 address of node "${src_node}" interface "${src_port}"
+| | ${dst_ip}= | Get IPv4 address of node "${dst_node}" interface "${dst_port}"
+| | ${src_mac}= | Get Interface Mac | ${src_node} | ${src_port}
+| | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_port}
+| | ${args}= | Traffic Script Gen Arg | ${src_port} | ${src_port} | ${src_mac}
+| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip}
+| # TODO: end_size is currently minimum MTU size for Ethernet minus IPv4 and
+| # ICMP echo header size (1500 - 20 - 8),
+| # MTU info is not in VAT sw_interface_dump output
+| | ${args}= | Set Variable | ${args} --start_size 0 --end_size 1472 --step 1
+| | Run Traffic Script On Node | ipv4_sweep_ping.py | ${src_node} | ${args}
+
+| Send ARP request and validate response
+| | [Arguments] | ${tg_node} | ${vpp_node}
+| | ${link_name}= | Get first active connecting link between node "${tg_node}" and "${vpp_node}"
+| | ${src_if}= | Get interface by link name | ${tg_node} | ${link_name}
+| | ${dst_if}= | Get interface by link name | ${vpp_node} | ${link_name}
+| | ${src_ip}= | Get IPv4 address of node "${tg_node}" interface "${src_if}"
+| | ${dst_ip}= | Get IPv4 address of node "${vpp_node}" interface "${dst_if}"
+| | ${src_mac}= | Get node link mac | ${tg_node} | ${link_name}
+| | ${dst_mac}= | Get node link mac | ${vpp_node} | ${link_name}
+| | ${args}= | Traffic Script Gen Arg | ${src_if} | ${src_if} | ${src_mac}
+| | | ... | ${dst_mac} | ${src_ip} | ${dst_ip}
+| | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args}
+
diff --git a/resources/libraries/robot/l2_xconnect.robot b/resources/libraries/robot/l2_xconnect.robot
new file mode 100644
index 0000000000..001062c616
--- /dev/null
+++ b/resources/libraries/robot/l2_xconnect.robot
@@ -0,0 +1,50 @@
+# 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
+| Library | resources.libraries.python.CrossConnectSetup
+| Library | resources.libraries.python.topology.Topology
+| Library | resources.libraries.python.TrafficScriptExecutor
+| Variables | resources/libraries/python/constants.py
+
+*** Keywords ***
+
+| L2 setup xconnect on DUTs
+| | [Documentation] | Setup Bidirectional Cross Connect on DUTs
+# TODO: rewrite with dynamic path selection
+| | Vpp Setup Bidirectional Cross Connect | ${nodes['DUT1']}
+| | ... | ${nodes['DUT1']['interfaces']['port1']['name']}
+| | ... | ${nodes['DUT1']['interfaces']['port3']['name']}
+| | Vpp Setup Bidirectional Cross Connect | ${nodes['DUT2']}
+| | ... | ${nodes['DUT2']['interfaces']['port1']['name']}
+| | ... | ${nodes['DUT2']['interfaces']['port3']['name']}
+
+
+| Get traffic links between TG "${tg}" and DUT1 "${dut1}" and DUT2 "${dut2}"
+| | ${DUT1_TG_link}= | Get first active connecting link between node "${dut1}" and "${tg}"
+| | ${DUT2_TG_link}= | Get first active connecting link between node "${dut2}" and "${tg}"
+| | ${tg_traffic_links}= | Create List | ${DUT1_TG_link} | ${DUT2_TG_link}
+| | [Return] | ${tg_traffic_links}
+
+
+| Send traffic on node "${node}" from link "${link1}" to link "${link2}"
+| | ${src_port}= | Get Interface By Link Name | ${node} | ${link1}
+| | ${dst_port}= | Get Interface By Link Name | ${node} | ${link2}
+| | ${src_ip}= | Set Variable | 192.168.100.1
+| | ${dst_ip}= | Set Variable | 192.168.100.2
+| | ${src_mac}= | Get Node Link Mac | ${node} | ${link1}
+| | ${dst_mac}= | Get Node Link Mac | ${node} | ${link2}
+| | ${args}= | Traffic Script Gen Arg | ${src_port} | ${src_port} | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
+| | Run Traffic Script On Node | send_ip_icmp.py | ${node} | ${args}
diff --git a/resources/libraries/robot/vat/interfaces.robot b/resources/libraries/robot/vat/interfaces.robot
index 1342f6326b..3a6c4be205 100644
--- a/resources/libraries/robot/vat/interfaces.robot
+++ b/resources/libraries/robot/vat/interfaces.robot
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
*** Settings ***
-| Library | resources/libraries/python/VatExecutor.py
+| Library | resources.libraries.python.VatExecutor
*** Variables ***
| ${VAT_DUMP_INTERFACES} | dump_interfaces.vat