CSIT-19: MAC split-horizon group 19/919/6
authorJan Gelety <jgelety@cisco.com>
Thu, 28 Apr 2016 20:54:59 +0000 (22:54 +0200)
committerMatej Klotton <mklotton@cisco.com>
Mon, 9 May 2016 10:58:12 +0000 (10:58 +0000)
- test case to test MAC split-horizon group functionality

Change-Id: Iadee707f3670e5fc9c209bd8b072a65ea1af27cd
Signed-off-by: Jan Gelety <jgelety@cisco.com>
resources/libraries/python/TrafficScriptExecutor.py
resources/libraries/robot/bridge_domain.robot
tests/suites/bridge_domain/bridge_domain_untagged.robot

index 89362c5..fa44623 100644 (file)
@@ -65,7 +65,10 @@ class TrafficScriptExecutor(object):
         logger.debug("stderr: {}".format(stderr))
         logger.debug("ret_code: {}".format(ret_code))
         if ret_code != 0:
-            raise Exception("Traffic script execution failed")
+            if "RuntimeError: ICMP echo Rx timeout" in stderr:
+                raise Exception("ICMP echo Rx timeout")
+            else:
+                raise Exception("Traffic script execution failed")
 
     @staticmethod
     def traffic_script_gen_arg(rx_if, tx_if, src_mac, dst_mac, src_ip, dst_ip):
index e31a3bf..9cd3a70 100644 (file)
 | | Set Test Variable | ${dut1_node}
 | | Set Test Variable | ${dut2_node}
 
+| Path for 3-node BD-SHG testing is set
+| | [Documentation] | Compute path for bridge domain split-horizon group testing
+| | ...             | on three given nodes with following interconnections
+| | ...             | TG - (2 links) - DUT1 - (1 link) - DUT2 - (2 links) - TG
+| | ...             | and set corresponding test case variables.
+| | ...
+| | ... | *Arguments:*
+| | ... | - ${tg_node} - TG node. Type: dictionary
+| | ... | - ${dut1_node} - DUT1 node. Type: dictionary
+| | ... | - ${dut2_node} - DUT2 node. Type: dictionary
+| | ...
+| | ... | *Return:*
+| | ... | - No value returned
+| | ... |
+| | ... | _NOTE:_ This KW sets following test case variables:
+| | ... | - ${tg_node} - TG node.
+| | ... | - ${tg_to_dut1_if1} - TG interface 1 towards DUT1.
+| | ... | - ${tg_to_dut1_if2} - TG interface 2 towards DUT1.
+| | ... | - ${tg_to_dut2_if1} - TG interface 1 towards DUT2.
+| | ... | - ${tg_to_dut2_if2} - TG interface 2 towards DUT2.
+| | ... | - ${dut1_node} - DUT1 node.
+| | ... | - ${dut1_to_tg_if1} - DUT1 interface 1 towards TG.
+| | ... | - ${dut1_to_tg_if2} - DUT1 interface 2 towards TG.
+| | ... | - ${dut1_to_dut2} - DUT1 interface towards DUT2.
+| | ... | - ${dut2_node} - DUT2 node.
+| | ... | - ${dut2_to_tg_if1} - DUT2 interface 1 towards TG.
+| | ... | - ${dut2_to_tg_if2} - DUT2 interface 2 towards TG.
+| | ... | - ${dut2_to_dut1} - DUT2 interface towards DUT1.
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Given Path for 3-node BD-SHG testing is set \| ${nodes['TG']} \
+| | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \|
+| | [Arguments] | ${tg_node} | ${dut1_node} | ${dut2_node}
+| | # Compute path TG - DUT1 with two links in between
+| | Append Nodes | ${tg_node} | ${dut1_node} | ${tg_node}
+| | Compute Path | always_same_link=${FALSE}
+| | ${tg_to_dut1_if1} | ${tmp}= | First Interface
+| | ${tg_to_dut1_if2} | ${tmp}= | Last Interface
+| | ${dut1_to_tg_if1} | ${tmp}= | First Ingress Interface
+| | ${dut1_to_tg_if2} | ${tmp}= | Last Egress Interface
+| | # Compute path TG - DUT2 with two links in between
+| | Clear Path
+| | Append Nodes | ${tg_node} | ${dut2_node} | ${tg_node}
+| | Compute Path | always_same_link=${FALSE}
+| | ${tg_to_dut2_if1} | ${tmp}= | First Interface
+| | ${tg_to_dut2_if2} | ${tmp}= | Last Interface
+| | ${dut2_to_tg_if1} | ${tmp}= | First Ingress Interface
+| | ${dut2_to_tg_if2} | ${tmp}= | Last Egress Interface
+| | # Compute path DUT1 - DUT2 with one link in between
+| | Clear Path
+| | Append Nodes | ${dut1_node} | ${dut2_node}
+| | Compute Path
+| | ${dut1_to_dut2} | ${tmp}= | Next Interface
+| | ${dut2_to_dut1} | ${tmp}= | Next Interface
+| | # Set test variables
+| | Set Test Variable | ${tg_to_dut1_if1}
+| | Set Test Variable | ${tg_to_dut1_if2}
+| | Set Test Variable | ${tg_to_dut2_if1}
+| | Set Test Variable | ${tg_to_dut2_if2}
+| | Set Test Variable | ${dut1_to_tg_if1}
+| | Set Test Variable | ${dut1_to_tg_if2}
+| | Set Test Variable | ${dut2_to_tg_if1}
+| | Set Test Variable | ${dut2_to_tg_if2}
+| | Set Test Variable | ${dut1_to_dut2}
+| | Set Test Variable | ${dut2_to_dut1}
+| | Set Test Variable | ${tg_node}
+| | Set Test Variable | ${dut1_node}
+| | Set Test Variable | ${dut2_node}
+
 | Bridge domain on DUT node is created
 | | [Documentation] | Create bridge domain on given VPP node with defined
 | | ...             | learning status.
 | | ... | - ${dut_node} - DUT node. Type: dictionary
 | | ... | - ${dut_if} - DUT node interface name. Type: string
 | | ... | - ${bd_id} - Bridge domain ID. Type: integer
