X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fbridge_domain.robot;h=e31a3bff055dfa552e099086b1e74cb039a147ca;hb=9cd535ec0701d5ba87a781d361b08eb0a0446789;hp=cd3b626e1cd0bac599c3959b6df4a1b06dd7f4b8;hpb=4a7f950c10ca9bcf86e5ccbc3d49a3d7e3cb9809;p=csit.git diff --git a/resources/libraries/robot/bridge_domain.robot b/resources/libraries/robot/bridge_domain.robot index cd3b626e1c..e31a3bff05 100644 --- a/resources/libraries/robot/bridge_domain.robot +++ b/resources/libraries/robot/bridge_domain.robot @@ -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 @@ -56,6 +58,17 @@ | | Set Test Variable | ${tg_node} | | Set Test Variable | ${dut_node} +| Vpp l2bd forwarding setup +| | [Documentation] | Setup BD between 2 interfaces on VPP node and if learning +| | ... | is off set static L2FIB entry on second interface +| | [Arguments] | ${node} | ${if1} | ${if2} | ${learn}=${TRUE} | ${mac}=${EMPTY} +| | Set Interface State | ${node} | ${if1} | up +| | Set Interface State | ${node} | ${if2} | up +| | Vpp Add L2 Bridge Domain | ${node} | ${1} | ${if1} | ${if2} | ${learn} +| | Run Keyword If | ${learn} == ${FALSE} +| | ... | Vpp Add L2fib Entry | ${node} | ${mac} | ${if2} | ${1} +| | All Vpp Interfaces Ready Wait | ${nodes} + | Path for 3-node BD testing is set | | [Documentation] | Compute path for bridge domain testing on three given | | ... | nodes and set corresponding test case variables. @@ -168,3 +181,55 @@ | | ... | ${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}