[PATCH-next 0/3] Test set completeness patch set No 1
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
Hi,
this patchset is the first in a potential series relating to the complete recipe set.
It handles issues popped up after python2->3 move, reduces code repetition in recipes
and addresses generic recipe bugs.
Christos
Christos Sfakianakis (3):
lnst.{Recipes.ENRT,Tests}: fixes with respect to python 3 switch
lnst.{Recipes.ENRT,RecipeCommon}: remove unnecessary code, fix typos,
names, logical errors, mtu setters
lnst.Recipes.ENRT: reduce code repetition
.../Perf/Measurements/IperfFlowMeasurement.py | 4 +-
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 6 +-
lnst/Recipes/ENRT/BondRecipe.py | 28 ++++----
lnst/Recipes/ENRT/DoubleBondRecipe.py | 28 ++++----
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 47 +++++--------
lnst/Recipes/ENRT/IpsecEspAeadRecipe.py | 11 +--
lnst/Recipes/ENRT/IpsecEspAhCompRecipe.py | 17 ++---
lnst/Recipes/ENRT/NoVirtOvsVxlanRecipe.py | 14 ++--
lnst/Recipes/ENRT/PingFloodRecipe.py | 11 +--
.../ENRT/ShortLivedConnectionsRecipe.py | 11 +--
lnst/Recipes/ENRT/SimpleMacsecRecipe.py | 7 +-
lnst/Recipes/ENRT/SimplePerfRecipe.py | 12 ++--
lnst/Recipes/ENRT/TeamRecipe.py | 21 +++---
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 36 ++++------
lnst/Recipes/ENRT/VirtOvsVxlanRecipe.py | 13 ++--
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 52 ++++++--------
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 35 ++++------
.../VirtualBridgeVlanInHostMirroredRecipe.py | 43 +++++-------
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 26 +++----
.../ENRT/VirtualBridgeVlansOverBondRecipe.py | 34 +++-------
...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 62 ++++++-----------
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 34 ++++------
...irtualOvsBridgeVlanInHostMirroredRecipe.py | 43 +++++-------
.../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 26 +++----
.../VirtualOvsBridgeVlansOverBondRecipe.py | 67 +++++--------------
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 30 ++++-----
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 21 ++----
lnst/Recipes/ENRT/VlansRecipe.py | 12 ++--
lnst/Recipes/ENRT/VxlanMulticastRecipe.py | 26 +++----
lnst/Recipes/ENRT/VxlanRemoteRecipe.py | 11 ++-
lnst/Recipes/ENRT/XfrmTools.py | 4 +-
lnst/Tests/PacketAssert.py | 4 +-
32 files changed, 286 insertions(+), 510 deletions(-)
--
2.17.1
4 years, 10 months
[PATCH-next v2 0/1] Differentiate between physical, soft and virtual devices
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
Hi,
this is version 2 of the patch. The difference with respect to the
first version is the transfer of the cover letter's use case description
into the commit's message.
Christos
Christos Sfakianakis (1):
lnst.Devices.Device: customize instance checks to support
categorization
lnst/Devices/Device.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.17.1
4 years, 10 months
[PATCH-next 00/15] log improvements
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Hi all,
this patch series starts my effort to improve the logs as provided to
the tester. This patchset is centered at removing the need of the tester
to use debug=1 logging and still know what's happening wrt. the recipe
he's trying to run.
This means a significant reduction of logs on the Controller side which
in my personal opinion improves usability quite a bit.
Next I want to focus on improving the BaseEnrtRecipe hierarchy and
include capabilities that provide some additional context as to what
stage the test execution is at.
-Ondrej
Ondrej Lichtner (15):
lnst.Common.ExecCmd: fix cmd not being part of the exception
description
add __repr__ and __str__ implementations of several objects
lnst.Controller.RecipeResults: remove useless property redefines
lnst.Controller.RecipeResults: add success setter
lnst.Controller.Machine: ensure Job{Start, Finish}Result ordering
lnst.Devices.RemoteDevice: add _id property
lnst.Controller.RecipeResults: add DeviceConfigResult.* classes
lnst.Controller.Machine: add stop_recipe
lnst.Controller.RunSummaryFormatter: change default source string
lnst.Controller.Job: add a 'type' property
lnst.Controller.Job: __str__ method format of _what description
lnst.Controller.Machine: add device manipulation methods
lnst.RecipeCommon.Perf: add flow information to string reports
adjust logging levels
lnst.Controller.Recipe: log results as they're added
lnst/Common/ExecCmd.py | 3 +-
lnst/Common/IpAddress.py | 3 +
lnst/Controller/Controller.py | 1 +
lnst/Controller/Host.py | 1 +
lnst/Controller/Job.py | 35 ++---
lnst/Controller/Machine.py | 74 ++++++++--
lnst/Controller/Namespace.py | 10 +-
lnst/Controller/Recipe.py | 15 ++
lnst/Controller/RecipeResults.py | 134 ++++++++++++++++--
lnst/Controller/RunSummaryFormatter.py | 6 +-
lnst/Devices/RemoteDevice.py | 41 ++++--
.../BaselineFlowAverageEvaluator.py | 3 +-
.../Perf/Evaluators/NonzeroFlowEvaluator.py | 5 +-
.../Perf/Measurements/BaseFlowMeasurement.py | 28 ++++
.../Perf/Measurements/BaseMeasurement.py | 6 +
.../Perf/Measurements/StatCPUMeasurement.py | 9 +-
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 22 ++-
lnst/Slave/Job.py | 2 +-
lnst/Tests/BaseTestModule.py | 12 ++
19 files changed, 348 insertions(+), 62 deletions(-)
--
2.21.0
4 years, 10 months
[PATCH-next 1/3] lnst.Common.ExecCmd: decode std{out, err} immediately
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Instead of returning bytes, just decode the data immediately so that it
can be worked with as before - strings.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/ExecCmd.py | 6 ++++--
lnst/Common/GitVersion.py | 2 +-
lnst/Common/Version.py | 2 +-
lnst/Devices/Device.py | 7 +++----
lnst/Slave/InterfaceManager.py | 1 -
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lnst/Common/ExecCmd.py b/lnst/Common/ExecCmd.py
index dff5b16..007acbd 100644
--- a/lnst/Common/ExecCmd.py
+++ b/lnst/Common/ExecCmd.py
@@ -58,6 +58,8 @@ def exec_cmd(cmd, die_on_err=True, log_outputs=True, report_stderr=False, json=F
subp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True)
(data_stdout, data_stderr) = subp.communicate()
+ data_stdout = data_stdout.decode()
+ data_stderr = data_stderr.decode()
'''
When we should not die on error, do not print anything and let
@@ -65,9 +67,9 @@ def exec_cmd(cmd, die_on_err=True, log_outputs=True, report_stderr=False, json=F
'''
if log_outputs:
if data_stdout:
- log_output(logging.debug, "Stdout", data_stdout.decode())
+ log_output(logging.debug, "Stdout", data_stdout)
if data_stderr:
- log_output(logging.debug, "Stderr", data_stderr.decode())
+ log_output(logging.debug, "Stderr", data_stderr)
if subp.returncode and die_on_err:
err = ExecCmdFail(cmd, subp.returncode, [data_stdout, data_stderr], report_stderr)
logging.error(err)
diff --git a/lnst/Common/GitVersion.py b/lnst/Common/GitVersion.py
index fe088a2..6de3c1e 100644
--- a/lnst/Common/GitVersion.py
+++ b/lnst/Common/GitVersion.py
@@ -30,6 +30,6 @@ def git_version():
cmd = ['git', 'rev-parse', 'HEAD']
try:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=null)
- return proc.communicate()[0].strip()
+ return proc.communicate()[0].decode().strip()
finally:
os.chdir(cwd)
diff --git a/lnst/Common/Version.py b/lnst/Common/Version.py
index b6a2bc6..c7bacfd 100644
--- a/lnst/Common/Version.py
+++ b/lnst/Common/Version.py
@@ -21,7 +21,7 @@ def __init__(self):
self._version = "14"
if git_version:
- self._version += "-" + git_version().decode()
+ self._version += "-" + git_version()
@property
def version(self):
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py
index 66ed7fc..30deb25 100644
--- a/lnst/Devices/Device.py
+++ b/lnst/Devices/Device.py
@@ -232,18 +232,18 @@ def _vars(self):
def _clear_tc_qdisc(self):
exec_cmd("tc qdisc del dev %s root" % self.name, die_on_err=False)
out, _ = exec_cmd("tc filter show dev %s" % self.name)
- ingress_handles = re.findall("ingress (\\d+):", out.decode())
+ ingress_handles = re.findall("ingress (\\d+):", out)
for ingress_handle in ingress_handles:
exec_cmd("tc qdisc del dev %s handle %s: ingress" %
(self.name, ingress_handle))
out, _ = exec_cmd("tc qdisc show dev %s" % self.name)
- ingress_qdiscs = re.findall("qdisc ingress (\\w+):", out.decode())
+ ingress_qdiscs = re.findall("qdisc ingress (\\w+):", out)
if len(ingress_qdiscs) != 0:
exec_cmd("tc qdisc del dev %s ingress" % self.name)
def _clear_tc_filters(self):
out, _ = exec_cmd("tc filter show dev %s" % self.name)
- egress_prefs = re.findall("pref (\\d+) .* handle", out.decode())
+ egress_prefs = re.findall("pref (\\d+) .* handle", out)
for egress_pref in egress_prefs:
exec_cmd("tc filter del dev %s pref %s" % (self.name, egress_pref))
@@ -631,7 +631,6 @@ def autoneg_off(self):
def _read_adaptive_coalescing(self):
try:
res = exec_cmd("ethtool -c %s" % self.name)
- res = res.decode()
except:
logging.debug("Could not read coalescence values of %s." % self.name)
return (None, None)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index 7411a73..62f9222 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -261,7 +261,6 @@ def _is_name_used(self, name):
out, _ = exec_cmd("ovs-vsctl --columns=name list Interface",
log_outputs=False, die_on_err=False)
- out = out.decode()
for line in out.split("\n"):
m = re.match(r'.*: \"(.*)\"', line)
if m is not None:
--
2.21.0
4 years, 10 months
[PATCH-next 0/1] Differentiate between physical, soft and virtual devices
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
Hi,
this patch allows the tester to check the remote type of of a device
used in a test. In particular, it checks if a device is a generic
device, a software device or a virtual device. A use case follows.
==============================================================
Controller
==============================================================
from lnst.Devices import VlanDevice
from lnst.Devices.Device import Device as Dev
from lnst.Devices.VlanDevice import VlanDevice as VlanDev
from lnst.Devices.BridgeDevice import BridgeDevice as BridgeDev
from lnst.Devices.SoftDevice import SoftDevice as SoftDev
from lnst.Devices.VirtualDevice import VirtualDevice as VirtDev
...
host1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
host1.vlan0 = VlanDevice(realdev=host1.eth0, vlan_id=10)
x = host1.vlan0
# Class hierarchy: Device >> SoftDevice >> VlanDevice
# Device >> SoftDevice >> MasterDevice >> BridgeDevice
# Before | After
-------------------
isinstance(x, Dev) # True | True
isinstance(x, SoftDev) # False | True
isinstance(x, VlanDev) # False | True
isinstance(x, BridgeDev) # False | False
isinstance(host1.eth0, VirtDev) # True | True
isinstance(x, VirtDev) # False | False
|
======================================================|=======
Slave |
======================================================|=======
isinstance(dev, Dev) # True | True
isinstance(dev, SoftDev) # True | True
isinstance(dev, VlanDev) # True | True
isinstance(dev, BridgeDev) # False | False
The result on the slave hasn't changed. The result on the controller
is now in agreement with that on the slave.
Christos
Christos Sfakianakis (1):
lnst.Devices.Device: customize instance checks
lnst/Devices/Device.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.17.1
4 years, 10 months