Add BD vpp-vm-vpp tests 23/823/7
authorMatus Fabian <matfabia@cisco.com>
Wed, 20 Apr 2016 09:49:36 +0000 (11:49 +0200)
committerStefan Kobza <skobza@cisco.com>
Tue, 26 Apr 2016 09:54:05 +0000 (09:54 +0000)
JIRA: CSIT-20

Change-Id: Id22102519cdc8afef63c0e727fb47e2a2f1d769b
Signed-off-by: Matus Fabian <matfabia@cisco.com>
resources/libraries/robot/bridge_domain.robot
tests/suites/bridge_domain/bridge_domain_untagged.robot

index 8879f6f..e31a3bf 100644 (file)
@@ -15,6 +15,8 @@
 | Library | resources.libraries.python.L2Util
 | Library | resources.libraries.python.InterfaceUtil
 | Library | resources.libraries.python.NodePath
+| Library | resources.libraries.python.VhostUser
+| Library | resources.libraries.python.QemuUtils
 | Resource | resources/libraries/robot/interfaces.robot
 | Resource | resources/libraries/robot/l2_traffic.robot
 
 | | ...         | ${vpp_node_if} | ${bd_id}
 | | ${mac}= | Get Interface Mac | ${dest_node} | ${dest_node_if}
 | | Vpp Add L2fib Entry | ${vpp_node} | ${mac} | ${vpp_node_if} | ${bd_id}
+
+| VM for Vhost L2BD forwarding is setup
+| | [Documentation] | Setup QEMU and start VM with two vhost interfaces.
+| | ...
+| | ... | *Arguments:*
+| | ... | - ${node} - DUT node to start VM on. Type: dictionary
+| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string
+| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string
+| | ...
+| | ... | _NOTE:_ This KW sets following test case variable:
+| | ... | -${vm_node} - VM node info. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| VM for Vhost L2BD forwarding is setup \| ${nodes['DUT1']} \
+| | ... | \| /tmp/sock1 \| /tmp/sock2
+| | [Arguments] | ${node} | ${sock1} | ${sock2}
+| | Set Test Variable | ${vm_node} | ${None}
+| | Qemu Set Node | ${node}
+| | Qemu Add Vhost User If | ${sock1}
+| | Qemu Add Vhost User If | ${sock2}
+| | ${vm}= | Qemu Start
+| | ${br}= | Set Variable | br0
+| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
+| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
+| | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
+| | Set Interface State | ${vm} | ${vhost1} | up
+| | Set Interface State | ${vm} | ${vhost2} | up
+| | Set Interface State | ${vm} | ${br} | up
+| | Set Test Variable | ${vm_node} | ${vm}
+
+| VPP Vhost interfaces for L2BD forwarding are setup
+| | [Documentation] | Create two Vhost-User interfaces on defined VPP node.
+| | ...
+| | ... | *Arguments:*
+| | ... | - ${node} - DUT node. Type: dictionary
+| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string
+| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string
+| | ...
+| | ... | _NOTE:_ This KW sets following test case variable:
+| | ... | - ${vhost_if1} - First Vhost-User interface.
+| | ... | - ${vhost_if2} - Second Vhost-User interface.
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| VPP Vhost interfaces for L2BD forwarding are setup \
+| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2
+| | [Arguments] | ${node} | ${sock1} | ${sock2}
+| | ${vhost_if1}= | Vpp Create Vhost User Interface | ${node} | ${sock1}
+| | ${vhost_if2}= | Vpp Create Vhost User Interface | ${node} | ${sock2}
+| | Set Test Variable | ${vhost_if1}
+| | Set Test Variable | ${vhost_if2}
index badc7a6..bc5eac2 100644 (file)
@@ -14,6 +14,7 @@
 *** Settings ***
 | Resource | resources/libraries/robot/default.robot
 | Resource | resources/libraries/robot/bridge_domain.robot
+| Resource | resources/libraries/robot/qemu.robot
 | Library  | resources.libraries.python.Trace
 | Force Tags | HW_ENV | VM_ENV
 | Test Setup | Run Keywords | Setup all DUTs before test
 | ... | header MAC addresses are matching MAC addresses of the TG node.
 
 *** Variables ***
-| ${bd_id1} = | 1
-| ${bd_id2} = | 2
+| ${bd_id1}= | 1
+| ${bd_id2}= | 2
+| ${sock1}= | /tmp/sock1
+| ${sock2}= | /tmp/sock2
 
 *** Test Cases ***
 | VPP reports interfaces
 | | ...                                                | ${dut2_node}
 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
 | | ...                                          | ${tg_to_dut2}
+
+| VPP forwards packets through VM via two L2 bridge domains
+| | [Documentation] | Setup and run VM connected to VPP via Vhost-User
+| | ...             | interfaces and check packet forwarding through VM via two
+| | ...             | L2 bridge domains with learning enabled.
+| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
+| | Given Path for 2-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
+| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
+| | ...                                                     | ${sock1}
+| | ...                                                     | ${sock2}
+| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
+| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
+| | ...                                     | ${bd_id1}
+| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
+| | ...                                     | ${bd_id1}
+| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
+| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
+| | ...                                     | ${bd_id2}
+| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
+| | ...                                     | ${bd_id2}
+| | And Interfaces on all VPP nodes in the path are up | ${dut_node}
+| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
+| | ...                                       | ${sock2}
+| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
+| | ...                                          | ${tg_to_dut_if2}
+| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
+| | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
+
+| VPP forwards packets through VM via two L2 bridge domains with static L2FIB entries
+| | [Documentation] | Setup and run VM connected to VPP via Vhost-User
+| | ...             | interfaces and check packet forwarding through VM via two
+| | ...             | L2 bridge domains with learning disabled (static L2BFIB
+| | ...             | entries).
+| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
+| | Given Path for 2-node BD testing is set | ${nodes['TG']} | ${nodes['DUT1']}
+| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
+| | ...                                                     | ${sock1}
+| | ...                                                     | ${sock2}
+| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
+| | ...                                      | learn=${FALSE}
+| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
+| | ...                                     | ${bd_id1}
+| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
+| | ...                                     | ${bd_id1}
+| | And Destination port is added to L2FIB on DUT node | ${tg_node}
+| | ...                                                | ${tg_to_dut_if1}
+| | ...                                                | ${dut_node}
+| | ...                                                | ${dut_to_tg_if1}
+| | ...                                                | ${bd_id1}
+| | And Destination port is added to L2FIB on DUT node | ${tg_node}
+| | ...                                                | ${tg_to_dut_if2}
+| | ...                                                | ${dut_node}
+| | ...                                                | ${vhost_if1}
+| | ...                                                | ${bd_id1}
+| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
+| | ...                                      | learn=${FALSE}
+| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
+| | ...                                     | ${bd_id2}
+| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
+| | ...                                     | ${bd_id2}
+| | And Interfaces on all VPP nodes in the path are up | ${dut_node}
+| | And Destination port is added to L2FIB on DUT node | ${tg_node}
+| | ...                                                | ${tg_to_dut_if2}
+| | ...                                                | ${dut_node}
+| | ...                                                | ${dut_to_tg_if2}
+| | ...                                                | ${bd_id2}
+| | And Destination port is added to L2FIB on DUT node | ${tg_node}
+| | ...                                                | ${tg_to_dut_if1}
+| | ...                                                | ${dut_node}
+| | ...                                                | ${vhost_if2}
+| | ...                                                | ${bd_id2}
+| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
+| | ...                                       | ${sock2}
+| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
+| | ...                                          | ${tg_to_dut_if2}
+| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
+| | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.