+| | ... | - ${shg} - Split-horizon group ID. Type: integer, default value: 0
 | | ...
 | | ... | *Return:*
 | | ... | - No value returned
 | | ...
 | | ... | \| Interface is added to bridge domain \| ${nodes['DUT2']} \
 | | ... | \| GigabitEthernet0/8/0 \| 3 \|
-| | [Arguments] | ${dut_node} | ${dut_if} | ${bd_id}
+| | [Arguments] | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}=0
 | | Set Interface State | ${dut_node} | ${dut_if} | up
-| | Add Interface To L2 BD | ${dut_node} | ${dut_if} | ${bd_id}
+| | Add Interface To L2 BD | ${dut_node} | ${dut_if} | ${bd_id} | ${shg}
 
 | Destination port is added to L2FIB on DUT node
 | | [Documentation] | Create a static L2FIB entry for required destination port
index bc5eac2..6f7cd6e 100644 (file)
@@ -22,7 +22,7 @@
 | Test Teardown | Show Packet Trace on All DUTs | ${nodes}
 | Documentation | *Bridge domain test suite.*
 | ...
-| ... | Test suite uses 2-node topology TGTG - DUT1 - TG with two links
+| ... | Test suite uses 2-node topology TG - DUT1 - TG with two links
 | ... | between nodes as well as 3-node topology TG - DUT1 - DUT2 - TG
 | ... | with one link between nodes. Test packets are sent in both directions
 | ... | and contain Ethernet header, IPv4 header and ICMP message. Ethernet
@@ -31,6 +31,8 @@
 *** Variables ***
 | ${bd_id1}= | 1
 | ${bd_id2}= | 2
+| ${shg1}= | 3
+| ${shg2}= | 4
 | ${sock1}= | /tmp/sock1
 | ${sock2}= | /tmp/sock2
 
 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
 | | ...                                          | ${tg_to_dut2}
 
+| Vpp forwards packets via L2 bridge domain with split-horizon groups set in circular topology
+| | [Documentation] | Create bridge domains (learning enabled) on two VPP nodes,
+| | ...             | add interfaces to each bridge domain where both interfaces
+| | ...             | toward TG are in the same split-horizon group and check
+| | ...             | traffic bidirectionally.
+| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
+| | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']}
+| | ...                                         | ${nodes['DUT1']}
+| | ...                                         | ${nodes['DUT2']}
+| | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
+| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1}
+| | ...                                     | ${bd_id1} | ${shg1}
+| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2}
+| | ...                                     | ${bd_id1} | ${shg1}
+| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
+| | ...                                     | ${bd_id1}
+| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
+| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1}
+| | ...                                     | ${bd_id2} | ${shg2}
+| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2}
+| | ...                                     | ${bd_id2} | ${shg2}
+| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
+| | ...                                     | ${bd_id2}
+| | And Interfaces on all VPP nodes in the path are up | ${dut1_node}
+| | ...                                                | ${dut2_node}
+| | Then Send and receive ICMPv4 bidirectionally | ${tg_node}
+| | ...                                          | ${tg_to_dut1_if1}
+| | ...                                          | ${tg_to_dut2_if1}
+| | And Send and receive ICMPv4 bidirectionally | ${tg_node}
+| | ...                                         | ${tg_to_dut1_if1}
+| | ...                                         | ${tg_to_dut2_if2}
+| | And Send and receive ICMPv4 bidirectionally | ${tg_node}
+| | ...                                         | ${tg_to_dut1_if2}
+| | ...                                         | ${tg_to_dut2_if1}
+| | And Send and receive ICMPv4 bidirectionally | ${tg_node}
+| | ...                                         | ${tg_to_dut1_if2}
+| | ...                                         | ${tg_to_dut2_if2}
+| | And Run Keyword And Expect Error | ICMP echo Rx timeout
+| | ...                              | Send and receive ICMPv4 bidirectionally
+| | | ...                            | ${tg_node} | ${tg_to_dut1_if1}
+| | | ...                            | ${tg_to_dut1_if2}
+| | And Run Keyword And Expect Error | ICMP echo Rx timeout
+| | ...                              | Send and receive ICMPv4 bidirectionally
+| | | ...                            | ${tg_node} | ${tg_to_dut2_if1}
+| | | ...                            | ${tg_to_dut2_if2}
+
 | 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

©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.