The python recipe example, python_recipe_simple_netperf.py has been
updated accordingly.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/RecipeCommon/TestRecipe.py | 38 +------------------
.../examples/python_recipe_simple_netperf.py | 19 +---------
2 files changed, 2 insertions(+), 55 deletions(-)
diff --git a/lnst/RecipeCommon/TestRecipe.py b/lnst/RecipeCommon/TestRecipe.py
index 360cd2a..9c77f55 100755
--- a/lnst/RecipeCommon/TestRecipe.py
+++ b/lnst/RecipeCommon/TestRecipe.py
@@ -9,20 +9,12 @@ from lnst.Controller.Recipe import RecipeError
from lnst.Tests.Netperf import Netperf
-from lnst.RecipeCommon.PerfRepo.PerfRepo import PerfRepoAPI
-from lnst.RecipeCommon.PerfRepo.PerfRepo import generate_perfrepo_comment
-from lnst.RecipeCommon.PerfRepo.PerfRepoUtils import netperf_baseline_template
-from lnst.RecipeCommon.PerfRepo.PerfRepoUtils import netperf_result_template
-
from lnst.RecipeCommon.IRQ import pin_dev_irqs
class TestRecipe(BaseRecipe):
ipv = StrParam(default="both")
mtu = IntParam(default=1500)
- mapping_file = StrParam()
- pr_user_comment = StrParam()
-
nperf_cpupin = IntParam()
nperf_reserve = IntParam(default=20)
nperf_mode = StrParam(default="default")
@@ -43,20 +35,9 @@ class TestRecipe(BaseRecipe):
def __init__(self, **kwargs):
super(TestRecipe, self).__init__(**kwargs)
- if "mapping_file" in self.params:
- self.perf_api = PerfRepoAPI(self.params.mapping_file)
- self.perf_api.connect_PerfRepo()
-
-
def initial_setup(self):
machines = []
- if "pr_user_comment" in self.params:
- machines = [machines.append(m) for m in self.matched]
-
- self.pr_comment = generate_perfrepo_comment(machines,
- self.params.pr_user_comment)
-
if "nperf_cpupin" in self.params:
for m in self.matched:
m.run("service irqbalance stop")
@@ -113,18 +94,9 @@ class TestRecipe(BaseRecipe):
return Netperf(**kwargs)
- def netperf_run(self, netserver, netperf, perfrepo_result=None):
+ def netperf_run(self, netserver, netperf):
srv_proc = self.matched.m1.run(netserver, bg=True)
- if perfrepo_result:
- if not hasattr(self, 'perf_api'):
- raise RecipeError("no class variable called perf_api")
-
-
- baseline = self.perf_api.get_baseline_of_result(perfrepo_result)
- #TODO:
- #netperf_baseline_template(netperf, baseline)
-
time.sleep(2)
res_data = self.matched.m2.run(netperf,
@@ -133,14 +105,6 @@ class TestRecipe(BaseRecipe):
self.params.nperf_reserve) *
self.params.netperf_runs)
- if perfrepo_result:
- netperf_result_template(perfrepo_result, res_data)
-
- if hasattr(self, 'pr_comment'):
- perfrepo_result.set_comment(self.params.pr_comment)
-
- self.perf_api.save_result(perfrepo_result)
-
srv_proc.kill(2)
return res_data, srv_proc
diff --git a/recipes/examples/python_recipe_simple_netperf.py
b/recipes/examples/python_recipe_simple_netperf.py
index 1f9b400..175dd39 100755
--- a/recipes/examples/python_recipe_simple_netperf.py
+++ b/recipes/examples/python_recipe_simple_netperf.py
@@ -18,7 +18,6 @@ class SimpleNetperfRecipe(TestRecipe):
[("gro", "on"), ("gso",
"on"), ("tso", "off"), ("tx", "off"),
("rx", "on")],
[("gro", "on"), ("gso",
"on"), ("tso", "on"), ("tx", "on"),
("rx", "off")]]
- mapping_file = StrParam(default="simple_netperf.mapping")
product_name = StrParam(default="RHEL7")
m1 = HostReq()
@@ -73,28 +72,12 @@ class SimpleNetperfRecipe(TestRecipe):
for ipver in ipv:
if self.params.ipv in [ipver, 'both']:
for ttype, ttype_name in transport_type:
- result =
self.perf_api.new_result(ttype+"_"+ipver+"_id",
-
ttype+"_"+ipver+"_result",
- hash_ignore=[
- 'kernel_release',
- 'redhat_release'])
-
- for offload in setting:
- result.set_parameter(offload[0], offload[1])
-
- result.add_tag(self.params.product_name)
- if self.params.nperf_mode == "multi":
- result.add_tag("multithreaded")
- result.set_parameter("num_parallel",
- self.params.nperf_num_parallel)
-
ip_num = 0 if ipver is 'ipv4' else 1
netperf =
self.generate_netperf_cli(self.matched.m1.eth0.ips[ip_num],
ttype_name)
self.netperf_run(Netserver(bind=self.matched.m1.eth0.ips[ip_num]),
- netperf,
- result)
+ netperf)
time.sleep(5)
--
2.21.1