[RFC v2 00/47] Python Recipes
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
v2 changes:
add lnst.Common.IpAddress
* modify exception string.
add lnst.Common.Parameters
* add docstring explaining the __getattribute__ magic
* make val a property
* rename x to attr in Parameters dir() iterations
* fix IpParam value setter for string values
* modify IpParam Exception string
add lnst.Devices
* make Device a Meta class and register RemoteDevice as implementing
the Device interface
* removed unnecessary imports
* added MasterDevice class for slave* methods
* made master_set to be a 'master' property setter
* renamed {add, del}_route to route_{add, del}
* renamed set_speed to speed_set
* renamed set_autoneg to autoneg_set
* removed modprobes where unnecessary
* link_stats are now retrieved from netlink message
* added link_stats64
* OvsBridge calls parent _type_init for modprobe
* remove SoftDevice import - not required
add lnst.Controller.Host
* removed debug pprint import
* added docstrings to requested methods
* Host::run throws an exception when netns set (not supported yet)
* added TODO comments to some parts that need to be implemented
add lnst.Controller.MachineMapper
* docstring now explains that implementing your own MachineMapper is
not supported at this moment
* removed debug pprint import
add lnst.Controller.Recipe
* renamed variable 'x' to 'attr'
Machine, NetTestSlave: heavy reimplementation
* improved class and module synchronization implementation
* join split lines in deviceref_to_device method
lnst.Common.Parameters: IpParam accepts Device objects
* import Device on demand (Device class arrives on Slave later) and
check isinstance Device instead of RemoteDevice (not available on
Slave)
* fix IpParam Exception string
v2 new commits:
Controller, Devices: removing unused imports
NetTestSlave: create dynamic lnst.Tests package
lnst.Tests: add package docstring
lnst.Common.Parameters: add DeviceParam
lnst.Tests.IcmpPing: use DeviceParam for iface parameter
Including the original cover letter as well:
Hi all,
the long avaited patchset for Python Recipes is here.
At this point there's still quite a lot of work left, but since the current
state is functional and the tester facing API should be mostly stable I think
it's a good time to get this merged into upstream so that more people can get
involved with filling in the missing pieces and can slowly start experimenting
and porting their XML recipes.
This I know are missing:
* Recipe run summary - how the Summary should look like was described in the
running proposal document, but I didn't manage to start with the
implementation yet...
* Porting of all the old test_modules into the lnst.Tests package, so far we
only have the IcmpPing module that should still be reworked to be more
universal (ip4 and ip6 in one class). Porting test_modules should be fairly
easy, but at this point there's no guide how to do it so if you're having
trouble feel free to contact me either on irc or email.
* test_tools - we haven't even thought of these yet
* network namespaces - also didn't think about them yet, though I'm hoping this
will be simple
* Ip address and network generators as we've discussed them on the upstream
meeting
Please review and provide any comments or features I forgot that should be
added to the above list.
Regards,
Ondrej
Ondrej Lichtner (47):
add lnst.Common.LnstError
add lnst.Common.DeviceError
add lnst.Common.DeviceRef
add lnst.Common.IpAddress
add lnst.Common.Parameters
add lnst.Common.TestModule
add lnst.Common.JobError
add lnst.Controller.Common
add lnst.Devices
add lnst.Controller.Requirements
add lnst.Controller.Job
add lnst.Controller.Host
add lnst.Controller.Config
add lnst.Slave.Config
add lnst.Controller.MachineMapper
lnst.Controller.Machine: change object initialization
add lnst.Controller.MessageDispatcher
add lnst.Controller.SlavePoolManager
add lnst.Controller.Recipe
add lnst.Controller.Controller
various files: retype exceptions
add lnst.Tests package
lnst.Common.Config: remove {controller, slave}_init
lnst.Common.Config: remove global lnst_config
Slave: use a local config object instead of a global one
lnst.Common.Utils: add sha256sum function
lnst.Common.ResourceCache: simplification
lnst.Controller.CtlSecSocket: remove lnst_config import
lnst.Controller.SlaveMachineParser: make standalone
add lnst.Common.InterfaceManagerError
add lnst.Slave.Job
lnst.Slave.InterfaceManager: heavy reimplementation
Machine, NetTestSlave: heavy reimplementation
lnst.Slave.InterfaceManager: remove Device class implementation
add lnst.Controller package imports
lnst/__init__.py remove imports
lnst.Controller: remove old modules
setup.py: add new packages
add lnst.Devices.VirtNetCtl
lnst.Controller: move VirtUtils to VirtDomainCtl, remove VirtNetCtl
class
lnst.Common.Parameters: IpParam accepts Device objects
add example python_recipe.py script
Controller, Devices: removing unused imports
NetTestSlave: create dynamic lnst.Tests package
lnst.Tests: add package docstring
lnst.Common.Parameters: add DeviceParam
lnst.Tests.IcmpPing: use DeviceParam for iface parameter
lnst-slave | 20 +-
lnst/Common/Config.py | 152 +---
lnst/Common/DeviceError.py | 22 +
lnst/Common/DeviceRef.py | 19 +
lnst/Common/ExecCmd.py | 3 +-
lnst/Common/InterfaceManagerError.py | 16 +
lnst/Common/IpAddress.py | 99 +++
lnst/Common/JobError.py | 22 +
lnst/Common/LnstError.py | 18 +
lnst/Common/NetTestCommand.py | 5 +-
lnst/Common/Parameters.py | 157 ++++
lnst/Common/ResourceCache.py | 128 ++--
lnst/Common/SecureSocket.py | 3 +-
lnst/Common/ShellProcess.py | 3 +-
lnst/Common/TestModule.py | 67 ++
lnst/Common/TestsCommon.py | 3 +-
lnst/Common/Utils.py | 11 +
lnst/Controller/Common.py | 17 +
lnst/Controller/Config.py | 99 +++
lnst/Controller/Controller.py | 218 ++++++
lnst/Controller/CtlSecSocket.py | 2 -
lnst/Controller/Host.py | 160 ++++
lnst/Controller/Job.py | 196 +++++
lnst/Controller/Machine.py | 1356 +++++++--------------------------
lnst/Controller/MachineMapper.py | 328 ++++++++
lnst/Controller/MessageDispatcher.py | 203 +++++
lnst/Controller/NetTestController.py | 620 ---------------
lnst/Controller/Recipe.py | 97 +++
lnst/Controller/RecipeParser.py | 572 --------------
lnst/Controller/Requirements.py | 113 +++
lnst/Controller/SlaveMachineParser.py | 144 +++-
lnst/Controller/SlavePool.py | 648 ----------------
lnst/Controller/SlavePoolManager.py | 273 +++++++
lnst/Controller/Task.py | 4 +-
lnst/Controller/VirtDomainCtl.py | 98 +++
lnst/Controller/VirtUtils.py | 268 -------
lnst/Controller/XmlParser.py | 188 -----
lnst/Controller/XmlProcessing.py | 235 ------
lnst/Controller/XmlTemplates.py | 438 -----------
lnst/Controller/__init__.py | 3 +
lnst/Devices/BondDevice.py | 38 +
lnst/Devices/BridgeDevice.py | 33 +
lnst/Devices/Device.py | 355 +++++++++
lnst/Devices/MacvlanDevice.py | 38 +
lnst/Devices/MasterDevice.py | 33 +
lnst/Devices/OvsBridgeDevice.py | 115 +++
lnst/Devices/RemoteDevice.py | 98 +++
lnst/Devices/SoftDevice.py | 51 ++
lnst/Devices/TeamDevice.py | 60 ++
lnst/Devices/VethDevice.py | 58 ++
lnst/Devices/VethPair.py | 24 +
lnst/Devices/VirtNetCtl.py | 85 +++
lnst/Devices/VirtualDevice.py | 98 +++
lnst/Devices/VlanDevice.py | 35 +
lnst/Devices/VtiDevice.py | 71 ++
lnst/Devices/VxlanDevice.py | 65 ++
lnst/Devices/__init__.py | 42 +
lnst/RecipeCommon/ModuleWrap.py | 33 +-
lnst/Slave/Config.py | 73 ++
lnst/Slave/InterfaceManager.py | 648 ++--------------
lnst/Slave/Job.py | 251 ++++++
lnst/Slave/NetTestSlave.py | 846 ++++++++++----------
lnst/Tests/IcmpPing.py | 62 ++
lnst/Tests/__init__.py | 17 +
lnst/__init__.py | 1 -
recipes/examples/python_recipe.py | 32 +
setup.py | 2 +-
67 files changed, 4991 insertions(+), 5301 deletions(-)
create mode 100644 lnst/Common/DeviceError.py
create mode 100644 lnst/Common/DeviceRef.py
create mode 100644 lnst/Common/InterfaceManagerError.py
create mode 100644 lnst/Common/IpAddress.py
create mode 100644 lnst/Common/JobError.py
create mode 100644 lnst/Common/LnstError.py
create mode 100644 lnst/Common/Parameters.py
create mode 100644 lnst/Common/TestModule.py
create mode 100644 lnst/Controller/Common.py
create mode 100644 lnst/Controller/Config.py
create mode 100644 lnst/Controller/Controller.py
create mode 100644 lnst/Controller/Host.py
create mode 100644 lnst/Controller/Job.py
create mode 100644 lnst/Controller/MachineMapper.py
create mode 100644 lnst/Controller/MessageDispatcher.py
delete mode 100644 lnst/Controller/NetTestController.py
create mode 100644 lnst/Controller/Recipe.py
delete mode 100644 lnst/Controller/RecipeParser.py
create mode 100644 lnst/Controller/Requirements.py
delete mode 100644 lnst/Controller/SlavePool.py
create mode 100644 lnst/Controller/SlavePoolManager.py
create mode 100644 lnst/Controller/VirtDomainCtl.py
delete mode 100644 lnst/Controller/VirtUtils.py
delete mode 100644 lnst/Controller/XmlParser.py
delete mode 100644 lnst/Controller/XmlProcessing.py
delete mode 100644 lnst/Controller/XmlTemplates.py
create mode 100644 lnst/Devices/BondDevice.py
create mode 100644 lnst/Devices/BridgeDevice.py
create mode 100644 lnst/Devices/Device.py
create mode 100644 lnst/Devices/MacvlanDevice.py
create mode 100644 lnst/Devices/MasterDevice.py
create mode 100644 lnst/Devices/OvsBridgeDevice.py
create mode 100644 lnst/Devices/RemoteDevice.py
create mode 100644 lnst/Devices/SoftDevice.py
create mode 100644 lnst/Devices/TeamDevice.py
create mode 100644 lnst/Devices/VethDevice.py
create mode 100644 lnst/Devices/VethPair.py
create mode 100644 lnst/Devices/VirtNetCtl.py
create mode 100644 lnst/Devices/VirtualDevice.py
create mode 100644 lnst/Devices/VlanDevice.py
create mode 100644 lnst/Devices/VtiDevice.py
create mode 100644 lnst/Devices/VxlanDevice.py
create mode 100644 lnst/Devices/__init__.py
create mode 100644 lnst/Slave/Config.py
create mode 100644 lnst/Slave/Job.py
create mode 100644 lnst/Tests/IcmpPing.py
create mode 100644 lnst/Tests/__init__.py
create mode 100755 recipes/examples/python_recipe.py
--
2.13.0
6 years, 3 months
[PATCH 0/3] TC VLAN tests
by Petr Machata
Hi,
this patchset adds a helper to make it simpler to express TC actions.
The goal is not to make it fully expressive like the TC command line,
but rather to abstract away tasts that are repeated over and over again
in recipes.
On top of that I include a test for VLAN modify and for flower matches
on 802.1q tags.
Please consider for inclusion.
Thanks,
Petr Machata
Petr Machata (3):
recipes: switchdev: Add Qdisc helper
recipes: switchdev: tc: Add test for vlan modify action
recipes: switchdev: tc: Add a test for flower vlan matching
recipes/switchdev/TestLib.py | 21 +++++++-
recipes/switchdev/tc-001-action-vlan-modify.py | 44 ++++++++++++++++
recipes/switchdev/tc-001-action-vlan-modify.xml | 24 +++++++++
recipes/switchdev/tc-002-flower-vlan.py | 68 +++++++++++++++++++++++++
recipes/switchdev/tc-002-flower-vlan.xml | 24 +++++++++
5 files changed, 180 insertions(+), 1 deletion(-)
create mode 100644 recipes/switchdev/tc-001-action-vlan-modify.py
create mode 100644 recipes/switchdev/tc-001-action-vlan-modify.xml
create mode 100644 recipes/switchdev/tc-002-flower-vlan.py
create mode 100644 recipes/switchdev/tc-002-flower-vlan.xml
--
2.8.4
6 years, 3 months
[PATCH 3/3] recipes: switchdev: tc: Add a test for flower vlan
matching
by Petr Machata
This tests VLAN ID and VLAN PCP matching by dropping the matching
traffic and making sure that all traffic but the matching one gets
through.
Signed-off-by: Petr Machata <petrm(a)mellanox.com>
---
recipes/switchdev/tc-002-flower-vlan.py | 68 ++++++++++++++++++++++++++++++++
recipes/switchdev/tc-002-flower-vlan.xml | 24 +++++++++++
2 files changed, 92 insertions(+)
create mode 100644 recipes/switchdev/tc-002-flower-vlan.py
create mode 100644 recipes/switchdev/tc-002-flower-vlan.xml
diff --git a/recipes/switchdev/tc-002-flower-vlan.py b/recipes/switchdev/tc-002-flower-vlan.py
new file mode 100644
index 0000000..2eb419d
--- /dev/null
+++ b/recipes/switchdev/tc-002-flower-vlan.py
@@ -0,0 +1,68 @@
+"""
+Copyright 2017 Mellanox Technologies. All rights reserved.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+petrm(a)mellanox.com (Petr Machata)
+"""
+
+from lnst.Controller.Task import ctl
+from TestLib import TestLib, Qdisc
+from time import sleep
+
+def do_task(ctl, hosts, ifaces, aliases):
+ m1, m2, sw = hosts
+ m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
+
+ m1_if1_85 = m1.create_vlan(m1_if1, 85,
+ ip=["192.168.85.10/24", "2002:85::1/64"])
+ m2_if1_85 = m2.create_vlan(m2_if1, 85,
+ ip=["192.168.85.11/24", "2002:85::2/64"])
+ m1.run("ip link set dev %s type vlan egress 0:7" % m1_if1_85.get_devname())
+ m2.run("ip link set dev %s type vlan egress 0:7" % m2_if1_85.get_devname())
+
+ m1_if1_95 = m1.create_vlan(m1_if1, 95,
+ ip=["192.168.95.10/24", "2002:95::1/64"])
+ m2_if1_95 = m2.create_vlan(m2_if1, 95,
+ ip=["192.168.95.11/24", "2002:95::2/64"])
+
+ sw_br1 = sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
+ sw_if1.add_br_vlan(85)
+ sw_if2.add_br_vlan(85)
+ sw_if1.add_br_vlan(95)
+ sw_if2.add_br_vlan(95)
+
+ sleep(15)
+
+ tl = TestLib(ctl, aliases)
+
+ # Test to establish that there is connectivity.
+ tl.ping_simple(m1_if1_85, m2_if1_85, count=10, limit_rate=9, interval=0.1)
+ tl.ping_simple(m1_if1_95, m2_if1_95, count=10, limit_rate=9, interval=0.1)
+
+ q1 = Qdisc(sw_if1, 0xffff, "ingress")
+
+ # Test that PCP match matches only that PCP.
+ q1.flush()
+ q1.filter_add("protocol 802.1q flower vlan_prio 7 skip_sw action drop")
+ sleep(1)
+ tl.ping_simple(m1_if1_85, m2_if1_85, limit_rate=10, fail_expected=True)
+ tl.ping_simple(m1_if1_95, m2_if1_95)
+
+ # Test that vlan match actually matches only that vlan.
+ q1.flush()
+ q1.filter_add("protocol 802.1q flower vlan_id 95 skip_sw action drop")
+ sleep(1)
+ tl.ping_simple(m1_if1_85, m2_if1_85)
+ tl.ping_simple(m1_if1_95, m2_if1_95, limit_rate=10, fail_expected=True)
+
+do_task(ctl, [ctl.get_host("machine1"),
+ ctl.get_host("machine2"),
+ ctl.get_host("switch")],
+ [ctl.get_host("machine1").get_interface("if1"),
+ ctl.get_host("machine2").get_interface("if1"),
+ ctl.get_host("switch").get_interface("if1"),
+ ctl.get_host("switch").get_interface("if2")],
+ ctl.get_aliases())
diff --git a/recipes/switchdev/tc-002-flower-vlan.xml b/recipes/switchdev/tc-002-flower-vlan.xml
new file mode 100644
index 0000000..7ac41f6
--- /dev/null
+++ b/recipes/switchdev/tc-002-flower-vlan.xml
@@ -0,0 +1,24 @@
+<lnstrecipe xmlns:xi="http://www.w3.org/2003/XInclude">
+ <xi:include href="default_aliases.xml" />
+ <network>
+ <host id="machine1">
+ <params/>
+ <interfaces>
+ <eth id="if1" label="A" />
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <params/>
+ <interfaces>
+ <eth id="if1" label="B" />
+ </interfaces>
+ </host>
+ <host id="switch">
+ <interfaces>
+ <eth id="if1" label="A" />
+ <eth id="if2" label="B" />
+ </interfaces>
+ </host>
+ </network>
+ <task python="tc-002-flower-vlan.py" />
+</lnstrecipe>
--
2.8.4
6 years, 4 months
[PATCH 2/3] recipes: switchdev: tc: Add test for vlan modify action
by Petr Machata
Assume a topology with a central switch and two hosts. Each host sends
traffic on a different VLAN. The switch translates the VLANs to one
another using tc action vlan modify.
Signed-off-by: Petr Machata <petrm(a)mellanox.com>
---
recipes/switchdev/tc-001-action-vlan-modify.py | 44 +++++++++++++++++++++++++
recipes/switchdev/tc-001-action-vlan-modify.xml | 24 ++++++++++++++
2 files changed, 68 insertions(+)
create mode 100644 recipes/switchdev/tc-001-action-vlan-modify.py
create mode 100644 recipes/switchdev/tc-001-action-vlan-modify.xml
diff --git a/recipes/switchdev/tc-001-action-vlan-modify.py b/recipes/switchdev/tc-001-action-vlan-modify.py
new file mode 100644
index 0000000..a9c0d16
--- /dev/null
+++ b/recipes/switchdev/tc-001-action-vlan-modify.py
@@ -0,0 +1,44 @@
+"""
+Copyright 2017 Mellanox Technologies. All rights reserved.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+petrm(a)mellanox.com (Petr Machata)
+"""
+
+from lnst.Controller.Task import ctl
+from TestLib import TestLib, Qdisc
+from time import sleep
+
+def do_task(ctl, hosts, ifaces, aliases):
+ m1, m2, sw = hosts
+ m1_if1, m2_if1, sw_if1, sw_if2 = ifaces
+
+ m1_if1_85 = m1.create_vlan(m1_if1, 85, ip=["192.168.101.10/24", "2002::1/64"])
+ m2_if1_65 = m2.create_vlan(m2_if1, 65, ip=["192.168.101.11/24", "2002::2/64"])
+
+ sw_br1 = sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
+ sw_if1.add_br_vlan(85)
+ sw_if2.add_br_vlan(65)
+
+ q1 = Qdisc(sw_if1, 0xffff, "ingress")
+ q1.filter_add("protocol all flower skip_sw action vlan modify id 65")
+
+ q2 = Qdisc(sw_if2, 0xffff, "ingress")
+ q2.filter_add("protocol all flower skip_sw action vlan modify id 85")
+
+ sleep(10)
+
+ tl = TestLib(ctl, aliases)
+ tl.ping_simple(m1_if1_85, m2_if1_65)
+
+do_task(ctl, [ctl.get_host("machine1"),
+ ctl.get_host("machine2"),
+ ctl.get_host("switch")],
+ [ctl.get_host("machine1").get_interface("if1"),
+ ctl.get_host("machine2").get_interface("if1"),
+ ctl.get_host("switch").get_interface("if1"),
+ ctl.get_host("switch").get_interface("if2")],
+ ctl.get_aliases())
diff --git a/recipes/switchdev/tc-001-action-vlan-modify.xml b/recipes/switchdev/tc-001-action-vlan-modify.xml
new file mode 100644
index 0000000..d55658c
--- /dev/null
+++ b/recipes/switchdev/tc-001-action-vlan-modify.xml
@@ -0,0 +1,24 @@
+<lnstrecipe xmlns:xi="http://www.w3.org/2003/XInclude">
+ <xi:include href="default_aliases.xml" />
+ <network>
+ <host id="machine1">
+ <params/>
+ <interfaces>
+ <eth id="if1" label="A" />
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <params/>
+ <interfaces>
+ <eth id="if1" label="B" />
+ </interfaces>
+ </host>
+ <host id="switch">
+ <interfaces>
+ <eth id="if1" label="A" />
+ <eth id="if2" label="B" />
+ </interfaces>
+ </host>
+ </network>
+ <task python="tc-001-action-vlan-modify.py" />
+</lnstrecipe>
--
2.8.4
6 years, 4 months
[PATCH 1/3] recipes: switchdev: Add Qdisc helper
by Petr Machata
Add a very lightweight helper for handling tc qdiscs.
Signed-off-by: Petr Machata <petrm(a)mellanox.com>
---
recipes/switchdev/TestLib.py | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/recipes/switchdev/TestLib.py b/recipes/switchdev/TestLib.py
index cabce0b..e34161c 100644
--- a/recipes/switchdev/TestLib.py
+++ b/recipes/switchdev/TestLib.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Mellanox Technologies. All rights reserved.
+Copyright 2016-2017 Mellanox Technologies. All rights reserved.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
@@ -469,3 +469,22 @@ class TestLib:
err_msg = "got {} packets, expected {}".format(count, expected)
return self.custom(iface.get_host(), desc, err_msg)
+
+class Qdisc:
+ def __init__(self, iface, handle, qdisc):
+ self._ifname = iface.get_devname()
+ self._machine = iface.get_host()
+ self._handle = handle
+ self.run("tc qdisc add dev %s handle %x: %s"
+ % (self._ifname, self._handle, qdisc))
+
+ def filter_add(self, f):
+ self.run("tc filter add dev %s parent %x: %s"
+ % (self._ifname, self._handle, f))
+
+ def flush(self):
+ self.run("tc filter del dev %s parent %x:"
+ % (self._ifname, self._handle))
+
+ def run(self, command):
+ self._machine.run(command)
--
2.8.4
6 years, 4 months
[PATCH] test_modules/Netperf: fix regex for parsing RR threshold
by Jiri Prochazka
There is an extra dot in regex for parsing RR threshold value. This
patch removes it, so the parsing works now correctly.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
test_modules/Netperf.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 6cbd504..43dab42 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -337,8 +337,8 @@ class Netperf(TestGeneric):
threshold_unit_type = "bps"
elif (self._testname == "TCP_RR" or self._testname == "UDP_RR" or
self._testname == "SCTP_RR"):
- pattern_rr = "(\d*(\.\d*)?)\s*trans\.\/sec"
- r1 = re.search(pattern_rr, threshold.lower())
+ pattern_rr = "(\d*(\.\d*)?)\s*Trans\/sec"
+ r1 = re.search(pattern_rr, threshold)
if r1 is None:
res_data["msg"] = "Invalid unit type in the "\
"throughput option"
--
2.9.4
6 years, 4 months
[PATCH lnst 00/10] recipes: switchdev: Add more L3 recipes
by Yotam Gigi
Extend the switchdev layer 3 recipes to test ECMP routes, bridge port as
router ports and stressed L3 configuration.
Patch 1 and 7 add some functionality to the switchdev TestLib, needed for
the other recipes.
Patch 2 adds common logic for ECMP recipes, as they all share the same
topology and basic traffic testing functionality. Patches 3, 4 and 6 use
that common logic and add three different ECMP recipes.
Patch 5 add the get_routes functionality to the Controller's HostAPI. That
functionality is needed for some of the tests, mainly to validate that the
route got offloaded and the abort mechanism was not called.
Patch 8 add router stress recipe, that adds large amount of routes and
validates that traffic acts accordingly.
Patch 9, 10 adds recipe for vlan .1d/.1q bridge as router ports.
Yotam Gigi (10):
recipes: switchdev: TestLib: Make the pktgen dst_eth controllable
recipes: switchdev: Add ECMP common logic module
recipes: switchdev: Add recipe for basic ECMP topology
recipes: switchdev: Add recipe for ECMP with link down
HostAPI: Add get_routes function
recipes: switchdev: Add recipe for max ecmp size
recipes: switchdev: TestLib: Allow using destination range in pktgen
recipes: switchdev: Add recipe for stressed L3 routing
recipes: switchdev: Add recipe for .1q bridge as a rif
recipes: switchdev: Add recipe for .1d bridge as a rif
lnst/Controller/Machine.py | 4 +
lnst/Controller/Task.py | 3 +
lnst/Slave/NetTestSlave.py | 58 +++++++++++++
recipes/switchdev/TestLib.py | 7 +-
recipes/switchdev/ecmp_common.py | 107 +++++++++++++++++++++++
recipes/switchdev/l3-005-ecmp-basic.py | 59 +++++++++++++
recipes/switchdev/l3-005-ecmp-basic.xml | 33 ++++++++
recipes/switchdev/l3-006-ecmp-linkdown.py | 101 ++++++++++++++++++++++
recipes/switchdev/l3-006-ecmp-linkdown.xml | 33 ++++++++
recipes/switchdev/l3-007-ecmp-maxsize.py | 71 ++++++++++++++++
recipes/switchdev/l3-007-ecmp-maxsize.xml | 33 ++++++++
recipes/switchdev/l3-008-routes_stress.py | 132 +++++++++++++++++++++++++++++
recipes/switchdev/l3-008-routes_stress.xml | 24 ++++++
recipes/switchdev/l3-009-1q_bridge_rif.py | 104 +++++++++++++++++++++++
recipes/switchdev/l3-009-1q_bridge_rif.xml | 26 ++++++
recipes/switchdev/l3-010-1d_bridge_rif.py | 103 ++++++++++++++++++++++
recipes/switchdev/l3-010-1d_bridge_rif.xml | 26 ++++++
17 files changed, 922 insertions(+), 2 deletions(-)
create mode 100644 recipes/switchdev/ecmp_common.py
create mode 100644 recipes/switchdev/l3-005-ecmp-basic.py
create mode 100644 recipes/switchdev/l3-005-ecmp-basic.xml
create mode 100644 recipes/switchdev/l3-006-ecmp-linkdown.py
create mode 100644 recipes/switchdev/l3-006-ecmp-linkdown.xml
create mode 100644 recipes/switchdev/l3-007-ecmp-maxsize.py
create mode 100644 recipes/switchdev/l3-007-ecmp-maxsize.xml
create mode 100644 recipes/switchdev/l3-008-routes_stress.py
create mode 100644 recipes/switchdev/l3-008-routes_stress.xml
create mode 100644 recipes/switchdev/l3-009-1q_bridge_rif.py
create mode 100644 recipes/switchdev/l3-009-1q_bridge_rif.xml
create mode 100644 recipes/switchdev/l3-010-1d_bridge_rif.py
create mode 100644 recipes/switchdev/l3-010-1d_bridge_rif.xml
--
2.8.4
6 years, 4 months
[PATCH lnst v2] recipes: switchdev: Increase sleep time
by Yotam Gigi
Increase the sleep time needed for ports to become active to 30 seconds, as
15 seconds are not always enough.
Signed-off-by: Yotam Gigi <yotamg(a)mellanox.com>
---
recipes/switchdev/l2-000-minimal.py | 2 +-
recipes/switchdev/l2-001-bridge.py | 2 +-
recipes/switchdev/l2-002-bridge_fdb.py | 4 ++--
recipes/switchdev/l2-003-bridge_stp.py | 4 ++--
recipes/switchdev/l2-004-bridge_bond.py | 2 +-
recipes/switchdev/l2-005-bridge_bond_failover.py | 2 +-
recipes/switchdev/l2-006-bridge_team.py | 6 +++---
recipes/switchdev/l2-007-bridge_team_failover.py | 2 +-
recipes/switchdev/l2-008-bridge_vlan1q_sanity.py | 4 ++--
recipes/switchdev/l2-009-bridge_vlan1q.py | 2 +-
recipes/switchdev/l2-010-bridge_vlan1d_sanity.py | 4 ++--
recipes/switchdev/l2-011-bridge_vlan1d.py | 2 +-
recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py | 2 +-
recipes/switchdev/l2-013-bridge_bond_vlan1d.py | 2 +-
recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py | 2 +-
recipes/switchdev/l2-015-bridge_team_vlan1d.py | 6 +++---
recipes/switchdev/l2-017-bridge_fdb_vlan1d.py | 4 ++--
recipes/switchdev/l2-018-bridge_fdb_team.py | 10 +++++-----
recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py | 10 +++++-----
recipes/switchdev/l2-020-bridge_mdb.py | 2 +-
recipes/switchdev/l2-021-span.py | 2 +-
21 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/recipes/switchdev/l2-000-minimal.py b/recipes/switchdev/l2-000-minimal.py
index dcc9532..2b4dda7 100644
--- a/recipes/switchdev/l2-000-minimal.py
+++ b/recipes/switchdev/l2-000-minimal.py
@@ -21,7 +21,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
diff --git a/recipes/switchdev/l2-001-bridge.py b/recipes/switchdev/l2-001-bridge.py
index f92dae9..0b530b1 100644
--- a/recipes/switchdev/l2-001-bridge.py
+++ b/recipes/switchdev/l2-001-bridge.py
@@ -21,7 +21,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
diff --git a/recipes/switchdev/l2-002-bridge_fdb.py b/recipes/switchdev/l2-002-bridge_fdb.py
index af79a2f..ba34749 100644
--- a/recipes/switchdev/l2-002-bridge_fdb.py
+++ b/recipes/switchdev/l2-002-bridge_fdb.py
@@ -28,7 +28,7 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 1, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_if1, sw_if2], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
@@ -36,7 +36,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")
sw_if1.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)
diff --git a/recipes/switchdev/l2-003-bridge_stp.py b/recipes/switchdev/l2-003-bridge_stp.py
index 94bd6be..44e87e7 100644
--- a/recipes/switchdev/l2-003-bridge_stp.py
+++ b/recipes/switchdev/l2-003-bridge_stp.py
@@ -53,7 +53,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)
@@ -65,7 +65,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software")
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_if1, m1_if1.get_hwaddr(), 1, "hardware", False)
diff --git a/recipes/switchdev/l2-004-bridge_bond.py b/recipes/switchdev/l2-004-bridge_bond.py
index 8378bbd..9599760 100644
--- a/recipes/switchdev/l2-004-bridge_bond.py
+++ b/recipes/switchdev/l2-004-bridge_bond.py
@@ -27,7 +27,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-005-bridge_bond_failover.py b/recipes/switchdev/l2-005-bridge_bond_failover.py
index f5c7c63..f3e0b76 100644
--- a/recipes/switchdev/l2-005-bridge_bond_failover.py
+++ b/recipes/switchdev/l2-005-bridge_bond_failover.py
@@ -27,7 +27,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-006-bridge_team.py b/recipes/switchdev/l2-006-bridge_team.py
index 5366b39..a649e6f 100644
--- a/recipes/switchdev/l2-006-bridge_team.py
+++ b/recipes/switchdev/l2-006-bridge_team.py
@@ -34,7 +34,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br = sw.create_bridge(slaves=[sw_lag1, sw_lag2],
options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
@@ -50,7 +50,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.reset(ip=["192.168.102.10/24", "2003::1/64"])
m1_if1.reset(ip=["192.168.102.11/24", "2003::2/64"])
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1, m1_if1)
@@ -61,7 +61,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br.slave_add(sw_lag3.get_id())
m1_lag1.slave_add(m1_if1.get_id())
- sleep(15)
+ sleep(30)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-007-bridge_team_failover.py b/recipes/switchdev/l2-007-bridge_team_failover.py
index d3a8ee5..c89db02 100644
--- a/recipes/switchdev/l2-007-bridge_team_failover.py
+++ b/recipes/switchdev/l2-007-bridge_team_failover.py
@@ -33,7 +33,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_lag1, sw_lag2], options={"vlan_filtering": 1})
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py b/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py
index d415caf..0133df4 100644
--- a/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py
+++ b/recipes/switchdev/l2-008-bridge_vlan1q_sanity.py
@@ -52,7 +52,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.add_br_vlan(20)
sw_if2.add_br_vlan(20)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
@@ -95,7 +95,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br.slave_del(sw_if1.get_id())
sw_if1.reset(ip=test_ip(1, 3))
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1, m1_if1)
diff --git a/recipes/switchdev/l2-009-bridge_vlan1q.py b/recipes/switchdev/l2-009-bridge_vlan1q.py
index 7a982cd..5b8dea6 100644
--- a/recipes/switchdev/l2-009-bridge_vlan1q.py
+++ b/recipes/switchdev/l2-009-bridge_vlan1q.py
@@ -37,7 +37,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.add_br_vlan(20)
sw_if2.add_br_vlan(20)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
diff --git a/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py b/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py
index fc8be86..acc696b 100644
--- a/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py
+++ b/recipes/switchdev/l2-010-bridge_vlan1d_sanity.py
@@ -42,7 +42,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if2_21 = sw.create_vlan(sw_if2, 21)
sw.create_bridge(slaves=[sw_if1_20, sw_if2_21])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1, m2_if1)
@@ -53,7 +53,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_br.slave_del(sw_if1_10.get_id())
sw_if1_10.reset(ip=test_ip(2, 3))
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1_10, m1_if1_10)
diff --git a/recipes/switchdev/l2-011-bridge_vlan1d.py b/recipes/switchdev/l2-011-bridge_vlan1d.py
index b199332..f5e4cd1 100644
--- a/recipes/switchdev/l2-011-bridge_vlan1d.py
+++ b/recipes/switchdev/l2-011-bridge_vlan1d.py
@@ -40,7 +40,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if2_21 = sw.create_vlan(sw_if2, 21)
sw.create_bridge(slaves=[sw_if1_20, sw_if2_21])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
diff --git a/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py b/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py
index 1c3351d..a8d86ba 100644
--- a/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py
+++ b/recipes/switchdev/l2-012-bridge_bond_vlan1d_sanity.py
@@ -46,7 +46,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-013-bridge_bond_vlan1d.py b/recipes/switchdev/l2-013-bridge_bond_vlan1d.py
index e31fd7a..4e2b36a 100644
--- a/recipes/switchdev/l2-013-bridge_bond_vlan1d.py
+++ b/recipes/switchdev/l2-013-bridge_bond_vlan1d.py
@@ -44,7 +44,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
diff --git a/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py b/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py
index 51888eb..ba92d54 100644
--- a/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py
+++ b/recipes/switchdev/l2-014-bridge_team_vlan1d_sanity.py
@@ -46,7 +46,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-015-bridge_team_vlan1d.py b/recipes/switchdev/l2-015-bridge_team_vlan1d.py
index 3b9a6ec..473c712 100644
--- a/recipes/switchdev/l2-015-bridge_team_vlan1d.py
+++ b/recipes/switchdev/l2-015-bridge_team_vlan1d.py
@@ -44,7 +44,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_lag2_21 = sw.create_vlan(sw_lag2, 21)
sw_br3 = sw.create_bridge(slaves=[sw_lag1_20, sw_lag2_21])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
@@ -69,7 +69,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if1.reset(ip=test_ip(4, 1))
m1_if1.reset(ip=test_ip(4, 2))
- sleep(15)
+ sleep(30)
tl.ping_simple(sw_if1, m1_if1)
@@ -87,7 +87,7 @@ def do_task(ctl, hosts, ifaces, aliases):
m1_lag1.slave_add(m1_if1.get_id())
- sleep(15)
+ sleep(30)
tl.ping_simple(m1_lag1, m2_lag1)
tl.netperf_tcp(m1_lag1, m2_lag1)
diff --git a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py
index f5de674..1de39ec 100644
--- a/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py
+++ b/recipes/switchdev/l2-017-bridge_fdb_vlan1d.py
@@ -30,7 +30,7 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 0, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_if1_10, sw_if2_20], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_if1_10, m2_if1_20)
@@ -38,7 +38,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware")
sw_if1_10.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_if1_10, m1_if1_10.get_hwaddr(), 0, "hardware", False)
diff --git a/recipes/switchdev/l2-018-bridge_fdb_team.py b/recipes/switchdev/l2-018-bridge_fdb_team.py
index 41cac9a..38f910a 100644
--- a/recipes/switchdev/l2-018-bridge_fdb_team.py
+++ b/recipes/switchdev/l2-018-bridge_fdb_team.py
@@ -32,7 +32,7 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 1, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_lag1, sw_lag2], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1, m2_lag1)
@@ -40,7 +40,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
sw_lag1.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)
@@ -76,7 +76,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
sw_lag1.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)
@@ -105,7 +105,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
sw_lag1.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware", False)
@@ -117,7 +117,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "hardware")
- sleep(20)
+ sleep(30)
# Make sure static entry is not aged out.
tl.check_fdb(sw_lag1, m1_lag1.get_hwaddr(), 1, "software", False)
diff --git a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py
index 9a6a4a0..03b5bfe 100644
--- a/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py
+++ b/recipes/switchdev/l2-019-bridge_fdb_team_vlan1d.py
@@ -39,7 +39,7 @@ def do_task(ctl, hosts, ifaces, aliases):
br_options = {"vlan_filtering": 0, "ageing_time": 1000}
sw_br = sw.create_bridge(slaves = [sw_lag1_10, sw_lag2_20], options=br_options)
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.ping_simple(m1_lag1_10, m2_lag1_20)
@@ -47,7 +47,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
sw_lag1_10.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False)
@@ -83,7 +83,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
sw_lag1_10.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False)
@@ -112,7 +112,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
sw_lag1_10.set_br_learning(on=False, self=True)
- sleep(20)
+ sleep(30)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware", False)
@@ -124,7 +124,7 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "hardware")
- sleep(20)
+ sleep(30)
# Make sure static entry is not aged out.
tl.check_fdb(sw_lag1_10, m1_lag1_10.get_hwaddr(), 0, "software", False)
diff --git a/recipes/switchdev/l2-020-bridge_mdb.py b/recipes/switchdev/l2-020-bridge_mdb.py
index fdd85e8..04bcae9 100644
--- a/recipes/switchdev/l2-020-bridge_mdb.py
+++ b/recipes/switchdev/l2-020-bridge_mdb.py
@@ -29,7 +29,7 @@ def do_task(ctl, hosts, ifaces, aliases):
m2_if.set_addresses(["192.168.101.11/24", "2002::2/64"])
m3_if.set_addresses(["192.168.101.13/24", "2002::3/64"])
m4_if.set_addresses(["192.168.101.14/24", "2002::4/64"])
- sleep(15)
+ sleep(30)
tl = TestLib(ctl, aliases)
tl.iperf_mc(m1_if, [m2_if, m4_if], [m3_if], "239.255.1.3")
diff --git a/recipes/switchdev/l2-021-span.py b/recipes/switchdev/l2-021-span.py
index dfa0e99..92dea37 100644
--- a/recipes/switchdev/l2-021-span.py
+++ b/recipes/switchdev/l2-021-span.py
@@ -100,7 +100,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw.create_bridge(slaves=[sw_if1, sw_if2], options={"vlan_filtering": 1})
mirred_port = MirredPort(sw_if2)
- sleep(15)
+ sleep(30)
mirror_status = {"ingress": False, "egress": False }
for i in range(10):
--
2.8.4
6 years, 4 months
[PATCH] PerfRepoUtils: add support for RR test in perfrepo templates
by Jiri Prochazka
This patch adds test_type param to all PerfRepo template functions. When
this param is not specified, it is expected the test to be *_STREAM and
metric labels are throughput, throughput_deviation, etc. When the param
is set to RR, metric labels used are rr_rate, rr_rate_deviation, etc.
This is needed for the new short-lived connections test, where the unit
we measure is not throughput but request/response rate.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/PerfRepoUtils.py | 52 ++++++++++++++++++++++++++++------------
1 file changed, 37 insertions(+), 15 deletions(-)
diff --git a/lnst/Controller/PerfRepoUtils.py b/lnst/Controller/PerfRepoUtils.py
index 4c545e4..8d5a29d 100644
--- a/lnst/Controller/PerfRepoUtils.py
+++ b/lnst/Controller/PerfRepoUtils.py
@@ -14,7 +14,7 @@ olichtne(a)redhat.com (Ondrej Lichtner)
import logging
from lnst.Common.Utils import Noop
-def netperf_baseline_template(module, baseline):
+def netperf_baseline_template(module, baseline, test_type="STREAM"):
module.unset_option('threshold')
module.unset_option('threshold_deviation')
@@ -22,35 +22,51 @@ def netperf_baseline_template(module, baseline):
return module
try:
- throughput = baseline.get_value('throughput')
- deviation = baseline.get_value('throughput_deviation')
+ if test_type == "RR":
+ throughput = baseline.get_value('rr_rate')
+ deviation = baseline.get_value('rr_rate_deviation')
+ else:
+ throughput = baseline.get_value('throughput')
+ deviation = baseline.get_value('throughput_deviation')
except:
logging.error("Invalid baseline TestExecution passed.")
return module
logging.debug("Setting Netperf threshold.")
if throughput is not None and deviation is not None:
- module.update_options({'threshold': '%s bits/sec' % throughput,
- 'threshold_deviation': '%s bits/sec' % deviation})
+ if test_type == "RR":
+ module.update_options({'threshold': '%s Trans/sec' % throughput,
+ 'threshold_deviation': '%s Trans/sec' % deviation})
+ else:
+ module.update_options({'threshold': '%s bits/sec' % throughput,
+ 'threshold_deviation': '%s bits/sec' % deviation})
return module
-def perfrepo_baseline_to_dict(baseline):
+def perfrepo_baseline_to_dict(baseline, test_type="STREAM"):
if baseline.get_texec() is None:
return {}
try:
- throughput = baseline.get_value('throughput')
- deviation = baseline.get_value('throughput_deviation')
+ if test_type == "RR":
+ throughput = baseline.get_value('rr_rate')
+ deviation = baseline.get_value('rr_rate_deviation')
+ else:
+ throughput = baseline.get_value('throughput')
+ deviation = baseline.get_value('throughput_deviation')
except:
logging.error("Invalid baseline TestExecution passed.")
return {}
if throughput is not None and deviation is not None:
- return {'threshold': '%s bits/sec' % throughput,
- 'threshold_deviation': '%s bits/sec' % deviation}
+ if test_type == "RR":
+ return {'threshold': '%s Trans/sec' % throughput,
+ 'threshold_deviation': '%s Trans/sec' % deviation}
+ else:
+ return {'threshold': '%s bits/sec' % throughput,
+ 'threshold_deviation': '%s bits/sec' % deviation}
return {}
-def netperf_result_template(perfrepo_result, netperf_result):
+def netperf_result_template(perfrepo_result, netperf_result, test_type="STREAM"):
if isinstance(perfrepo_result, Noop):
return perfrepo_result
@@ -64,9 +80,15 @@ def netperf_result_template(perfrepo_result, netperf_result):
return perfrepo_result
logging.debug("Adding Netperf results to PerfRepo object.")
- perfrepo_result.add_value('throughput', rate)
- perfrepo_result.add_value('throughput_min', rate - deviation)
- perfrepo_result.add_value('throughput_max', rate + deviation)
- perfrepo_result.add_value('throughput_deviation', deviation)
+ if test_type == "RR":
+ perfrepo_result.add_value('rr_rate', rate)
+ perfrepo_result.add_value('rr_rate_min', rate - deviation)
+ perfrepo_result.add_value('rr_rate_max', rate + deviation)
+ perfrepo_result.add_value('rr_rate_deviation', deviation)
+ else:
+ perfrepo_result.add_value('throughput', rate)
+ perfrepo_result.add_value('throughput_min', rate - deviation)
+ perfrepo_result.add_value('throughput_max', rate + deviation)
+ perfrepo_result.add_value('throughput_deviation', deviation)
return perfrepo_result
--
2.9.4
6 years, 4 months
[PATCH] recipes: add ovs hw offload test with tunnel ip assigned to bridge
by Roi Dayan
The vxlan tunnel ip is assigned to a bridge and the uplink is added as
a port of that bridge.
Signed-off-by: Roi Dayan <roid(a)mellanox.com>
---
.../ovs_offload/1_virt_ovs_vxlan_stacked.README | 40 ++++++++++
recipes/ovs_offload/1_virt_ovs_vxlan_stacked.xml | 86 ++++++++++++++++++++++
2 files changed, 126 insertions(+)
create mode 100644 recipes/ovs_offload/1_virt_ovs_vxlan_stacked.README
create mode 100644 recipes/ovs_offload/1_virt_ovs_vxlan_stacked.xml
diff --git a/recipes/ovs_offload/1_virt_ovs_vxlan_stacked.README b/recipes/ovs_offload/1_virt_ovs_vxlan_stacked.README
new file mode 100644
index 0000000..921f804
--- /dev/null
+++ b/recipes/ovs_offload/1_virt_ovs_vxlan_stacked.README
@@ -0,0 +1,40 @@
+Topology:
+
+ switch
+ +--------+
+ | |
+ +--------------------+ +----------------------+
+ | | | |
+ | | | |
+ | | | |
+ | +--------+ |
+ | |
+ | |
+ +--+--+ +--+--+
++---------+ eth +--------+ +---------+ eth +--------+
+| +-----+ | | +-----+ |
+| | | |
+| +-------------------------------------------------+ |
+| | | | | |
+| +-------+ +--+------+ | | +----------+---------+ |
+| | | | | | | | vxlan | |
+| |br-int | |br-pys | | | | | |
+| | | | | | | | ovs_bridge | |
+| |tun_id | | | | | | | |
+| | 100 | | +----+ | | | | +----+ | |
+| +--+----+ +-+int0+--+ | | +-------+int0+-------+ |
+| | +----+ | | +----+ |
+| | host1 | | |
+| | | | host2 |
+| +-+-+ | | |
++--+tap+-----------------+ +------------------------+
+ +-+-+
+ |
+ +-+-+
++--+eth+--+
+| +---+ |
+| |
+| guest1 |
+| |
++---------+
+
diff --git a/recipes/ovs_offload/1_virt_ovs_vxlan_stacked.xml b/recipes/ovs_offload/1_virt_ovs_vxlan_stacked.xml
new file mode 100644
index 0000000..53d71b4
--- /dev/null
+++ b/recipes/ovs_offload/1_virt_ovs_vxlan_stacked.xml
@@ -0,0 +1,86 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="mtu" value="1450" />
+ <alias name="net" value="77.77.77"/>
+ <alias name="vxlan_net" value="1.1.1"/>
+ <alias name="vxlan_net6" value="fc00:0:0:0"/>
+ <alias name="vxlan_key" value="100"/>
+ <alias name="vxlan_port" value="4789"/>
+ </define>
+ <network>
+ <host id="h1">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ <param name="order" value="1"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="n1">
+ </eth>
+ <eth id="tap1" label="to_guest1"/>
+ <ovs_bridge id="br-pys">
+ <addresses>
+ <address value="{$net}.1/24"/>
+ </addresses>
+ <slaves>
+ <slave id="if1"></slave>
+ </slaves>
+ </ovs_bridge>
+ <ovs_bridge id="br-int">
+ <slaves>
+ <slave id="tap1"></slave>
+ </slaves>
+ <tunnel id="vxlan1" type="vxlan">
+ <options>
+ <option name="option:remote_ip" value="{$net}.2"/>
+ <option name="option:key" value="{$vxlan_key}"/>
+ <option name="option:dst_port" value="{$vxlan_port}"/>
+ </options>
+ </tunnel>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ <host id="test_host1">
+ <interfaces>
+ <eth id="if1" label="to_guest1">
+ <addresses>
+ <address value="{$vxlan_net}.1/24"/>
+ <address value="{$vxlan_net6}::1/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="h2">
+ <params>
+ <param name="machine_type" value="baremetal"/>
+ </params>
+ <interfaces>
+ <eth id="if1" label="n1">
+ <addresses>
+ <address value="{$net}.2/24"/>
+ </addresses>
+ </eth>
+ <ovs_bridge id="ovs2">
+ <internal id="int0">
+ <options>
+ <option name="name" value="int0"/>
+ </options>
+ <addresses>
+ <address value="{$vxlan_net}.2/24"/>
+ <address value="{$vxlan_net6}::2/24"/>
+ </addresses>
+ </internal>
+ <tunnel id="vxlan1" type="vxlan">
+ <options>
+ <option name="option:remote_ip" value="{$net}.1"/>
+ <option name="option:key" value="{$vxlan_key}"/>
+ <option name="option:dst_port" value="{$vxlan_port}"/>
+ </options>
+ </tunnel>
+ </ovs_bridge>
+ </interfaces>
+ </host>
+ </network>
+
+ <task python="1_virt_ovs_vxlan.py"/>
+</lnstrecipe>
--
2.7.4
6 years, 4 months