diff options
author | Tibor Frank <tifrank@cisco.com> | 2017-06-20 13:57:08 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2017-06-29 12:17:28 +0000 |
commit | 6721e7f09aa95bff6622068332a3f56afad9c87b (patch) | |
tree | 37ef7f40e53f740a62830ab46142aa87342dc56b /tests/vpp/func/vm_vhost/l2bd | |
parent | 859157b5db45927c7b4bb0b2d575e68805777a86 (diff) |
CSIT-687: Directory structure reorganization
Change-Id: I772c9e214be2461adf58124998d272e7d795220f
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Signed-off-by: Maciek Konstantynowicz <mkonstan@cisco.com>
Diffstat (limited to 'tests/vpp/func/vm_vhost/l2bd')
8 files changed, 1546 insertions, 0 deletions
diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm-func.robot new file mode 100644 index 0000000000..7eb7d3e857 --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm-func.robot @@ -0,0 +1,145 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/l2/tagging.robot +| Resource | resources/libraries/robot/l2/l2_traffic.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/vm/double_qemu_setup.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_DOUBLE_LINK_TOPO | HW_ENV | VM_ENV | VPP_VM_ENV +| Test Setup | Set up functional test +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| ... | AND | Stop and clear QEMU | ${dut_node} | ${vm_node} +| ... | AND | Verify VPP PID in Teardown +| Documentation | *L2 bridge domain with VLAN tag over VM test cases* +| ... +| ... | *[Top] Network Topologies:* TG=DUT 2-node circular topology +| ... | with double links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-ICMPv4 or +| ... | Eth-dot1q-IPv6-ICMPv6 on TG=DUT and on DUT=VM. +| ... | *[Cfg] DUT configuration:* DUT is configured with two bridge domains +| ... | (L2BD) with MAC learning enabled; each one with added VLAN +| ... | sub-interface towards TG and vhost-user interface to local VM. Configure +| ... | linux bridge on VM to pass traffic between both vhost-user interfaces. +| ... | *[Ver] TG verification:* Make TG send ICMPv4/ICMPv6 Echo Req between two +| ... | of its interfaces to be switched by DUT via VM; verify packets are +| ... | switched between these TG interfaces; on receive TG verifies packets for +| ... | correctness and their IPv4 src-addr, dst-addr, MAC addresses and +| ... | VLAN tag. +| ... | *[Ref] Applicable standard specifications:* IEEE 802.1q. + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 + +| ${vlan_id1}= | 110 +| ${vlan_wrong}= | 150 + +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +| ${ip4_1}= | 192.168.100.1 +| ${ip4_2}= | 192.168.100.2 + +| ${ip6_1}= | 3ffe:63::1 +| ${ip6_2}= | 3ffe:63::2 + +*** Test Cases *** +| TC01: eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm - ipv4 +| | [Documentation] +| | ... | [Top] TG=DUT. +| | ... | [Enc] Eth-dot1q-IPv4-ICMPv4 on TG=DUT and on DUT=VM. +| | ... | [Cfg] On DUT configure two L2BDs (MAC learning enabled); first L2BD +| | ... | with Dot1Q tagged interface to TG-if1 and vhost-user interface to +| | ... | local VM, second one with vhost-user interface to local VM and Dot1Q +| | ... | tagged interface towards TG-if2. Configure linux bridge on VM to pass +| | ... | traffic between both vhost-user interfaces. +| | ... | [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT and VM; verify +| | ... | that packet is received. +| | ... | [Ref] IEEE 802.1q +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | ${vlan1_name} | ${vlan1_index}= | When Create vlan sub-interface +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${vlan_id1} +| | And Configure vhost interfaces for L2BD forwarding +| | ... | ${dut_node} | ${sock1} | ${sock2} +| | And Configure VM for vhost L2BD forwarding +| | ... | ${dut_node} | ${sock1} | ${sock2} +| | And Add interface to bridge domain | ${dut_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vlan2_index} +| | ... | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | Then Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} | ${ip4_1} | ${ip4_2} +| | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q +| | And Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} | ${ip4_2} | ${ip4_1} +| | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q + +| TC01: eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm - ipv6 +| | [Documentation] +| | ... | [Top] TG=DUT. +| | ... | [Enc] Eth-dot1q-IPv6-ICMPv6 on TG=DUT and on DUT=VM. +| | ... | [Cfg] On DUT configure two L2BDs (MAC learning enabled); first L2BD +| | ... | with Dot1Q tagged interface to TG-if1 and vhost-user interface to +| | ... | local VM, second one with vhost-user interface to local VM and Dot1Q +| | ... | tagged interface towards TG-if2. Configure linux bridge on VM to pass +| | ... | traffic between both vhost-user interfaces. +| | ... | [Ver] Make TG send ICMPv6 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT and VM; verify +| | ... | that packet is received. +| | ... | [Ref] IEEE 802.1q +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | ${vlan1_name} | ${vlan1_index}= | When Create vlan sub-interface +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${vlan_id1} +| | And Configure vhost interfaces for L2BD forwarding +| | ... | ${dut_node} | ${sock1} | ${sock2} +| | And Configure VM for vhost L2BD forwarding +| | ... | ${dut_node} | ${sock1} | ${sock2} +| | And Add interface to bridge domain | ${dut_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vlan2_index} +| | ... | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | Then Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} | ${ip6_1} | ${ip6_2} +| | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q +| | And Send ICMP packet and verify received packet +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} | ${ip6_2} | ${ip6_1} +| | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q + + + + diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-dot1q-l2bdbasemaclrn-eth-4vhost-2vm-fds-provider-nets-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-dot1q-l2bdbasemaclrn-eth-4vhost-2vm-fds-provider-nets-func.robot new file mode 100644 index 0000000000..6bf594c0df --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-dot1q-l2bdbasemaclrn-eth-4vhost-2vm-fds-provider-nets-func.robot @@ -0,0 +1,341 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/ip/ip4.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/vm/double_qemu_setup.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/fds/default.robot +| Library | resources.libraries.python.Trace +| ... +| Force Tags | HW_ENV | VM_ENV | SKIP_PATCH +| ... +| Test Setup | Set up FDS functional test | ${nodes} +| ... +| Test Teardown | Tear down FDS functional test | ${nodes} +| ... | ${dut1_node} | ${qemu_node1} | ${dut2_node} | ${qemu_node2} +| ... +| Documentation | *Provider network FDS related.* +| ... +| ... | Test suite uses 3-node topology TG - DUT1 - DUT2 - TG +| ... | with one link between nodes. Test packets are sent in both directions +| ... | between namespaces in DUT1 and DUT2 with both positive and negative +| ... | scenarios tested. + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 +| ${shg1}= | 3 +| ${shg2}= | 4 +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 +| ${sock3}= | /tmp/sock3 +| ${sock4}= | /tmp/sock4 + +| ${bid_b}= | 23 +| ${bid_r}= | 24 + +| ${vlan_red}= | 50 +| ${vlan_blue}= | 60 + +| ${dut1_if_ip}= | 16.0.0.1 +| ${dut2_if_ip}= | 16.0.0.2 + +| ${dut1_blue1}= | 16.0.10.1 +| ${dut1_blue2}= | 16.0.10.2 +| ${dut1_red1}= | 16.0.10.3 +| ${dut1_red2}= | 16.0.10.4 + +| ${dut2_blue1}= | 16.0.20.1 +| ${dut2_blue2}= | 16.0.20.2 +| ${dut2_red1}= | 16.0.20.3 +| ${dut2_red2}= | 16.0.20.4 + +| ${namespace1}= | nmspace1 +| ${namespace2}= | nmspace2 +| ${namespace3}= | nmspace3 +| ${namespace4}= | nmspace4 + +| ${prefix_length}= | 16 + +*** Test Cases *** +| Provider network test cases with provider physical networks (VLAN) +| | [Documentation] | Ping among all ports inside the same network should pass. +| | ... | a) test l2 connectivity inside every network +| | ... | b) test l2 connectivity between networks +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Configure path in 3-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} +| | ... | ${prefix_length} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} +| | ... | ${prefix_length} +| | And Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up +| | And Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up +| | ${vhost_if1_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock1} +| | ${vhost_if2_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock2} +| | ${vhost_if3_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock3} +| | ${vhost_if4_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock4} +| | ${dut1_vhosts}= | And Create List | ${vhost_if1_DUT1} | ${vhost_if2_DUT1} +| | ... | ${vhost_if3_DUT1} | ${vhost_if4_DUT1} +| | ${vhost_if1_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock1} +| | ${vhost_if2_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock2} +| | ${vhost_if3_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock3} +| | ${vhost_if4_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock4} +| | ${dut2_vhosts}= | And Create List | ${vhost_if1_DUT2} | ${vhost_if2_DUT2} +| | ... | ${vhost_if3_DUT2} | ${vhost_if4_DUT2} +| | When Configure QEMU vhost and run it | ${dut1_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut1_blue1} +| | ... | ${dut1_blue2} +| | ... | ${dut1_red1} +| | ... | ${dut1_red2} +| | ... | ${prefix_length} +| | ... | qemu_node1 +| | ... | 04 +| | And Configure QEMU vhost and run it | ${dut2_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut2_blue1} +| | ... | ${dut2_blue2} +| | ... | ${dut2_red1} +| | ... | ${dut2_red2} +| | ... | ${prefix_length} +| | ... | qemu_node2 +| | ... | 06 +| | And Setup VLAN and BD on Dut | ${dut1_node} | ${dut1_to_dut2} +| | ... | @{dut1_vhosts} +| | And Setup VLAN and BD on Dut | ${dut2_node} | ${dut2_to_dut1} +| | ... | @{dut2_vhosts} +| | Then Positive Scenario Ping From DUT1 - Intra network +| | And Positive Scenario Ping From DUT1 - Inter network +| | And Positive Scenario Ping From DUT2 - Intra network +| | And Positive Scenario Ping From DUT2 - Inter network +| | And Negative Scenario Ping From DUT1 - Intra network +| | And Negative Scenario Ping From DUT1 - Inter network +| | And Negative Scenario Ping From DUT2 - Intra network +| | And Negative Scenario Ping From DUT2 - Inter network + +*** Keywords *** +| Setup VLAN and BD on Dut +| | [Documentation] | Setup VLAN and bridge domain on specific DUT and +| | ... | subsequently interconnect them properly. Also set VLAN tag +| | ... | rewrite on vhosts. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to setup VLAN and BD. Type: dict +| | ... | - interface - Interface where to create VLAN sub-interface. +| | ... | Type: string +| | ... | - vhosts - List containing vhost interfaces. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Setup VLAN and BD on Dut \| ${dut_node} \| GigabitEthernet0/6/0 \ +| | ... | \| @{vhosts} \| +| | ... +| | [Arguments] | ${dut_node} | ${interface} | @{vhosts} +| | Create bridge domain | ${dut_node} | ${bid_b} | learn=${TRUE} +| | Create bridge domain | ${dut_node} | ${bid_r} | learn=${TRUE} +| | ${interface_name}= | Get interface name | ${dut_node} | ${interface} +| | ${vlan1_name} | ${vlan1_index}= | Create Vlan Subinterface +| | ... | ${dut_node} | ${interface_name} | ${vlan_blue} +| | ${vlan2_name} | ${vlan2_index}= | Create Vlan Subinterface +| | ... | ${dut_node} | ${interface_name} | ${vlan_red} +| | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[0] | push-1 +| | ... | tag1_id=${vlan_blue} +| | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[1] | push-1 +| | ... | tag1_id=${vlan_blue} +| | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[2] | push-1 +| | ... | tag1_id=${vlan_red} +| | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[3] | push-1 +| | ... | tag1_id=${vlan_red} +| | Add interface to bridge domain | ${dut_node} +| | ... | ${vlan1_index} | ${bid_b} | 0 +| | Add interface to bridge domain | ${dut_node} +| | ... | @{vhosts}[0] | ${bid_b} | 0 +| | Add interface to bridge domain | ${dut_node} +| | ... | @{vhosts}[1] | ${bid_b} | 0 +| | Add interface to bridge domain | ${dut_node} +| | ... | ${vlan2_index} | ${bid_r} | 0 +| | Add interface to bridge domain | ${dut_node} +| | ... | @{vhosts}[2] | ${bid_r} | 0 +| | Add interface to bridge domain | ${dut_node} +| | ... | @{vhosts}[3] | ${bid_r} | 0 + +| Positive Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4} + +| Positive Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4} + +| Negative Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace4} diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-func.robot new file mode 100644 index 0000000000..678e268235 --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-func.robot @@ -0,0 +1,110 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_DOUBLE_LINK_TOPO | HW_ENV | VM_ENV | VPP_VM_ENV +| Test Setup | Set up functional test +| Test Teardown | Tear down functional test +| Documentation | *L2 bridge-domain test cases* +| ... +| ... | *[Top] Network Topologies:* TG=DUT=VM 3-node topology with VM +| ... | and double parallel links. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of +| ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply +| ... | to all links. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with two L2 bridge-domains +| ... | (L2BD) switching combined with MAC learning enabled. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets +| ... | are sent in both directions by TG on links to DUT1 via VM; on +| ... | receive TG verifies packets for correctness and their IPv4 (IPv6) +| ... | src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 + +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +*** Test Cases *** +| TC01: DUT with two L2BDs (MAC learn) switches ICMPv4 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local +| | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | ... +| | [Teardown] | Run Keywords | Stop and clear QEMU | ${dut_node} | ${vm_node} +| | ... | AND | Tear down functional test +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | When Configure vhost interfaces for L2BD forwarding | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Create bridge domain | ${dut_node} | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Create bridge domain | ${dut_node} | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} + +| TC02: DUT with two L2BDs (MAC learn) switches ICMPv6 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local +| | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | ... +| | [Teardown] | Run Keywords | Stop and clear QEMU | ${dut_node} | ${vm_node} +| | ... | AND | Tear down functional test +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | When Configure vhost interfaces for L2BD forwarding | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Create bridge domain | ${dut_node} | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Create bridge domain | ${dut_node} | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send ICMPv6 bidirectionally and verify received packets | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-eth-l2bdbasemacstc-eth-2vhost-1vm-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-eth-l2bdbasemacstc-eth-2vhost-1vm-func.robot new file mode 100644 index 0000000000..22ec61d395 --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-eth-l2bdbasemacstc-eth-2vhost-1vm-func.robot @@ -0,0 +1,151 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_DOUBLE_LINK_TOPO | HW_ENV | VM_ENV | VPP_VM_ENV +| Test Setup | Set up functional test +| Test Teardown | Tear down functional test +| Documentation | *L2 bridge-domain test cases* +| ... +| ... | *[Top] Network Topologies:* TG=DUT=VM 3-node topology with VM +| ... | and double parallel links. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of +| ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply +| ... | to all links. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with two L2 bridge-domains +| ... | (L2BD) switching combined with static MACs. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets +| ... | are sent in both directions by TG on links to DUT1 via VM; on +| ... | receive TG verifies packets for correctness and their IPv4 (IPv6) +| ... | src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 + +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +*** Test Cases *** +| TC01: DUT with two L2BDs (static MACs) switches ICMPv4 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with static MACs, each with vhost-user i/f to local VM +| | ... | and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | ... +| | [Teardown] | Run Keywords | Stop and clear QEMU | ${dut_node} | ${vm_node} +| | ... | AND | Tear down functional test +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | When Configure vhost interfaces for L2BD forwarding | ${dut_node} +| | ... | ${sock1} | ${sock2} +| | And Create bridge domain | ${dut_node} | ${bd_id1} +| | ... | learn=${FALSE} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} | ${bd_id1} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${vhost_if1} +| | ... | ${bd_id1} +| | And Create bridge domain | ${dut_node} | ${bd_id2} +| | ... | learn=${FALSE} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${vhost_if2} +| | ... | ${bd_id2} +| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send ICMPv4 bidirectionally and verify received packets +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} + +| TC02: DUT with two L2BDs (static MACs) switches ICMPv6 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with static MACs, each with vhost-user i/f to local VM +| | ... | and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | ... +| | [Teardown] | Run Keywords | Stop and clear QEMU | ${dut_node} | ${vm_node} +| | ... | AND | Tear down functional test +| | ... +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | When Configure vhost interfaces for L2BD forwarding | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Create bridge domain | ${dut_node} | ${bd_id1} +| | ... | learn=${FALSE} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${vhost_if1} +| | ... | ${bd_id1} +| | And Create bridge domain | ${dut_node} | ${bd_id2} +| | ... | learn=${FALSE} +| | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Add interface to bridge domain | ${dut_node} | ${vhost_if2} | ${bd_id2} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Add destination port to L2FIB | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${vhost_if2} +| | ... | ${bd_id2} +| | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send ICMPv6 bidirectionally and verify received packets +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4-l2bdbase-vhost-client-reconnect-2vm-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4-l2bdbase-vhost-client-reconnect-2vm-func.robot new file mode 100644 index 0000000000..4609aa10d2 --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4-l2bdbase-vhost-client-reconnect-2vm-func.robot @@ -0,0 +1,231 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/overlay/vxlan.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| Test Setup | Set up functional test +| Test Teardown | Run Keywords +| ... | resources.libraries.python.QemuUtils.Qemu Kill All | ${dut_node} | AND +| ... | Tear down functional test +| Documentation | *Vhost-User Interface Traffic Tests* +| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links +| ... | between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-VXLAN-ETH-IP on TG-DUT link. +| ... | ETH-IP on VirtualEthernet-VM interface. +| ... | *[Cfg] DUT configuration:* On DUT is running 2 VM with 2 vhost-user +| ... | interface on each VM. DUT is configured with VXLAN and vhost-user +| ... | interfaces in bridge-domain (L2BD). +| ... | *[Cfg] VM configuration:* VM has both vhost-user interfaces added into +| ... | Linux Bridge. +| ... | *[Ver] TG verification:* +| ... | VXLAN packet is send to DUT where is decapsulated and send bridged to +| ... | vhost-user inteface. VM forwards frame to its second interface and VPP +| ... | encapsulates it to another VXLAN tunnel. Packets +| ... | are sent and received by TG on link to DUT. + +*** Variables *** +| ${tg_if1_ip}= | 192.168.0.1 +| ${dut_if1_ip}= | 192.168.0.2 +| ${prefix_length}= | ${24} + +| ${sock_vm1_1}= | /tmp/sock1 +| ${sock_vm1_2}= | /tmp/sock2 +| ${sock_vm2_1}= | /tmp/sock3 +| ${sock_vm2_2}= | /tmp/sock4 + +*** Test Cases *** +| TC01: Qemu reconnects to VPPs vhost-user when Qemu is killed and restarted +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | And Set Interface Address | ${dut_node} | ${dut_to_tg_if1} | ${dut_if1_ip} +| | ... | ${prefix_length} +| | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${tg_if1_ip} +| | ... | ${tg_to_dut_if1_mac} +| | ${vxlan1}= | And Create VXLAN interface | ${dut_node} | ${101} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan2}= | And Create VXLAN interface | ${dut_node} | ${102} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan3}= | And Create VXLAN interface | ${dut_node} | ${103} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan4}= | And Create VXLAN interface | ${dut_node} | ${104} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | And Set Interface State | ${dut_node} | ${vxlan1} | up +| | And Set Interface State | ${dut_node} | ${vxlan2} | up +| | And Set Interface State | ${dut_node} | ${vxlan3} | up +| | And Set Interface State | ${dut_node} | ${vxlan4} | up +| | ${vhost_if1}= | And Vpp Create Vhost User Interface +| | ... | ${dut_node} | ${sock_vm1_1} +| | ${vhost_if2}= | And Vpp Create Vhost User Interface +| | ... | ${dut_node} | ${sock_vm1_2} +| | ${vhost_if3}= | And Vpp Create Vhost User Interface +| | ... | ${dut_node} | ${sock_vm2_1} +| | ${vhost_if4}= | And Vpp Create Vhost User Interface +| | ... | ${dut_node} | ${sock_vm2_2} +| | And Set Interface State | ${dut_node} | ${vhost_if1} | up +| | And Set Interface State | ${dut_node} | ${vhost_if2} | up +| | And Set Interface State | ${dut_node} | ${vhost_if3} | up +| | And Set Interface State | ${dut_node} | ${vhost_if4} | up +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${101} | ${vxlan1} +| | ... | ${vhost_if1} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${102} | ${vxlan2} +| | ... | ${vhost_if2} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${103} | ${vxlan3} +| | ... | ${vhost_if3} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${104} | ${vxlan4} +| | ... | ${vhost_if4} +| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm1_1} +| | ... | ${sock_vm1_2} | ${1} +| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm2_1} +| | ... | ${sock_vm2_2} | ${2} +| | And Check traffic through VM +| | When Run keyword | qemu-1.Qemu Kill +| | ${vm1}= | And Run Keyword | qemu-1.Qemu Start +| | ${vhost_int_1}= | And Get Vhost User If Name By Sock | ${vm1} +| | ... | ${sock_vm1_1} +| | ${vhost_int_2}= | And Get Vhost User If Name By Sock | ${vm1} +| | ... | ${sock_vm1_2} +| | And Linux Add Bridge | ${vm1} | br0 | ${vhost_int_1} | ${vhost_int_2} +| | And Set Interface State | ${vm1} | ${vhost_int_1} | up | if_type=name +| | And Set Interface State | ${vm1} | ${vhost_int_2} | up | if_type=name +| | Then Check traffic through VM + + +| TC02: VPP reconnects to Qemu vhost-user when Restart VPP and reconfigured +| | [Tags] | EXPECTED_FAILING +| | [Documentation] +| | ... | *Failing:* Qemu doesn't support reconnect prior to version 2.7. +| | Given Configure path in 2-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Set interfaces in 2-node circular topology up +| | And Set Interface Address | ${dut_node} | ${dut_to_tg_if1} | ${dut_if1_ip} +| | ... | ${prefix_length} +| | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${tg_if1_ip} +| | ... | ${tg_to_dut_if1_mac} +| | ${vxlan1}= | And Create VXLAN interface | ${dut_node} | ${101} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan2}= | And Create VXLAN interface | ${dut_node} | ${102} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan3}= | And Create VXLAN interface | ${dut_node} | ${103} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan4}= | And Create VXLAN interface | ${dut_node} | ${104} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | And Set Interface State | ${dut_node} | ${vxlan1} | up +| | And Set Interface State | ${dut_node} | ${vxlan2} | up +| | And Set Interface State | ${dut_node} | ${vxlan3} | up +| | And Set Interface State | ${dut_node} | ${vxlan4} | up +| | ${vhost_if1}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm1_1} +| | ${vhost_if2}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm1_2} +| | ${vhost_if3}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm2_1} +| | ${vhost_if4}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm2_2} +| | And Set Interface State | ${dut_node} | ${vhost_if1} | up +| | And Set Interface State | ${dut_node} | ${vhost_if2} | up +| | And Set Interface State | ${dut_node} | ${vhost_if3} | up +| | And Set Interface State | ${dut_node} | ${vhost_if4} | up +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${101} | ${vxlan1} +| | ... | ${vhost_if1} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${102} | ${vxlan2} +| | ... | ${vhost_if2} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${103} | ${vxlan3} +| | ... | ${vhost_if3} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${104} | ${vxlan4} +| | ... | ${vhost_if4} +| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm1_1} +| | ... | ${sock_vm1_2} | ${1} +| | And Configure QEMU vhost and run it VM | ${dut_node} | ${sock_vm2_1} +| | ... | ${sock_vm2_2} | ${2} +| | And Check traffic through VM +| | And Verify VPP PID in Teardown +| | When Setup All Duts | ${nodes} +| | And Save VPP PIDs +| | And Set interfaces in 2-node circular topology up +| | And Set Interface Address | ${dut_node} | ${dut_to_tg_if1} | ${dut_if1_ip} +| | ... | ${prefix_length} +| | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${tg_if1_ip} +| | ... | ${tg_to_dut_if1_mac} +| | ${vxlan1}= | And Create VXLAN interface | ${dut_node} | ${101} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan2}= | And Create VXLAN interface | ${dut_node} | ${102} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan3}= | And Create VXLAN interface | ${dut_node} | ${103} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | ${vxlan4}= | And Create VXLAN interface | ${dut_node} | ${104} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} +| | And Set Interface State | ${dut_node} | ${vxlan1} | up +| | And Set Interface State | ${dut_node} | ${vxlan2} | up +| | And Set Interface State | ${dut_node} | ${vxlan3} | up +| | And Set Interface State | ${dut_node} | ${vxlan4} | up +| | ${vhost_if1}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm1_1} +| | ${vhost_if2}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm1_2} +| | ${vhost_if3}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm2_1} +| | ${vhost_if4}= | And Vpp Create Vhost User Interface | ${dut_node} +| | ... | ${sock_vm2_2} +| | And Set Interface State | ${dut_node} | ${vhost_if1} | up +| | And Set Interface State | ${dut_node} | ${vhost_if2} | up +| | And Set Interface State | ${dut_node} | ${vhost_if3} | up +| | And Set Interface State | ${dut_node} | ${vhost_if4} | up +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${101} | ${vxlan1} +| | ... | ${vhost_if1} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${102} | ${vxlan2} +| | ... | ${vhost_if2} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${103} | ${vxlan3} +| | ... | ${vhost_if3} +| | And Vpp Add L2 Bridge Domain | ${dut_node} | ${104} | ${vxlan4} +| | ... | ${vhost_if4} +| | Then Check traffic through VM + + +*** Keywords *** +| Configure QEMU vhost and run it VM +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${qemu_id} +| | Import Library | resources.libraries.python.QemuUtils | qemu_id=${qemu_id} +| | ... | WITH NAME | qemu-${qemu_id} +| | ${q_add_vhost}= | Replace Variables | qemu-${qemu_id}.Qemu Add Vhost User If +| | ${q_set_node}= | Replace Variables | qemu-${qemu_id}.Qemu Set Node +| | ${q_start}= | Replace Variables | qemu-${qemu_id}.Qemu Start +| | Run keyword | ${q_set_node} | ${dut_node} +| | Run keyword | ${q_add_vhost} | ${sock1} +| | Run keyword | ${q_add_vhost} | ${sock2} +| | ${vm}= | Run keyword | ${q_start} +| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1} +| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2} +| | Linux Add Bridge | ${vm} | br0 | ${vhost1} | ${vhost2} +| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name +| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name +| | Set Test Variable | ${qemu-${qemu_id}} | ${vm} + +| Check traffic through VM +| | [Documentation] | Send VXLAN traffic through both configured VMs. +| | Send VXLAN encapsulated packet and verify received packet | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} +| | ... | ${tg_if1_ip} | ${dut_if1_ip} | ${101} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} | ${102} +| | Send VXLAN encapsulated packet and verify received packet | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} +| | ... | ${tg_if1_ip} | ${dut_if1_ip} | ${103} +| | ... | ${dut_if1_ip} | ${tg_if1_ip} | ${104} diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4vxlan-l2bdbasemaclrn--eth-4vhost-2vm-fds-tenant-nets-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4vxlan-l2bdbasemaclrn--eth-4vhost-2vm-fds-tenant-nets-func.robot new file mode 100644 index 0000000000..e58e6ed7c2 --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4vxlan-l2bdbasemaclrn--eth-4vhost-2vm-fds-tenant-nets-func.robot @@ -0,0 +1,333 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/ip/ip4.robot +| Resource | resources/libraries/robot/l2/l2_bridge_domain.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/vm/double_qemu_setup.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/fds/default.robot +| Library | resources.libraries.python.Trace +| ... +| Force Tags | HW_ENV | VM_ENV | SKIP_PATCH +| ... +| Test Setup | Set up FDS functional test | ${nodes} +| ... +| Test Teardown | Tear down FDS functional test | ${nodes} +| ... | ${dut1_node} | ${qemu_node1} | ${dut2_node} | ${qemu_node2} +| ... +| Documentation | *Tenant network FDS related.* +| ... +| ... | Test suite uses 3-node topology TG - DUT1 - DUT2 - TG +| ... | with one link between nodes. Test packets are sent in both directions +| ... | between namespaces in DUT1 and DUT2 with both positive and negative +| ... | scenarios tested. + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 +| ${shg1}= | 3 +| ${shg2}= | 4 +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 +| ${sock3}= | /tmp/sock3 +| ${sock4}= | /tmp/sock4 + +| ${vni_blue}= | 23 +| ${vni_red}= | 24 + +| ${bid_b}= | 23 +| ${bid_r}= | 24 + +| ${dut1_if_ip}= | 16.0.0.1 +| ${dut2_if_ip}= | 16.0.0.2 + +| ${dut1_blue1}= | 16.0.10.1 +| ${dut1_blue2}= | 16.0.10.2 +| ${dut1_red1}= | 16.0.10.3 +| ${dut1_red2}= | 16.0.10.4 + +| ${dut2_blue1}= | 16.0.20.1 +| ${dut2_blue2}= | 16.0.20.2 +| ${dut2_red1}= | 16.0.20.3 +| ${dut2_red2}= | 16.0.20.4 + +| ${namespace1}= | nmspace1 +| ${namespace2}= | nmspace2 +| ${namespace3}= | nmspace3 +| ${namespace4}= | nmspace4 + +| ${prefix_length}= | 16 + +*** Test Cases *** +| L2 test cases with tenant networks (VXLAN) +| | [Documentation] | Ping among all ports inside the same network should pass. +| | ... | a) test l2 connectivity inside every network +| | ... | b) test l2 connectivity between networks +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Configure path in 3-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} | ${prefix_length} +| | And Set Interface Address +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} | ${prefix_length} +| | And Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up +| | And Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up +| | ${vhost_if1_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock1} +| | ${vhost_if2_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock2} +| | ${vhost_if3_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock3} +| | ${vhost_if4_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock4} +| | ${dut1_vhosts}= | And Create List | ${vhost_if1_DUT1} | ${vhost_if2_DUT1} +| | ... | ${vhost_if3_DUT1} | ${vhost_if4_DUT1} +| | ${vhost_if1_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock1} +| | ${vhost_if2_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock2} +| | ${vhost_if3_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock3} +| | ${vhost_if4_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock4} +| | ${dut2_vhosts}= | And Create List | ${vhost_if1_DUT2} | ${vhost_if2_DUT2} +| | ... | ${vhost_if3_DUT2} | ${vhost_if4_DUT2} +| | When Configure QEMU vhost and run it | ${dut1_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut1_blue1} +| | ... | ${dut1_blue2} +| | ... | ${dut1_red1} +| | ... | ${dut1_red2} +| | ... | ${prefix_length} +| | ... | qemu_node1 +| | ... | 04 +| | And Configure QEMU vhost and run it | ${dut2_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut2_blue1} +| | ... | ${dut2_blue2} +| | ... | ${dut2_red1} +| | ... | ${dut2_red2} +| | ... | ${prefix_length} +| | ... | qemu_node2 +| | ... | 06 +| | And Setup VXLAN and BD on Dut | ${dut1_node} | ${dut1_if_ip} | ${dut2_if_ip} +| | ... | @{dut1_vhosts} +| | And Setup VXLAN and BD on Dut | ${dut2_node} | ${dut2_if_ip} | ${dut1_if_ip} +| | ... | @{dut2_vhosts} +| | Then Positive Scenario Ping From DUT1 - Intra network +| | And Positive Scenario Ping From DUT1 - Inter network +| | And Positive Scenario Ping From DUT2 - Intra network +| | And Positive Scenario Ping From DUT2 - Inter network +| | And Negative Scenario Ping From DUT1 - Intra network +| | And Negative Scenario Ping From DUT1 - Inter network +| | And Negative Scenario Ping From DUT2 - Intra network +| | And Negative Scenario Ping From DUT2 - Inter network + +*** Keywords *** +| Setup VXLAN and BD on Dut +| | [Documentation] | Setup VXLAN and bridge domain on specific DUT and +| | ... | subsequently interconnect them properly. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to setup vxlan and BD. Type: dict +| | ... | - src_ip - Source IP for VXLAN. Type: string +| | ... | - dst_ip - Destination IP for vxlan. Type: string +| | ... | - vhosts - List containing vhost interfaces. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Setup VXLAN and BD on Dut \| ${dut_node} \| 16.0.0.1 \| 16.0.0.1 \ +| | ... | \| @{vhosts} \| +| | ... +| | [Arguments] | ${dut_node} | ${src_ip} | ${dst_ip} | @{vhosts} +| | Create bridge domain +| | ... | ${dut_node} | ${bid_b} | learn=${TRUE} +| | Create bridge domain +| | ... | ${dut_node} | ${bid_r} | learn=${TRUE} +| | ${vxlan1_if}= | Create VXLAN interface | ${dut_node} | ${vni_blue} +| | ... | ${src_ip} | ${dst_ip} +| | ${vxlan2_if}= | Create VXLAN interface | ${dut_node} | ${vni_red} +| | ... | ${src_ip} | ${dst_ip} +| | Add interface to bridge domain +| | ... | ${dut_node} | ${vxlan1_if} | ${bid_b} | 0 +| | Add interface to bridge domain +| | ... | ${dut_node} | @{vhosts}[0] | ${bid_b} | 0 +| | Add interface to bridge domain +| | ... | ${dut_node} | @{vhosts}[1] | ${bid_b} | 0 +| | Add interface to bridge domain +| | ... | ${dut_node} | ${vxlan2_if} | ${bid_r} | 0 +| | Add interface to bridge domain +| | ... | ${dut_node} | @{vhosts}[2] | ${bid_r} | 0 +| | Add interface to bridge domain +| | ... | ${dut_node} | @{vhosts}[3] | ${bid_r} | 0 + +| Positive Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4} + +| Positive Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4} + +| Negative Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace4} diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4vxlan-l2bdbasemaclrn-eth-2vhost-1vm-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4vxlan-l2bdbasemaclrn-eth-2vhost-1vm-func.robot new file mode 100644 index 0000000000..d6f4e57143 --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip4vxlan-l2bdbasemaclrn-eth-2vhost-1vm-func.robot @@ -0,0 +1,116 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/overlay/vxlan.robot +| Resource | resources/libraries/robot/l2/l2_traffic.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/vm/double_qemu_setup.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | HW_ENV | VPP_VM_ENV +| Test Setup | Set up functional test +| Test Teardown | Run Keywords | Tear down functional test +| ... | AND | Run keyword | Tear down QEMU | ${dut1_node} +| ... | ${${qemu1}} | ${qemu1} +| ... | AND | Run keyword | Tear down QEMU | ${dut2_node} +| ... | ${${qemu2}} | ${qemu2} +| Documentation | *L2BD with VM combined with VXLAN test cases - IPv4* +| ... +| ... | *[Top] Network topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on +| ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn for L2 switching of IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | bridge-domain (L2BD) switching combined with MAC learning enabled; +| ... | VXLAN tunnels are configured between L2BDs on DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent +| ... | in both directions by TG on links to DUT1 and DUT2; on receive TG +| ... | verifies packets for correctness and their IPv4 src-addr, dst-addr +| ... | and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7348. + +*** Variables *** +| ${vni_1}= | 23 + +| ${bd_id1}= | 10 +| ${bd_id2}= | 20 + +| ${ip4_addr1}= | 172.16.0.1 +| ${ip4_addr2}= | 172.16.0.2 +| ${ip4_prefix}= | 24 + +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +| ${qemu1}= | qemu_instance_1 +| ${qemu2}= | qemu_instance_2 + +| ${dut1_vhost1}= | dut1_vhost_if1 +| ${dut1_vhost2}= | dut1_vhost_if2 +| ${dut2_vhost1}= | dut2_vhost_if1 +| ${dut2_vhost2}= | dut2_vhost_if2 + +*** Test Cases *** +| TC01:DUT1 and DUT2 with two L2BDs and VXLANoIPv4 tunnel switch ICMPv4 between TG links and VM links +| | [Documentation] +| | ... | [Top] TG-DUT1-VM-DUT1-DUT2-VM-DUT2-TG. +| | ... | [Enc] Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on DUT1-DUT2; Eth-IPv4-ICMPv4 +| | ... | on TG-DUTn and DUTn=VM. +| | ... | [Cfg] On both DUTs configure two L2BDs (MAC learning enabled); first +| | ... | L2BD with untagged interface to TG and vhost-user interface to local +| | ... | VM, second one with vhost-user interface to local VM and VXLAN +| | ... | interface towards the other DUT. Configure linux bridge on both VMs +| | ... | to pass traffic between both vhost-user interfaces. +| | ... | [Ver] Make TG send ICMPv4 Echo Req between two of its interfaces to +| | ... | be switched by DUT1 and DUT2; verify packets are switched between +| | ... | these TG interfaces. +| | ... | [Ref] RFC7348. +| | Given Configure path in 3-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Set interfaces in 3-node circular topology up +| | When Configure vhost interfaces for L2BD forwarding | ${dut1_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${dut1_vhost1} +| | ... | ${dut1_vhost2} +| | And Configure vhost interfaces for L2BD forwarding | ${dut2_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${dut2_vhost1} +| | ... | ${dut2_vhost2} +| | And Configure VM for vhost L2BD forwarding | ${dut1_node} | ${sock1} +| | ... | ${sock2} | ${qemu1} +| | And Configure VM for vhost L2BD forwarding | ${dut2_node} | ${sock1} +| | ... | ${sock2} | ${qemu2} +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip4_addr1} +| | ... | ${ip4_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip4_addr2} +| | ... | ${ip4_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip4_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip4_addr1} +| | ${dut1s_vxlan}= | And Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip4_addr1} | ${ip4_addr2} +| | ${dut2s_vxlan}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip4_addr2} | ${ip4_addr1} +| | And Add interfaces to L2BD | ${dut1_node} | ${bd_id1} +| | ... | ${dut1_to_tg} | ${${dut1_vhost1}} +| | And Add interfaces to L2BD | ${dut1_node} | ${bd_id2} +| | ... | ${dut1s_vxlan} | ${${dut1_vhost2}} +| | And Add interfaces to L2BD | ${dut2_node} | ${bd_id1} +| | ... | ${dut2_to_tg} | ${${dut2_vhost1}} +| | And Add interfaces to L2BD | ${dut2_node} | ${bd_id2} +| | ... | ${dut2s_vxlan} | ${${dut2_vhost2}} +| | Then Send ICMPv4 bidirectionally and verify received packets +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} diff --git a/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip6vxlan-l2bdbasemaclrn-eth-2vhost-1vm-func.robot b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip6vxlan-l2bdbasemaclrn-eth-2vhost-1vm-func.robot new file mode 100644 index 0000000000..cde7bd8aff --- /dev/null +++ b/tests/vpp/func/vm_vhost/l2bd/eth2p-ethip6vxlan-l2bdbasemaclrn-eth-2vhost-1vm-func.robot @@ -0,0 +1,119 @@ +# 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/shared/default.robot +| Resource | resources/libraries/robot/shared/testing_path.robot +| Resource | resources/libraries/robot/overlay/vxlan.robot +| Resource | resources/libraries/robot/l2/l2_traffic.robot +| Resource | resources/libraries/robot/vm/qemu.robot +| Resource | resources/libraries/robot/vm/double_qemu_setup.robot +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.IPv6Setup +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | HW_ENV +| Test Setup | Set up functional test +| Test Teardown | Run Keywords | Tear down functional test +| ... | AND | Run keyword | Tear down QEMU | ${dut1_node} +| ... | ${${qemu1}} | ${qemu1} +| ... | AND | Run keyword | Tear down QEMU | ${dut2_node} +| ... | ${${qemu2}} | ${qemu2} +| Documentation | *L2BD with VM combined with VXLAN test cases - IPv6* +| ... +| ... | *[Top] Network topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-IPv6-VXLAN-Eth-IPv6-ICMPv6 on +| ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn for L2 switching of IPv6. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | bridge-domain (L2BD) switching combined with MAC learning enabled; +| ... | VXLAN tunnels are configured between L2BDs on DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent +| ... | in both directions by TG on links to DUT1 and DUT2; on receive TG +| ... | verifies packets for correctness and their IPv6 src-addr, dst-addr +| ... | and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7348. + +*** Variables *** +| ${vni_1}= | 23 + +| ${bd_id1}= | 10 +| ${bd_id2}= | 20 + +| ${ip6_addr1}= | 3ffe:64::1 +| ${ip6_addr2}= | 3ffe:64::2 +| ${ip6_prefix}= | 64 + +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +| ${qemu1}= | qemu_instance_1 +| ${qemu2}= | qemu_instance_2 + +| ${dut1_vhost1}= | dut1_vhost_if1 +| ${dut1_vhost2}= | dut1_vhost_if2 +| ${dut2_vhost1}= | dut2_vhost_if1 +| ${dut2_vhost2}= | dut2_vhost_if2 + +*** Test Cases *** +| TC01:DUT1 and DUT2 with two L2BDs and VXLANoIPv6 tunnel switch ICMPv6 between TG links and VM links +| | [Documentation] +| | ... | [Top] TG-DUT1-VM-DUT1-DUT2-VM-DUT2-TG. +| | ... | [Enc] Eth-IPv6-VXLAN-Eth-IPv6-ICMPv6 on DUT1-DUT2; Eth-IPv4-ICMPv4 +| | ... | on TG-DUTn and DUTn=VM. +| | ... | [Cfg] On both DUTs configure two L2BDs (MAC learning enabled); first +| | ... | L2BD with untagged interface to TG and vhost-user interface to local +| | ... | VM, second one with vhost-user interface to local VM and VXLAN +| | ... | interface towards the other DUT. Configure linux bridge on both VMs +| | ... | to pass traffic between both vhost-user interfaces. +| | ... | [Ver] Make TG send ICMPv6 Echo Req between two of its interfaces to +| | ... | be switched by DUT1 and DUT2; verify packets are switched between +| | ... | these TG interfaces. +| | ... | [Ref] RFC7348. +| | [Tags] | VPP_VM_ENV +| | Given Configure path in 3-node circular topology +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Set interfaces in 3-node circular topology up +| | When Configure vhost interfaces for L2BD forwarding | ${dut1_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${dut1_vhost1} +| | ... | ${dut1_vhost2} +| | And Configure vhost interfaces for L2BD forwarding | ${dut2_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${dut2_vhost1} +| | ... | ${dut2_vhost2} +| | And Configure VM for vhost L2BD forwarding | ${dut1_node} | ${sock1} +| | ... | ${sock2} | ${qemu1} +| | And Configure VM for vhost L2BD forwarding | ${dut2_node} | ${sock1} +| | ... | ${sock2} | ${qemu2} +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr1} +| | ... | ${ip6_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr2} +| | ... | ${ip6_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr1} +| | And Vpp All RA Suppress Link Layer | ${nodes} +| | ${dut1s_vxlan}= | And Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip6_addr1} | ${ip6_addr2} +| | ${dut2s_vxlan}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip6_addr2} | ${ip6_addr1} +| | And Add interfaces to L2BD | ${dut1_node} | ${bd_id1} +| | ... | ${dut1_to_tg} | ${${dut1_vhost1}} +| | And Add interfaces to L2BD | ${dut1_node} | ${bd_id2} +| | ... | ${dut1s_vxlan} | ${${dut1_vhost2}} +| | And Add interfaces to L2BD | ${dut2_node} | ${bd_id1} +| | ... | ${dut2_to_tg} | ${${dut2_vhost1}} +| | And Add interfaces to L2BD | ${dut2_node} | ${bd_id2} +| | ... | ${dut2s_vxlan} | ${${dut2_vhost2}} +| | Then Send ICMPv6 bidirectionally and verify received packets +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} |