VPPD: VXLAN
[csit.git] / resources / libraries / robot / l2 / l2_bridge_domain.robot
index 3d6f483..4c3d629 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2019 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:
 | | ... | Vpp Add L2fib Entry | ${dut_node} | ${mac} | ${if2} | ${1}
 | | Vpp Node Interfaces Ready Wait | ${dut_node}
 
+| Initialize L2 bridge domain on node
+| | [Documentation]
+| | ... | Setup L2 bridge domain topology by adding two interfaces on DUT into
+| | ... | separate bridge domains that are created automatically starting with
+| | ... | index 1. Learning is enabled. Interfaces are brought up.
+| | ...
+| | ... | *Arguments:*
+| | ... | - dut - DUT node. Type: string
+| | ... | - count - Number of bridge domains interfaces. Type: integer
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Initialize L2 bridge domain on node \| DUT1 \| 1 \|
+| | ...
+| | [Arguments] | ${dut} | ${count}=${1}
+| | ...
+| | :FOR | ${id} | IN RANGE | 1 | ${count} + 1
+| | | ${dut_str}= | Convert To Lowercase | ${dut}
+| | | Add interface to bridge domain
+| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} | ${id}
+| | | Add interface to bridge domain
+| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} | ${id}
+
+| Initialize L2 bridge domain
+| | [Documentation]
+| | ... | Setup L2 bridge domain topology by adding two interfaces on each DUT
+| | ... | into separate bridge domains that are created automatically starting
+| | ... | with index 1. Learning is enabled. Interfaces are brought up.
+| | ...
+| | ... | *Arguments:*
+| | ... | - count - Number of bridge domains. Type: integer
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Initialize L2 bridge domain \| 1 \|
+| | ...
+| | [Arguments] | ${count}=${1}
+| | ...
+| | :FOR | ${dut} | IN | @{duts}
+| | | Initialize L2 bridge domain on node | ${dut} | count=${count}
+
 | Configure path for 3-node BD-SHG test
 | | [Documentation] | Compute path for bridge domain split-horizon group testing
 | | ...             | on three given nodes with following interconnections
 | | ${mac}= | Get Interface Mac | ${dest_node} | ${dest_node_if}
 | | Vpp Add L2fib Entry | ${vpp_node} | ${mac} | ${vpp_node_if} | ${bd_id}
 
-| Configure VM for vhost L2BD forwarding
-| | [Documentation] | Setup QEMU and start VM with two vhost interfaces.
-| | ...
-| | ... | *Arguments:*
-| | ... | - ${dut_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
-| | ... | - ${qemu_name} - Qemu instance name by which the object will be
-| | ... | accessed (Optional). Type: string
-| | ...
-| | ... | _NOTE:_ This KW sets following test case variable:
-| | ... | - ${${qemu_name}} - VM node info. Type: dictionary
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Configure VM for vhost L2BD forwarding \| ${nodes['DUT1']} \
-| | ... | \| /tmp/sock1 \| /tmp/sock2 \|
-| | ... | \| Configure VM for vhost L2BD forwarding \| ${nodes['DUT2']} \
-| | ... | \| /tmp/sock1 \| /tmp/sock2 \| qemu_instance_2 \|
-| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${qemu_name}=vm_node
-| | Run Keyword Unless | "${qemu_name}" == "vm_node" | Import Library
-| | ... | resources.libraries.python.QemuUtils | WITH NAME | ${qemu_name}
-| | Set Test Variable | ${${qemu_name}} | ${None}
-| | ${qemu_set_node}= | Run Keyword If | "${qemu_name}" == "vm_node"
-| | | ...                              | Set Variable | Qemu Set Node
-| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Set Node
-| | Run keyword | ${qemu_set_node} | ${dut_node}
-| | ${qemu_add_vhost}= | Run Keyword If | "${qemu_name}" == "vm_node"
-| | | ...                               | Set Variable | Qemu Add Vhost User If
-| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Add Vhost User If
-| | Run keyword | ${qemu_add_vhost} | ${sock1}
-| | Run keyword | ${qemu_add_vhost} | ${sock2}
-| | ${qemu_start}= | Run Keyword If | "${qemu_name}" == "vm_node"
-| | | ...                           | Set Variable | Qemu Start
-| | ... | ELSE | Replace Variables | ${qemu_name}.Qemu Start
-| | ${vm}= | Run keyword | ${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 | if_type=name
-| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
-| | Set Interface State | ${vm} | ${br} | up | if_type=name
-| | Set Test Variable | ${${qemu_name}} | ${vm}
-
 | Configure vhost interfaces for L2BD forwarding
 | | [Documentation] | Create two Vhost-User interfaces on defined VPP node.
 | | ...