From 89018d21b6383f853a01c57a2270153d266fe087 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Tue, 5 Jun 2018 10:12:49 +0200 Subject: ovs: Change default bridge names Default names of OVS bridges used by vsperf were changed to avoid accidental collision with 3rd party bridges (e.g. linux bridges) already configured at DUT. Step driven testcases, which extend existing deployment scenarios, were updated to use appropriate configuration options instead of hardcoded bridge names. JIRA: VSPERF-580 Change-Id: I8c7eee6d8f6532485ec3a2cc06f26515e665fb7e Signed-off-by: Martin Klozik Reviewed-by: Al Morton Reviewed-by: Christian Trautman Reviewed-by: Sridhar Rao Reviewed-by: Richard Elias --- conf/02_vswitch.conf | 2 +- conf/integration/01_testcases.conf | 18 +++++----- conf/integration/01a_testcases_l34_vxlan.conf | 8 ++--- conf/integration/01b_dpdk_regression_tests.conf | 44 +++++++++++++------------ conf/integration/02_vswitch.conf | 6 ++-- docs/testing/user/userguide/integration.rst | 4 +-- docs/testing/user/userguide/teststeps.rst | 14 ++++---- docs/testing/user/userguide/trafficcapture.rst | 8 ++--- 8 files changed, 53 insertions(+), 51 deletions(-) diff --git a/conf/02_vswitch.conf b/conf/02_vswitch.conf index c9ffa0b7..61131a77 100644 --- a/conf/02_vswitch.conf +++ b/conf/02_vswitch.conf @@ -172,7 +172,7 @@ OVS_OLD_STYLE_MQ = False VSWITCHD_VANILLA_ARGS = [] # Bridge name to be used by VSWTICH -VSWITCH_BRIDGE_NAME = 'br0' +VSWITCH_BRIDGE_NAME = 'vsperf-br0' # A tunnel type used by OP2P and PTUNP deployments # Supported values: 'vxlan', 'gre' or 'geneve' diff --git a/conf/integration/01_testcases.conf b/conf/integration/01_testcases.conf index bb478302..945b36f7 100644 --- a/conf/integration/01_testcases.conf +++ b/conf/integration/01_testcases.conf @@ -730,9 +730,9 @@ INTEGRATION_TESTS = [ }, "TestSteps": [ # replace original flows with vlan ID modification - ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}], - ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}], - ['vswitch', 'dump_flows', 'br0'], + ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}], + ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], # verify that received frames have modified vlan ID ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'], ['trafficgen', 'send_traffic',{}], @@ -758,14 +758,14 @@ _CAPTURE_P2P2P_SETUP = [ # create and configure two bridges to forward traffic through NIC under # the test and back to the traffic generator # 1st bridge: - ['vswitch', 'add_switch', 'br0'], + ['vswitch', 'add_switch', '$VSWITCH_BRIDGE_NAME'], ['tools', 'exec_shell', 'sudo ip addr flush dev $NICS[0]["device"]'], ['tools', 'exec_shell', 'sudo ip link set dev $NICS[0]["device"] up'], - ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 $NICS[0]["device"]'], + ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port $VSWITCH_BRIDGE_NAME $NICS[0]["device"]'], ['tools', 'exec_shell', 'sudo $TOOLS["bind-tool"] --bind igb_uio $NICS[3]["pci"]'], - ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- ' + ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port $VSWITCH_BRIDGE_NAME dpdk0 -- ' 'set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[3]["pci"]'], - ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow br0 in_port=1,action=' + ['tools', 'exec_shell', '$TOOLS["ovs-ofctl"] add-flow $VSWITCH_BRIDGE_NAME in_port=1,action=' '$_CAPTURE_P2P2P_OVS_ACTION,output:2'], # 2nd bridge: ['vswitch', 'add_switch', 'br1'], @@ -777,7 +777,7 @@ _CAPTURE_P2P2P_SETUP = [ ['tools', 'exec_shell', '$TOOLS["ovs-vsctl"] add-port br1 $NICS[1]["device"]'], ['vswitch', 'add_flow', 'br1', {'in_port': '1', 'actions': ['output:2']}], # log flow details - ['vswitch', 'dump_flows', 'br0'], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], ['vswitch', 'dump_flows', 'br1'], ] INTEGRATION_TESTS += [ @@ -811,7 +811,7 @@ INTEGRATION_TESTS += [ ['tools', 'exec_shell_background', 'tcpdump -i $NICS[2]["device"] -c 5 -w capture.pcap ' 'ether src $TRAFFIC["l2"]["srcmac"]'], ['trafficgen', 'send_traffic', {}], - ['vswitch', 'dump_flows', 'br0'], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], ['vswitch', 'dump_flows', 'br1'], # there must be 5 captured frames... ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'], diff --git a/conf/integration/01a_testcases_l34_vxlan.conf b/conf/integration/01a_testcases_l34_vxlan.conf index cd4b9e90..b42a14d1 100644 --- a/conf/integration/01a_testcases_l34_vxlan.conf +++ b/conf/integration/01a_testcases_l34_vxlan.conf @@ -880,13 +880,13 @@ INTEGRATION_TESTS = INTEGRATION_TESTS + [ }, }, "TestSteps": [ - ['vswitch', 'del_flow', 'br0', {'in_port': '1'}], - ['vswitch', 'add_flow', 'br0', + ['vswitch', 'del_flow', '$TUNNEL_INTEGRATION_BRIDGE', {'in_port': '1'}], + ['vswitch', 'add_flow', '$TUNNEL_INTEGRATION_BRIDGE', {'in_port': '1', 'dl_type': '0x800', 'nw_proto': '17', 'nw_dst': '$TRAFFICGEN_PORT2_IP/8', 'actions': ['output:2'], 'idle_timeout': '0'}], - ['vswitch', 'dump_flows', 'br0'], - ['vswitch', 'dump_flows', 'br-ext'], + ['vswitch', 'dump_flows', '$TUNNEL_INTEGRATION_BRIDGE'], + ['vswitch', 'dump_flows', '$TUNNEL_EXTERNAL_BRIDGE'], ], }, { diff --git a/conf/integration/01b_dpdk_regression_tests.conf b/conf/integration/01b_dpdk_regression_tests.conf index ed9c1e60..abc56c28 100644 --- a/conf/integration/01b_dpdk_regression_tests.conf +++ b/conf/integration/01b_dpdk_regression_tests.conf @@ -1,4 +1,4 @@ -# Copyright 2017-2018 Intel Corporation. +# Copyright 2017-2018 Intel Corporation., Tieto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -341,14 +341,14 @@ INTEGRATION_TESTS = INTEGRATION_TESTS + [ # frame loss with small packets should be detected ['tools', 'assert', '#STEP[-1][0]["frame_loss_percent"] > 10'], # delete phy ports so they can be created with flow control - ['vswitch', 'del_flow', 'br0', {}], - ['vswitch', 'del_port', 'br0', 'dpdk0'], - ['vswitch', 'del_port', 'br0', 'dpdk1'], + ['vswitch', 'del_flow', '$VSWITCH_BRIDGE_NAME', {}], + ['vswitch', 'del_port', '$VSWITCH_BRIDGE_NAME', 'dpdk0'], + ['vswitch', 'del_port', '$VSWITCH_BRIDGE_NAME', 'dpdk1'], # turn on flow control - ['tools', 'exec_shell', 'sudo $TOOLS["ovs-vsctl"] add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[0]["pci"] options:rx-flow-ctrl=true'], - ['tools', 'exec_shell', 'sudo $TOOLS["ovs-vsctl"] add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=$NICS[1]["pci"] options:rx-flow-ctrl=true'], - ['vswitch', 'add_flow', 'br0', {'in_port': '3', 'actions': ['output:4'], 'idle_timeout': '0'}], - ['vswitch', 'add_flow', 'br0', {'in_port': '4', 'actions': ['output:3'], 'idle_timeout': '0'}], + ['tools', 'exec_shell', 'sudo $TOOLS["ovs-vsctl"] add-port $VSWITCH_BRIDGE_NAME dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=$NICS[0]["pci"] options:rx-flow-ctrl=true'], + ['tools', 'exec_shell', 'sudo $TOOLS["ovs-vsctl"] add-port $VSWITCH_BRIDGE_NAME dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=$NICS[1]["pci"] options:rx-flow-ctrl=true'], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '3', 'actions': ['output:4'], 'idle_timeout': '0'}], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '4', 'actions': ['output:3'], 'idle_timeout': '0'}], ['tools', 'exec_shell', 'sudo $TOOLS["ovs-vsctl"] show'], ['trafficgen', 'send_traffic', {}], ['trafficgen', 'get_results'], @@ -668,15 +668,17 @@ INTEGRATION_TESTS = INTEGRATION_TESTS + [ "TestSteps": [ # send traffic to verify correct PVP configuration ['trafficgen', 'send_traffic', {}], - ['vswitch', 'dump_flows', 'br0'], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], # restart vswitchd, ovsdb is kept untouched, so ovs configuration # (except flows) will be restored ['vswitch', 'restart'], - ['vswitch', 'del_flow', 'br0'], - ['vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['output:3'], 'idle_timeout': '0'}], - ['vswitch', 'add_flow', 'br0', {'in_port': '3', 'actions': ['output:1'], 'idle_timeout': '0'}], - ['vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['output:4'], 'idle_timeout': '0'}], - ['vswitch', 'add_flow', 'br0', {'in_port': '4', 'actions': ['output:2'], 'idle_timeout': '0'}], + ['vswitch', 'del_flow', '$VSWITCH_BRIDGE_NAME', {}], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '1', 'actions': ['output:3'], 'idle_timeout': '0'}], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '3', 'actions': ['output:1'], 'idle_timeout': '0'}], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '2', 'actions': ['output:4'], 'idle_timeout': '0'}], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '4', 'actions': ['output:2'], 'idle_timeout': '0'}], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], # send traffic to verify that OVS works correctly after restart ['trafficgen', 'send_traffic', {}], ], @@ -715,13 +717,13 @@ INTEGRATION_TESTS = INTEGRATION_TESTS + [ "VSWITCH_VHOSTUSER_SERVER_MODE" : True, }, "TestSteps": [ - ['vswitch', 'add_switch', 'br0'], + ['vswitch', 'add_switch', '$VSWITCH_BRIDGE_NAME'], ['tools', 'exec_shell', 'sudo $TOOLS["ovs-vsctl"] set Open_vSwitch . ' 'other_config:vhost-sock-dir=test_dir'], # enforce vswitchd to read new configuration ['vswitch', 'restart'], ['tools', 'exec_shell', 'sudo mkdir $TOOLS["ovs_var_tmp"]/test_dir'], - ['vswitch', 'add_vport', 'br0'], + ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'], ['tools', 'exec_shell', 'ls -1 $TOOLS["ovs_var_tmp"]/test_dir', '|dpdkvhostuser0'], ['tools', 'assert', 'len(#STEP[-1])'], @@ -1294,7 +1296,7 @@ _OVSDPDK_RATE_confirm_multiple_rate_limit_setup = \ # check that traffic rate is no longer limited ['trafficgen', 'get_results'], ['tools', 'assert', 'int(#STEP[-1][0]["throughput_rx_mbps"])>500'], - ['vswitch', 'dump_flows', 'br0'], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], ] INTEGRATION_TESTS = INTEGRATION_TESTS + [ @@ -1600,8 +1602,8 @@ INTEGRATION_TESTS = INTEGRATION_TESTS + [ "Parameters" : {}, "TestSteps": [ # Setup switch,port and logs - ['vswitch', 'add_switch', 'br0'], - ['vswitch', 'add_vport', 'br0'], + ['vswitch', 'add_switch', '$VSWITCH_BRIDGE_NAME'], + ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'], ['#LOG_MARK', 'tools', 'exec_shell', 'echo $((1+`wc -l $_OVSDPDK_VSWITCH_LOG | cut -d" " -f1`))', '(\d+)'], @@ -1630,8 +1632,8 @@ INTEGRATION_TESTS = INTEGRATION_TESTS + [ "Parameters" : {}, "TestSteps": [ # Setup switch,port and logs - ['vswitch', 'add_switch', 'br0'], - ['vswitch', 'add_vport', 'br0'], + ['vswitch', 'add_switch', '$VSWITCH_BRIDGE_NAME'], + ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'], ['#LOG_MARK', 'tools', 'exec_shell', 'echo $((1+`wc -l $_OVSDPDK_VSWITCH_LOG | cut -d" " -f1`))', '(\d+)'], diff --git a/conf/integration/02_vswitch.conf b/conf/integration/02_vswitch.conf index 63ffe1bc..9477a1d0 100644 --- a/conf/integration/02_vswitch.conf +++ b/conf/integration/02_vswitch.conf @@ -1,4 +1,4 @@ -# Copyright 2015-2016 Intel Corporation. +# Copyright 2015-2018 Intel Corporation., Tieto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ VTEP_IP1 = '192.168.0.1/24' VTEP_IP2 = '192.168.240.10' VTEP_IP2_SUBNET = '192.168.240.0/24' -TUNNEL_INTEGRATION_BRIDGE = 'br0' -TUNNEL_EXTERNAL_BRIDGE = 'br-ext' +TUNNEL_INTEGRATION_BRIDGE = 'vsperf-br0' +TUNNEL_EXTERNAL_BRIDGE = 'vsperf-br-ext' TUNNEL_EXTERNAL_BRIDGE_IP = '192.168.240.1/24' # vxlan|gre|geneve diff --git a/docs/testing/user/userguide/integration.rst b/docs/testing/user/userguide/integration.rst index 2b2246db..9d847fd8 100644 --- a/docs/testing/user/userguide/integration.rst +++ b/docs/testing/user/userguide/integration.rst @@ -69,8 +69,8 @@ the following variables in you user_settings.py file: VTEP_IP2_SUBNET = '192.168.240.0/24' # Bridge names - TUNNEL_INTEGRATION_BRIDGE = 'br0' - TUNNEL_EXTERNAL_BRIDGE = 'br-ext' + TUNNEL_INTEGRATION_BRIDGE = 'vsperf-br0' + TUNNEL_EXTERNAL_BRIDGE = 'vsperf-br-ext' # IP of br-ext TUNNEL_EXTERNAL_BRIDGE_IP = '192.168.240.1/24' diff --git a/docs/testing/user/userguide/teststeps.rst b/docs/testing/user/userguide/teststeps.rst index 3f91a9d2..cb627bc5 100644 --- a/docs/testing/user/userguide/teststeps.rst +++ b/docs/testing/user/userguide/teststeps.rst @@ -798,20 +798,20 @@ and available in both csv and rst report files. }, }, "TestSteps": [ - ['vswitch', 'add_vport', 'br0'], - ['vswitch', 'add_vport', 'br0'], + ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'], + ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'], # priority must be higher than default 32768, otherwise flows won't match - ['vswitch', 'add_flow', 'br0', + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '1', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x0800', 'nw_proto':'17', 'tp_dst':'0', 'priority': '33000'}], - ['vswitch', 'add_flow', 'br0', + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '2', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x0800', 'nw_proto':'17', 'tp_dst':'0', 'priority': '33000'}], - ['vswitch', 'add_flow', 'br0', {'in_port': '#STEP[-4][1]', 'actions': ['output:1'], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '#STEP[-4][1]', 'actions': ['output:1'], 'idle_timeout': '0'}], - ['vswitch', 'add_flow', 'br0', {'in_port': '#STEP[-4][1]', 'actions': ['output:2'], + ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '#STEP[-4][1]', 'actions': ['output:2'], 'idle_timeout': '0'}], - ['vswitch', 'dump_flows', 'br0'], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], ['vnf1', 'start'], ] }, diff --git a/docs/testing/user/userguide/trafficcapture.rst b/docs/testing/user/userguide/trafficcapture.rst index fa09bfed..8a224dcb 100644 --- a/docs/testing/user/userguide/trafficcapture.rst +++ b/docs/testing/user/userguide/trafficcapture.rst @@ -92,9 +92,9 @@ An example of Traffic Capture in VM test: }, TestSteps: [ # replace original flows with vlan ID modification - ['!vswitch', 'add_flow', 'br0', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}], - ['!vswitch', 'add_flow', 'br0', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}], - ['vswitch', 'dump_flows', 'br0'], + ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '1', 'actions': ['mod_vlan_vid:4','output:3']}], + ['!vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '2', 'actions': ['mod_vlan_vid:4','output:4']}], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], # verify that received frames have modified vlan ID ['VNF0', 'execute_and_wait', 'tcpdump -i eth0 -c 5 -w dump.pcap vlan 4 &'], ['trafficgen', 'send_traffic',{}], @@ -199,7 +199,7 @@ An example of Traffic Capture for testing NICs with HW offloading test: ['tools', 'exec_shell_background', 'tcpdump -i [2][device] -c 5 -w capture.pcap ' 'ether src [l2][srcmac]'], ['trafficgen', 'send_traffic', {}], - ['vswitch', 'dump_flows', 'br0'], + ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'], ['vswitch', 'dump_flows', 'br1'], # there must be 5 captured frames... ['tools', 'exec_shell', 'tcpdump -r capture.pcap | wc -l', '|^(\d+)$'], -- cgit 1.2.3-korg