From: Christos Sfakianakis <csfakian(a)redhat.com>
Enable hadnling of perf tests from both sides in BaseEnrtRecipe.
Add this feature in 3 of the recipes (it is used in their old
variants).
v2:
Make perf_reverse optional and available to all recipes for
added flexibility to the tester. Move 'create_reverse_flow'
to the bottom of BaseEnrtRecipe.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 25 +++++++++++++++++++++++++
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 ++-
lnst/Recipes/ENRT/TeamRecipe.py | 3 ++-
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 ++-
4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index a637486..2618617 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -84,6 +84,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
perf_iterations = IntParam(default=5)
perf_parallel_streams = IntParam(default=1)
perf_msg_size = IntParam(default=123)
+ perf_reverse = BoolParam(mandatory=False)
perf_usr_comment = StrParam(default="")
@@ -213,6 +214,30 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
],
iterations=self.params.perf_iterations)
+ if "perf_reverse" in self.params and self.params.perf_reverse:
+ reverse_flow = self._create_reverse_flow(flow)
+ reverse_flow_measurement = self.params.net_perf_tool([reverse_flow])
+ yield PerfRecipeConf(
+ measurements=[
+ self.params.cpu_perf_tool([server_netns, client_netns]),
+ reverse_flow_measurement
+ ],
+ iterations=self.params.perf_iterations)
+
+ def _create_reverse_flow(self, flow):
+ rev_flow = PerfFlow(
+ type = flow.type,
+ generator = flow.receiver,
+ generator_bind = flow.receiver_bind,
+ receiver = flow.generator,
+ receiver_bind = flow.generator_bind,
+ msg_size = flow.msg_size,
+ duration = flow.duration,
+ parallel_streams = flow.parallel_streams,
+ cpupin = flow.cpupin
+ )
+ return rev_flow
+
def _pin_dev_interrupts(self, dev, cpu):
netns = dev.netns
cpu_info = netns.run("lscpu").stdout
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py
b/lnst/Recipes/ENRT/DoubleTeamRecipe.py
index 26f4d41..e0c727a 100644
--- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py
+++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py
@@ -2,7 +2,7 @@
Implements scenario similar to regression_tests/phase2/
({active_backup,round_robin}_double_team.xml + team_test.py)
"""
-from lnst.Common.Parameters import Param, IntParam, StrParam
+from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam
from lnst.Common.IpAddress import ipaddress
from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
@@ -23,6 +23,7 @@ class DoubleTeamRecipe(BaseEnrtRecipe):
dict(gro="on", gso="off", tso="off",
tx="on"),
dict(gro="on", gso="on", tso="off",
tx="off")))
+ perf_reverse = BoolParam(default=True)
runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index 846ca9c..f2e4ad3 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -2,7 +2,7 @@
Implements scenario similar to regression_tests/phase2/
({active_backup,round_robin}_team.xml + team_test.py)
"""
-from lnst.Common.Parameters import Param, IntParam, StrParam
+from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam
from lnst.Common.IpAddress import ipaddress
from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
@@ -22,6 +22,7 @@ class TeamRecipe(BaseEnrtRecipe):
dict(gro="on", gso="off", tso="off",
tx="on"),
dict(gro="on", gso="on", tso="off",
tx="off")))
+ perf_reverse = BoolParam(default=True)
runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
index 0536704..3abfe73 100644
--- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
+++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
@@ -3,7 +3,7 @@ Implements scenario similar to regression_tests/phase2/
({active_backup,round_robin}_team_vs_{active_backup,round_robin}
_bond.xml + team_test.py)
"""
-from lnst.Common.Parameters import Param, IntParam, StrParam
+from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam
from lnst.Common.IpAddress import ipaddress
from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
@@ -25,6 +25,7 @@ class TeamVsBondRecipe(BaseEnrtRecipe):
dict(gro="on", gso="off", tso="off",
tx="on"),
dict(gro="on", gso="on", tso="off",
tx="off")))
+ perf_reverse = BoolParam(default=True)
runner_name = StrParam(mandatory = True)
bonding_mode = StrParam(mandatory = True)
miimon_value = IntParam(mandatory = True)
--
2.17.1