[PATCH 0/4] minor bug-fixes and improvements
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
This patchset is just a collection of not really related fixes and
improvements that serve as preparation for a larger patchset targeting
perf result evaluation code.
Sending this now so others can base their code on these fixes since I've
had them for a while...
-Ondrej
Ondrej Lichtner (4):
lnst.Controller.RunSummaryFormatter: add colourize parameter
RecipeCommon.Perf.Measurements.BaseCPUMeasurement: adjust base
evaluation method
RecipeCommon.Perf.Measurements.BaseFlowMeasurement: modify evaluation
result
lnst.Tests.Iperf: don't fail on stderr messages
lnst/Controller/RunSummaryFormatter.py | 11 ++++++++---
.../Perf/Measurements/BaseCPUMeasurement.py | 9 ++++++---
.../Perf/Measurements/BaseFlowMeasurement.py | 11 +----------
lnst/Tests/Iperf.py | 1 -
4 files changed, 15 insertions(+), 17 deletions(-)
--
2.21.0
5 years
[PATCH-next 0/2] Handle coalescence tuning
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
This patch set inlcudes modifications in the Device module and in some
ENRT recipes that hanlde adaptive coalescence.
In the Device module, methods are added to read, modify and verify the
coalescence settings of a target device.
In the ENRT recipes, the necessary calls are added into both
configuration and deconfiguration phase in case coalescence needs to be
disabled. This is in agreement with old phase1/2 recipes.
Due to the fact that the target devices are ethernet and we currenlty
cannot filter them out of 2 arbitrary perf configuration endpoints,
it was not possible to apply the calls in BaseEnrtRecipe.
Christos Sfakianakis (2):
lnst.Devices.Device: handle coalesce
lnst.Recipes.ENRT: use coalesce tuning
lnst/Devices/Device.py | 47 ++++++++++++++++++++++++
lnst/Recipes/ENRT/BondRecipe.py | 8 ++++
lnst/Recipes/ENRT/DoubleBondRecipe.py | 10 +++++
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 10 +++++
lnst/Recipes/ENRT/SimplePerfRecipe.py | 8 ++++
lnst/Recipes/ENRT/TeamRecipe.py | 8 ++++
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 10 +++++
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 8 ++++
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 8 ++++
lnst/Recipes/ENRT/VlansRecipe.py | 8 ++++
10 files changed, 125 insertions(+)
--
2.17.1
5 years
[PATCH-next 0/2] Perf from both sides
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
This patch set enables perf tests to be done from both sides.
The main reason for this is that this feature is used in 8
cases from phase 2:
- active_backup_team
- round_robin_team
- active_backup_double_team
- round_robin_double_team
- acive_backup_team_vs_active_backup_bond
- acive_backup_team_vs_round_robin_bond
- round_robin_team_vs_active_backup_bond
- round_robin_team_vs_round_robin_bond
A suitable parameter is added in BaseEnrtRecipe as well as
in TeamRecipe, TeamVsBondRecipe, DoubleTeamRecipe files.
In the old recipes, all perf tests from one side are completed before
client/server roles are inverted. In the current patch, that order is
not preserved (this should not affect the results).
Christos Sfakianakis (2):
lnst.Recipes.ENRT: edit BaseEnrtRecipe
lnst.Recipes.ENRT: enable bidirectional perfs
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 44 +++++++++++++++------------
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 +-
lnst/Recipes/ENRT/TeamRecipe.py | 3 +-
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 +-
4 files changed, 31 insertions(+), 22 deletions(-)
--
2.17.1
5 years
[PATCH-next] lnst.Recipes.ENRT: fix syntax errors and offloads
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
Correct last offload combination in VirtualBridgeVlansOverBondRecipe,
set 'tx' to 'off'. Fix missing colon error in TeamRecipe and
TeamVsBondRecipe.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/TeamRecipe.py | 2 +-
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 2 +-
lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index 10546e6..6b95ccd 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -70,6 +70,6 @@ class TeamRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- if self.params.dev_intr_cpu
+ if self.params.dev_intr_cpu:
for m in [m1, m2]:
m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
index 6db2ace..dfec20e 100644
--- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
+++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
@@ -83,6 +83,6 @@ class TeamVsBondRecipe(BaseEnrtRecipe):
m1, m2 = self.matched.m1, self.matched.m2
#TODO better service handling through HostAPI
- if self.params.dev_intr_cpu
+ if self.params.dev_intr_cpu:
for m in [m1, m2]:
m.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
index 8918229..feb4f08 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
@@ -40,7 +40,7 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
dict(gro="on", gso="on", tso="on", tx="on"),
dict(gro="off", gso="on", tso="on", tx="on"),
dict(gro="on", gso="off", tso="off", tx="on"),
- dict(gro="on", gso="on", tso="off", tx="on")))
+ dict(gro="on", gso="on", tso="off", tx="off")))
bonding_mode = StrParam(mandatory=True)
miimon_value = IntParam(mandatory=True)
--
2.17.1
5 years
[PATCH-next 0/1] Pinning the perf tool to a specific cpu
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
This patch tries to handle the pinning of the perf tool to a specific
CPU per the old recipes. As some options differ between Netperf and
Iperf3 tools, the correspondence cannot be precise. E.g the -J option
of Iperf3 tool for JSON output effectively masks an "-f k" option
to fomrat the output in kilobytes, wchich is the default in the old
scheme.
Christos Sfakianakis (1):
lnst.Recipes.ENRT: edit perf pinnings in Recipes
.../Perf/Measurements/BaseFlowMeasurement.py | 7 ++++-
.../Perf/Measurements/IperfFlowMeasurement.py | 8 +++++-
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 6 ++++-
lnst/Recipes/ENRT/BondRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/DoubleBondRecipe.py | 15 ++++++-----
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 15 ++++++-----
lnst/Recipes/ENRT/SimplePerfRecipe.py | 14 +++++-----
lnst/Recipes/ENRT/TeamRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 15 ++++++-----
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 19 +++++++-------
.../VirtualBridgeVlanInHostMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 19 +++++++-------
.../ENRT/VirtualBridgeVlansOverBondRecipe.py | 18 ++++++++-----
...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 19 +++++++-------
...irtualOvsBridgeVlanInHostMirroredRecipe.py | 21 +++++++--------
.../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 19 +++++++-------
.../VirtualOvsBridgeVlansOverBondRecipe.py | 26 ++++++++-----------
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 13 +++++-----
lnst/Recipes/ENRT/VlansRecipe.py | 14 +++++-----
22 files changed, 186 insertions(+), 164 deletions(-)
--
2.17.1
5 years
[PATCH-next] lnst.Recipes.ENRT: adjust mtu checks
by csfakian@redhat.com
From: Christos Sfakianakis <csfakian(a)redhat.com>
Adjust mtu checks in recipes so that they follow the old
scheme precisely.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 2 +-
.../ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py | 6 ++++++
lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py | 5 ++++-
.../ENRT/VirtualBridgeVlanInHostMirroredRecipe.py | 6 ++++++
lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py | 4 ++++
.../Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py | 12 +++++++++++-
.../VirtualOvsBridgeVlanInGuestMirroredRecipe.py | 6 ++++++
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 4 ++++
.../ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py | 4 ++++
.../Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 3 +++
.../ENRT/VirtualOvsBridgeVlansOverBondRecipe.py | 8 ++++++++
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 4 ++++
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 1 +
lnst/Recipes/ENRT/VlansRecipe.py | 4 ++++
14 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
index 597579b..fe39d13 100644
--- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
+++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
@@ -53,7 +53,7 @@ class TeamVsBondRecipe(BaseEnrtRecipe):
if "mtu" in self.params:
m1.team.mtu = self.params.mtu
- m2.team.mtu = self.params.mtu
+ m2.bond.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
index 84fb0ea..2fd74ae 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
@@ -59,8 +59,14 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest2.vlan1
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
+ host2.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
+ guest1.eth0.mtu = self.params.mtu
+ guest2.eth0.mtu = self.params.mtu
guest1.vlan1.mtu = self.params.mtu
guest2.vlan1.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
index e78d420..8bb7582 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
@@ -49,9 +49,12 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
configuration.endpoint2 = host2.vlan1
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
- host2.vlan1.mtu = self.params.mtu
+ guest1.eth0.mtu = self.params.mtu
guest1.vlan1.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
index f1c42e6..1a7c4d0 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
@@ -57,7 +57,13 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest2.eth0
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
+ host1.vlan1.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
+ host2.tap0.mtu = self.params.mtu
+ host2.vlan1.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
index 466a2a2..2a2f905 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
@@ -47,7 +47,11 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
configuration.endpoint2 = host2.vlan1
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
+ host1.vlan1.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
host2.vlan1.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
index 162e3c1..e5d0b9b 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
@@ -74,10 +74,20 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest3.eth0
if "mtu" in self.params:
+ host1.bond.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
+ host1.tap1.mtu = self.params.mtu
+ host1.vlan1.mtu = self.params.mtu
+ host1.vlan2.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host1.br1.mtu = self.params.mtu
+ host2.bond.mtu = self.params.mtu
+ host2.tap0.mtu = self.params.mtu
+ host2.tap1.mtu = self.params.mtu
+ host2.vlan1.mtu = self.params.mtu
+ host2.vlan2.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
- host1.br1.mtu = self.params.mtu
+ host2.br1.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
guest3.eth0.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
index c77e03a..f0041fc 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
@@ -64,9 +64,15 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest2.vlan1
if "mtu" in self.params:
+ host1.eth1.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth1.mtu = self.params.mtu
+ host2.tap0.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
+ guest1.eth0.mtu = self.params.mtu
guest1.vlan1.mtu = self.params.mtu
+ guest2.eth0.mtu = self.params.mtu
guest2.vlan1.mtu = self.params.mtu
net_addr_1 = "192.168.10"
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
index a681355..df44ae2 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
@@ -49,8 +49,12 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
configuration.endpoint2 = host2.vlan1
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
host2.vlan1.mtu = self.params.mtu
+ guest1.eth0.mtu = self.params.mtu
guest1.vlan1.mtu = self.params.mtu
net_addr_1 = "192.168.10"
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
index 7b640b8..58d2a9b 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
@@ -58,7 +58,11 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest2.eth0
if "mtu" in self.params:
+ host1.eth1.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth1.mtu = self.params.mtu
+ host2.tap0.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
index 9b3dd10..64830bd 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
@@ -48,7 +48,10 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest1.eth0
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
host2.vlan1.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
index 7595dbf..c9c5413 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
@@ -86,7 +86,15 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest3.eth0
if "mtu" in self.params:
+ host1.eth1.mtu = self.params.mtu
+ host1.eth2.mtu = self.params.mtu
+ host1.tap0.mtu = self.params.mtu
+ host1.tap1.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth1.mtu = self.params.mtu
+ host2.eth2.mtu = self.params.mtu
+ host2.tap0.mtu = self.params.mtu
+ host2.tap1.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 9104423..2720bcf 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -50,6 +50,10 @@ class VlansOverBondRecipe(BaseEnrtRecipe):
if "mtu" in self.params:
m1.bond.mtu = self.params.mtu
m2.eth0.mtu = self.params.mtu
+ m1.vlan1.mtu = self.params.mtu
+ m1.vlan2.mtu = self.params.mtu
+ m2.vlan1.mtu = self.params.mtu
+ m2.vlan2.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
index 2e929b8..0e93d31 100644
--- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
@@ -52,6 +52,7 @@ class VlansOverTeamRecipe(BaseEnrtRecipe):
m.vlan1.mtu = self.params.mtu
m.vlan2.mtu = self.params.mtu
m1.team.mtu = self.params.mtu
+ m2.eth1.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index 96e5933..3eab6de 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -42,6 +42,10 @@ class VlansRecipe(BaseEnrtRecipe):
if "mtu" in self.params:
m1.eth0.mtu = self.params.mtu
m2.eth0.mtu = self.params.mtu
+ m1.vlan1.mtu = self.params.mtu
+ m1.vlan2.mtu = self.params.mtu
+ m2.vlan1.mtu = self.params.mtu
+ m2.vlan2.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
--
2.17.1
5 years
[PATCH-master-py3 v2] recipes: ipsec_esp_ah_comp type conversion
by jurbanov@redhat.com
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
recipes/regression_tests/phase3/ipsec_esp_ah_comp.py
=============================================
division in py3 by default returns float, however,
key is expecting an integer. Casting float to int
Signed-off-by: Jozef Urbanovsky <jurbanov(a)redhat.com>
---
recipes/regression_tests/phase3/ipsec_esp_ah_comp.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recipes/regression_tests/phase3/ipsec_esp_ah_comp.py b/recipes/regression_tests/phase3/ipsec_esp_ah_comp.py
index cde0cf7..05ceb0f 100644
--- a/recipes/regression_tests/phase3/ipsec_esp_ah_comp.py
+++ b/recipes/regression_tests/phase3/ipsec_esp_ah_comp.py
@@ -16,7 +16,7 @@ ciphers = []
#lenth param is in bits
def generate_key(length):
key = "0x"
- key = key + (length/8) * "0b"
+ key = key + int(length/8) * "0b"
return key
ciphers.append(('aes', 128))
--
2.20.1
5 years
[PATCH-master-py3 v2] Python2 to Python3 conversion fixes
by jurbanov@redhat.com
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
lnst/Common/Daemon.py
===================================
Issue#191 - daemonize doesn't work with py3
- Replaces file method with open method instead
lnst/Controller/SlavePool.py
===================================
Unable to match specific test cases
- Deleted iter from sorted list, as iterator object not needed
lnst/Controller/Task.py
===================================
Hash creation was unsuccessful due to type mismatch
- hashlib.sha1 is expecting str, instead of unicode object
- Changed encoding to utf-8 str
lnst/Slave/NetTestSlave.py
===================================
Top-level exception was thrown instead of specific one, could catch
exception, that wasn't meant for Slave process
- Created specific SystemCallException
- Throwing and expecting SystemCallException instead of general one
recipes/regression_tests/phase3/ipsec_esp_aead.py
===================================
Type mismatch
- py3 divison is float by default, added explicit conversion to int
test_modules/Netperf.py
===================================
Unable to interrupt netperf server instance
- Created new InterruptException
- Created new method wait_for_interrupt to catch sigint, instead
of waiting for exception, that's no longer thrown with PEP 475
- py3 divison is float by default, added explicit conversion to int
Signed-off-by: Jozef Urbanovsky <jurbanov(a)redhat.com>
---
lnst/Common/Daemon.py | 10 +++----
lnst/Controller/SlavePool.py | 4 +--
lnst/Controller/Task.py | 8 ++---
lnst/Slave/NetTestSlave.py | 9 ++++--
.../regression_tests/phase3/ipsec_esp_aead.py | 2 +-
test_modules/Netperf.py | 29 +++++++++++++++----
6 files changed, 42 insertions(+), 20 deletions(-)
diff --git a/lnst/Common/Daemon.py b/lnst/Common/Daemon.py
index 6fbf950..23bb77e 100644
--- a/lnst/Common/Daemon.py
+++ b/lnst/Common/Daemon.py
@@ -25,7 +25,7 @@ class Daemon:
def _read_pid(self):
try:
- handle = file(self._pidfile, "r")
+ handle = open(self._pidfile, "r")
pid = int(handle.read().strip())
handle.close()
except IOError:
@@ -33,7 +33,7 @@ class Daemon:
return pid
def _write_pid(self, pid):
- handle = file(self._pidfile, "w")
+ handle = open(self._pidfile, "w")
handle.write("%s\n" % str(pid))
handle.close()
self._pid_written = True
@@ -86,9 +86,9 @@ class Daemon:
sys.stdout.flush()
sys.stderr.flush()
- si = file("/dev/null", 'r')
- so = file("/dev/null", 'a+')
- se = file("/dev/null", 'a+', 0)
+ si = open("/dev/null", 'r')
+ so = open("/dev/null", 'a+')
+ se = open("/dev/null", 'a+', 0)
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index 8166816..b271158 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -451,7 +451,7 @@ class SetupMapper(object):
self._pool = self._pools[self._pool_name]
self._unmatched_pool_machines = []
- for p_id, p_machine in sorted(iter(self._pool.items()), reverse=True):
+ for p_id, p_machine in sorted(self._pool.items(), reverse=True):
if self._virtual_matching:
if "libvirt_domain" in p_machine["params"]:
self._unmatched_pool_machines.append(p_id)
@@ -516,7 +516,7 @@ class SetupMapper(object):
self._pool_name)
self._unmatched_pool_machines = []
- for p_id, p_machine in sorted(iter(self._pool.items()), reverse=True):
+ for p_id, p_machine in sorted(self._pool.items(), reverse=True):
if self._virtual_matching:
if "libvirt_domain" in p_machine["params"]:
self._unmatched_pool_machines.append(p_id)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index e2b98d0..42a50ab 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -1259,9 +1259,9 @@ class PerfRepoResult(object):
params = self._testExecution.get_parameters()
sha1 = hashlib.sha1()
- sha1.update(self._testExecution.get_testUid())
+ sha1.update((self._testExecution.get_testUid()).encode("utf-8"))
for i in sorted(tags):
- sha1.update(i)
+ sha1.update(i.encode("utf-8"))
for i in sorted(params, key=lambda x: x[0]):
skip = False
for j in ignore:
@@ -1270,8 +1270,8 @@ class PerfRepoResult(object):
break
if skip:
continue
- sha1.update(i[0])
- sha1.update(str(i[1]))
+ sha1.update(i[0].encode("utf-8"))
+ sha1.update(str(i[1]).encode("utf-8"))
return sha1.hexdigest()
class PerfRepoBaseline(object):
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 7c61d23..a861d2c 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -43,6 +43,11 @@ from lnst.Slave.InterfaceManager import InterfaceManager
from lnst.Slave.BridgeTool import BridgeTool
from lnst.Slave.SlaveSecSocket import SlaveSecSocket, SecSocketException
+class SystemCallException(Exception):
+ """Exception used to handle SIGINT waiting for system calls"""
+ pass
+
+
class SlaveMethods:
'''
Exported xmlrpc methods
@@ -1407,7 +1412,7 @@ class NetTestSlave:
for msg in msgs:
self._process_msg(msg[1])
- except:
+ except SystemCallException:
break
self._methods.machine_cleanup()
@@ -1509,7 +1514,7 @@ class NetTestSlave:
def _signal_die_handler(self, signum, frame):
logging.info("Caught signal %d -> dying" % signum)
- raise Exception("Recieved interrupt to system call")
+ raise SystemCallException()
def _parent_resend_signal_handler(self, signum, frame):
logging.info("Caught signal %d -> resending to parent" % signum)
diff --git a/recipes/regression_tests/phase3/ipsec_esp_aead.py b/recipes/regression_tests/phase3/ipsec_esp_aead.py
index 3c5028e..752448c 100644
--- a/recipes/regression_tests/phase3/ipsec_esp_aead.py
+++ b/recipes/regression_tests/phase3/ipsec_esp_aead.py
@@ -14,7 +14,7 @@ from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
#lenth param is in bits
def generate_key(length):
key = "0x"
- key = key + (length/8) * "0b"
+ key = key + (int(length/8)) * "0b"
return key
algorithm = []
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 7e9fbd0..8e66215 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -7,12 +7,18 @@ jprochaz(a)redhat.com (Jiri Prochazka)
"""
import logging
-import errno
import re
+import signal
+import errno
from lnst.Common.TestsCommon import TestGeneric
from lnst.Common.ShellProcess import ShellProcess
from lnst.Common.Utils import std_deviation, is_installed, int_it
+class InterruptException(Exception):
+ """Exception used to handle SIGINT waiting"""
+ pass
+
+
class Netperf(TestGeneric):
supported_tests = ["TCP_STREAM", "TCP_RR", "UDP_STREAM", "UDP_RR",
@@ -384,10 +390,21 @@ class Netperf(TestGeneric):
logging.debug("running as server...")
server = ShellProcess(cmd)
try:
- server.wait()
- except OSError as e:
- if e.errno == errno.EINTR:
- server.kill()
+ self.wait_for_interrupt()
+ except InterruptException:
+ server.kill()
+
+ def wait_for_interrupt(self):
+ def handler(signum, frame):
+ raise InterruptException()
+
+ try:
+ old_handler = signal.signal(signal.SIGINT, handler)
+ signal.pause()
+ except InterruptException:
+ pass
+ finally:
+ signal.signal(signal.SIGINT, old_handler)
def _pretty_rate(self, rate, unit=None):
pretty_rate = {}
@@ -502,7 +519,7 @@ class Netperf(TestGeneric):
rate_deviation = 2*res_data["std_deviation"]
elif len(rates) == 1 and self._confidence is not None:
result = results[0]
- rate_deviation = rate * (result["confidence"][1] / 100)
+ rate_deviation = rate * (int(result["confidence"][1]) / 100)
else:
rate_deviation = 0.0
--
2.20.1
5 years, 1 month