Update l2_xconnect test to use NodePath 46/346/3
authorPatrik Hrnciar <phrnciar@cisco.com>
Thu, 18 Feb 2016 09:05:05 +0000 (10:05 +0100)
committerPatrik <phrnciar@cisco.com>
Thu, 18 Feb 2016 12:40:56 +0000 (13:40 +0100)
Change-Id: I9951a7e9a36dbc78c44f6bd868b4f6531ecb3349
Signed-off-by: Patrik Hrnciar <phrnciar@cisco.com>
resources/libraries/robot/l2_xconnect.robot
resources/templates/vat/l2_xconnect.vat
tests/suites/l2_xconnect/l2_xconnect_untagged.robot

index f42c748..e4dcddd 100644 (file)
 | Library | resources.libraries.python.CrossConnectSetup
 | Library | resources.libraries.python.topology.Topology
 | Library | resources.libraries.python.TrafficScriptExecutor
-| Library | resources.libraries.python.InterfaceUtil.InterfaceUtil
 | Variables | resources/libraries/python/constants.py
 
 *** Keywords ***
 
-| L2 setup xconnect on DUTs
+| L2 setup xconnect on DUT
 | | [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}
+| | [Arguments] | ${node} | ${if1} | ${if2} |
+| | Vpp Setup Bidirectional Cross Connect | ${node} | ${if1} | ${if2}
+
+| Send and receive traffic
+| | [Documentation] | Send traffic from source interface to destination interface
+| | [Arguments] | ${tg_node} | ${src_int} | ${dst_int}
+| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int}
+| | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int}
 | | ${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 | ${dst_port} | ${src_port} | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
-| | Run Traffic Script On Node | send_ip_icmp.py | ${node} | ${args}
-
-
-| Interfaces on all DUTs are in "${state}" state
-| | Set interface state | ${nodes['DUT1']} | ${nodes['DUT1']['interfaces']['port1']['name']} | ${state}
-| | Set interface state | ${nodes['DUT1']} | ${nodes['DUT1']['interfaces']['port3']['name']} | ${state}
-| | Set interface state | ${nodes['DUT2']} | ${nodes['DUT2']['interfaces']['port1']['name']} | ${state}
-| | Set interface state | ${nodes['DUT2']} | ${nodes['DUT2']['interfaces']['port3']['name']} | ${state}
+| | ${args}= | Traffic Script Gen Arg | ${dst_int} | ${src_int} | ${src_mac}
+| |          | ...                    | ${dst_mac} | ${src_ip} | ${dst_ip}
+| | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
index 77cb9d6..da1040e 100644 (file)
@@ -1 +1,3 @@
+sw_interface_set_flags sw_if_index {interface1} admin-up link-up
+sw_interface_set_flags sw_if_index {interface2} admin-up link-up
 sw_interface_set_l2_xconnect rx_sw_if_index {interface1} tx_sw_if_index {interface2}
index 286a63e..f6c1cbd 100644 (file)
 
 | Resource | resources/libraries/robot/default.robot
 | Resource | resources/libraries/robot/l2_xconnect.robot
+| Library | resources.libraries.python.NodePath
 | Force Tags | 3_NODE_SINGLE_LINK_TOPO
-| Suite Setup | Run Keywords | Setup all DUTs before test
-| ...         | AND          | Setup all TGs before traffic script
-| ...         | AND          | Interfaces on all DUTs are in "up" state
+| Test Setup | Setup all DUTs before test
+| Suite Setup | Setup all TGs before traffic script
+
 
 *** Test Cases ***
 
-| VPP forwards packets through xconnect in circular topology
-| | Given L2 setup xconnect on DUTs
-| | ${tg}= | Set Variable | ${nodes['TG']}
-| | ${dut1}= | Set Variable | ${nodes['DUT1']}
-| | ${dut2}= | Set Variable | ${nodes['DUT2']}
-| | ${tg_links}= | Get traffic links between TG "${tg}" and DUT1 "${dut1}" and DUT2 "${dut2}"
+| Vpp forwards packets via L2 xconnect in circular topology
+| | [Tags] | 3_NODE_SINGLE_LINK_TOPO
+| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
+| | Compute Path
+| | ${src_if} | ${tg}= | Next Interface
+| | ${dut1_if1} | ${dut1}= | Next Interface
+| | ${dut1_if2} | ${dut1}= | Next Interface
+| | ${dut2_if1} | ${dut2}= | Next Interface
+| | ${dut2_if2} | ${dut2}= | Next Interface
+| | ${dst_if} | ${tg}= | Next Interface
+| | L2 setup xconnect on DUT | ${dut1} | ${dut1_if1} | ${dut1_if2}
+| | L2 setup xconnect on DUT | ${dut2} | ${dut2_if1} | ${dut2_if2}
 | | Sleep | 10 | Work around VPP interface up taking too long.
-| | Send traffic on node "${nodes['TG']}" from link "${tg_links[0]}" to link "${tg_links[1]}"
-
+| | Send and receive traffic | ${tg} | ${src_if} | ${dst_if}