[PATCH 1/2] Icmp6Ping: Use correct option name
by Ido Schimmel
Fixes: 73b24ec5659f ("Icmp6Ping test")
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
test_modules/Icmp6Ping.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_modules/Icmp6Ping.py b/test_modules/Icmp6Ping.py
index 9197b42..405c756 100644
--- a/test_modules/Icmp6Ping.py
+++ b/test_modules/Icmp6Ping.py
@@ -38,7 +38,7 @@ class Icmp6Ping(TestGeneric):
cmd = self.compose_cmd()
logging.debug("%s" % cmd)
- limit_rate = self.get_opt("limit_rate ", default=80)
+ limit_rate = self.get_opt("limit_rate", default=80)
data_stdout = exec_cmd(cmd, die_on_err=False)[0]
stat_pttr1 = r'(\d+) packets transmitted, (\d+) received'
--
2.4.10
8 years, 1 month
Re: [PATCH] recipes: switchdev: Allow links to stabilize before ping
by Ido Schimmel
Mon, Mar 14, 2016 at 11:48:10AM IST, jiri(a)mellanox.com wrote:
>Mon, Mar 14, 2016 at 09:53:24AM CET, idosch(a)mellanox.com wrote:
>>We are seeing failures in our nightly regression where ping fails due to
>>rate being lower than limit. The machine logs suggest the first few
>>packets are dropped, but the rest go through just fine.
>
>Wouldn't it be better just to lower the rate in this cases?
>15 sec wait in case of failover does not look correct to me.
Why not? The whole point is to check that the links can adjust and they
do, but it takes some time.
Anyway, these are the rates that caused failures in last night's run:
57
63
76
We can set it to 50 and hope for the best.
>
>
>>
>>Solve that by adding a sleep() between the time we configure the links
>>and testing ping, so that the links are stable during the test.
>>
>>Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
>>---
>> recipes/switchdev/l2-005-bridge_bond_failover.py | 4 ++++
>> recipes/switchdev/l2-007-bridge_team_failover.py | 4 ++++
>> 2 files changed, 8 insertions(+)
>>
>>diff --git a/recipes/switchdev/l2-005-bridge_bond_failover.py b/recipes/switchdev/l2-005-bridge_bond_failover.py
>>index c7b4eca..c0b8406 100644
>>--- a/recipes/switchdev/l2-005-bridge_bond_failover.py
>>+++ b/recipes/switchdev/l2-005-bridge_bond_failover.py
>>@@ -33,21 +33,25 @@ def do_task(ctl, hosts, ifaces, aliases):
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if1.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if1.set_link_up()
>> sw_if2.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if2.set_link_up()
>> sw_if1.set_link_down()
>> sw_if3.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if1.set_link_up()
>> sw_if3.set_link_up()
>> sw_if2.set_link_down()
>> sw_if4.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> do_task(ctl, [ctl.get_host("machine1"),
>>diff --git a/recipes/switchdev/l2-007-bridge_team_failover.py b/recipes/switchdev/l2-007-bridge_team_failover.py
>>index 23d1a7c..47050ff 100644
>>--- a/recipes/switchdev/l2-007-bridge_team_failover.py
>>+++ b/recipes/switchdev/l2-007-bridge_team_failover.py
>>@@ -39,21 +39,25 @@ def do_task(ctl, hosts, ifaces, aliases):
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if1.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if1.set_link_up()
>> sw_if2.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if2.set_link_up()
>> sw_if1.set_link_down()
>> sw_if3.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> sw_if1.set_link_up()
>> sw_if3.set_link_up()
>> sw_if2.set_link_down()
>> sw_if4.set_link_down()
>>+ sleep(15)
>> tl.ping_simple(m1_lag1, m2_lag1)
>>
>> do_task(ctl, [ctl.get_host("machine1"),
>>--
>>2.4.10
>>
8 years, 1 month
[PATCH] recipes: switchdev: Allow links to stabilize before ping
by Ido Schimmel
We are seeing failures in our nightly regression where ping fails due to
rate being lower than limit. The machine logs suggest the first few
packets are dropped, but the rest go through just fine.
Solve that by adding a sleep() between the time we configure the links
and testing ping, so that the links are stable during the test.
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
recipes/switchdev/l2-005-bridge_bond_failover.py | 4 ++++
recipes/switchdev/l2-007-bridge_team_failover.py | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/recipes/switchdev/l2-005-bridge_bond_failover.py b/recipes/switchdev/l2-005-bridge_bond_failover.py
index c7b4eca..c0b8406 100644
--- a/recipes/switchdev/l2-005-bridge_bond_failover.py
+++ b/recipes/switchdev/l2-005-bridge_bond_failover.py
@@ -33,21 +33,25 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.ping_simple(m1_lag1, m2_lag1)
sw_if1.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
sw_if1.set_link_up()
sw_if2.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
sw_if2.set_link_up()
sw_if1.set_link_down()
sw_if3.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
sw_if1.set_link_up()
sw_if3.set_link_up()
sw_if2.set_link_down()
sw_if4.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
do_task(ctl, [ctl.get_host("machine1"),
diff --git a/recipes/switchdev/l2-007-bridge_team_failover.py b/recipes/switchdev/l2-007-bridge_team_failover.py
index 23d1a7c..47050ff 100644
--- a/recipes/switchdev/l2-007-bridge_team_failover.py
+++ b/recipes/switchdev/l2-007-bridge_team_failover.py
@@ -39,21 +39,25 @@ def do_task(ctl, hosts, ifaces, aliases):
tl.ping_simple(m1_lag1, m2_lag1)
sw_if1.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
sw_if1.set_link_up()
sw_if2.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
sw_if2.set_link_up()
sw_if1.set_link_down()
sw_if3.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
sw_if1.set_link_up()
sw_if3.set_link_up()
sw_if2.set_link_down()
sw_if4.set_link_down()
+ sleep(15)
tl.ping_simple(m1_lag1, m2_lag1)
do_task(ctl, [ctl.get_host("machine1"),
--
2.4.10
8 years, 1 month
[PATCH] XmlParser: allow user HTTPS URL as recipe file
by Jiri Prochazka
Current lxml.etree.parse implementation allows using HTTP, but not
HTTPS. When user tries to use HTTPS URL, it crashes on IOException.
This patch fixes that by checking if the URL starts with HTTPS
and uses urlopen to open the HTTPS page. This allows lxml.etree.parse
method to parse the XML from the HTTPS URL.
urllib2 is already used Common/Path and is available since Python2.6
so no new dependency is added.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/XmlParser.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/XmlParser.py b/lnst/Controller/XmlParser.py
index afc2cda..355b5e8 100644
--- a/lnst/Controller/XmlParser.py
+++ b/lnst/Controller/XmlParser.py
@@ -15,6 +15,7 @@ import re
import sys
import copy
from lxml import etree
+from urllib2 import urlopen
from lnst.Common.Config import lnst_config
from lnst.Controller.XmlTemplates import XmlTemplates
from lnst.Controller.XmlProcessing import XmlProcessingError
@@ -79,7 +80,10 @@ class XmlParser(object):
def _parse(self, path):
try:
- doc = etree.parse(path)
+ if path.startswith('https'):
+ doc = etree.parse(urlopen(path))
+ else:
+ doc = etree.parse(path)
except etree.LxmlError as err:
# A workaround for cases when lxml (quite strangely)
# sets the filename to <string>.
--
2.4.3
8 years, 1 month
[PATCH] simple_netperf: update offload_settings and add some sleeps
by Jiri Prochazka
Offload settings were outdated, combination with rx=off was missing
Also 15s sleep was added after setting rx=off, so it's the same as
other recipes.
And 2s sleeps were added after running netserver procs, again,
to be consistent with other tests
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
recipes/regression_tests/phase1/simple_netperf.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/recipes/regression_tests/phase1/simple_netperf.py b/recipes/regression_tests/phase1/simple_netperf.py
index baf3c3c..8c0d6ef 100644
--- a/recipes/regression_tests/phase1/simple_netperf.py
+++ b/recipes/regression_tests/phase1/simple_netperf.py
@@ -25,10 +25,11 @@ m2.sync_resources(modules=["Netperf"])
# ------
offloads = ["gro", "gso", "tso", "tx"]
-offload_settings = [ [("gro", "on"), ("gso", "on"), ("tso", "on"), ("tx", "on")],
- [("gro", "off"), ("gso", "on"), ("tso", "on"), ("tx", "on")],
- [("gro", "on"), ("gso", "off"), ("tso", "off"), ("tx", "on")],
- [("gro", "on"), ("gso", "on"), ("tso", "off"), ("tx", "off")]]
+offload_settings = [ [("gro", "on"), ("gso", "on"), ("tso", "on"), ("tx", "on"), ("rx", "on")],
+ [("gro", "off"), ("gso", "on"), ("tso", "on"), ("tx", "on"), ("rx", "on")],
+ [("gro", "on"), ("gso", "off"), ("tso", "off"), ("tx", "on"), ("rx", "on")],
+ [("gro", "on"), ("gso", "on"), ("tso", "off"), ("tx", "off"), ("rx", "on")],
+ [("gro", "on"), ("gso", "on"), ("tso", "on"), ("tx", "on"), ("rx", "off")]]
ipv = ctl.get_alias("ipv")
mtu = ctl.get_alias("mtu")
@@ -145,9 +146,15 @@ for setting in offload_settings:
m1.run("ethtool -K %s %s" % (m1_testiface.get_devname(), dev_features))
m2.run("ethtool -K %s %s" % (m2_testiface.get_devname(), dev_features))
+ if ("rx", "off") in setting:
+ # when rx offload is turned off some of the cards might get reset
+ # and link goes down, so wait a few seconds until NIC is ready
+ ctl.wait(15)
+
# Netperf test
if ipv in [ 'ipv4', 'both' ]:
srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
# prepare PerfRepo result for tcp
result_tcp = perf_api.new_result("tcp_ipv4_id",
@@ -198,6 +205,7 @@ for setting in offload_settings:
if ipv in [ 'ipv6', 'both' ]:
srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
# prepare PerfRepo result for tcp ipv6
result_tcp = perf_api.new_result("tcp_ipv6_id",
--
2.4.3
8 years, 1 month
[PATCH] recipes: switchdev: Increase link negotiation timeout
by Ido Schimmel
We sometimes observe failures in which the link negotiation supposedly
failed, but the subsequent ping tests pass. This is because the link is
negotiated after the timeout has elapsed.
Increase the timeout value to prevent further false negatives.
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
recipes/switchdev/basic-001-links.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/recipes/switchdev/basic-001-links.py b/recipes/switchdev/basic-001-links.py
index 998c986..924fdaf 100644
--- a/recipes/switchdev/basic-001-links.py
+++ b/recipes/switchdev/basic-001-links.py
@@ -27,7 +27,7 @@ def linkneg(tl, if1, if2):
speeds = [10000, 40000, 100000]
for speed in speeds:
- tl.linkneg(if1, if2, True, speed=speed, timeout=10)
+ tl.linkneg(if1, if2, True, speed=speed, timeout=30)
tl.ping_simple(if1, if2)
def do_task(ctl, hosts, ifaces, aliases):
@@ -43,7 +43,7 @@ def do_task(ctl, hosts, ifaces, aliases):
sw_if3.reset(ip=["192.168.103.11/24", "2004::2/64"])
sw_if4.reset(ip=["192.168.104.11/24", "2005::2/64"])
- sleep(10)
+ sleep(30)
tl = TestLib(ctl, aliases)
--
2.4.10
8 years, 1 month
[PATCH] RecipeCommon: fix Beaker job url typo
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/RecipeCommon/PerfRepo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/RecipeCommon/PerfRepo.py b/lnst/RecipeCommon/PerfRepo.py
index 99ee22e..432dad8 100644
--- a/lnst/RecipeCommon/PerfRepo.py
+++ b/lnst/RecipeCommon/PerfRepo.py
@@ -35,7 +35,7 @@ def generate_perfrepo_comment(hosts=[], user_comment=None):
if 'BEAKER' in os.environ and 'JOBID' in os.environ:
bkr_server = os.environ['BEAKER']
bkr_jobid = os.environ['JOBID']
- bkr_job_url = bkr_server + bkr_jobid
+ bkr_job_url = bkr_server + 'jobs/' + bkr_jobid
comment += "Beaker job: %s<BR>" % bkr_job_url
if user_comment:
--
2.4.3
8 years, 1 month
[PATCH] RecipeCommon: fix Beaker job url typo
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/RecipeCommon/PerfRepo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/RecipeCommon/PerfRepo.py b/lnst/RecipeCommon/PerfRepo.py
index 99ee22e..432dad8 100644
--- a/lnst/RecipeCommon/PerfRepo.py
+++ b/lnst/RecipeCommon/PerfRepo.py
@@ -35,7 +35,7 @@ def generate_perfrepo_comment(hosts=[], user_comment=None):
if 'BEAKER' in os.environ and 'JOBID' in os.environ:
bkr_server = os.environ['BEAKER']
bkr_jobid = os.environ['JOBID']
- bkr_job_url = bkr_server + bkr_jobid
+ bkr_job_url = bkr_server + 'jobs/' + bkr_jobid
comment += "Beaker job: %s<BR>" % bkr_job_url
if user_comment:
--
2.4.3
8 years, 1 month
[PATCH v3 4/4] recipes: add test execution comments in regression
tests
by Jan Tluka
All phase1/phase2 tests will now include comment in perfrepo test executions.
The comment will include kernels of both baremetal and guest test machines.
User can also specify alias 'perfrepo_comment' that will be appended to
automatically generated comment.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.py | 8 ++++++++
recipes/regression_tests/phase1/3_vlans_over_bond.py | 8 ++++++++
recipes/regression_tests/phase1/bonding_test.py | 8 ++++++++
recipes/regression_tests/phase1/simple_netperf.py | 8 ++++++++
.../phase1/virtual_bridge_2_vlans_over_bond.py | 8 ++++++++
.../regression_tests/phase1/virtual_bridge_vlan_in_guest.py | 8 ++++++++
.../regression_tests/phase1/virtual_bridge_vlan_in_host.py | 8 ++++++++
recipes/regression_tests/phase2/3_vlans_over_team.py | 8 ++++++++
recipes/regression_tests/phase2/team_test.py | 12 ++++++++++++
.../virtual_ovs_bridge_2_vlans_over_active_backup_bond.py | 8 ++++++++
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 8 ++++++++
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 8 ++++++++
12 files changed, 100 insertions(+)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 78eedcf..b9420b6 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -41,6 +42,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
m1_phy1 = m1.get_interface("eth1")
m1_phy1.set_mtu(mtu)
@@ -220,6 +224,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -244,6 +249,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
@@ -274,6 +280,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -298,6 +305,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index ff83121..07d5f5c 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -40,6 +41,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
m1_bond = m1.get_interface("test_bond")
m1_bond.set_mtu(mtu)
@@ -219,6 +223,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -243,6 +248,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
@@ -273,6 +279,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -297,6 +304,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index e125fb9..d56955d 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -40,6 +41,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
test_if1 = m1.get_interface("test_if")
test_if1.set_mtu(mtu)
@@ -197,6 +201,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -219,6 +224,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -249,6 +255,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -271,6 +278,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase1/simple_netperf.py b/recipes/regression_tests/phase1/simple_netperf.py
index 407ee5d..baf3c3c 100644
--- a/recipes/regression_tests/phase1/simple_netperf.py
+++ b/recipes/regression_tests/phase1/simple_netperf.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -39,6 +40,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
m1_testiface = m1.get_interface("testiface")
m2_testiface = m2.get_interface("testiface")
@@ -165,6 +169,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -187,6 +192,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
@@ -213,6 +219,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -235,6 +242,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
index 598ee7b..6b79dff 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -45,6 +46,9 @@ nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([h1, g1, g2, h2, g3, g4], pr_user_comment)
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -275,6 +279,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
if enable_udp_perf is not None:
@@ -301,6 +306,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -337,6 +343,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -363,6 +370,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
index d3e4790..cf83070 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -41,6 +42,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([h1, g1, h2], pr_user_comment)
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -211,6 +215,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -237,6 +242,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -270,6 +276,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -296,6 +303,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
index 6070beb..2ee4c60 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -41,6 +42,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([h1, g1, h2], pr_user_comment)
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -211,6 +215,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -237,6 +242,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -270,6 +276,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -296,6 +303,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 972f94f..f66a38d 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -40,6 +41,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
m1_team = m1.get_interface("test_if")
m1_team.set_mtu(mtu)
@@ -219,6 +223,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -243,6 +248,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
@@ -273,6 +279,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -297,6 +304,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
srv_proc.intr()
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index 7cc66dd..6327528 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -39,6 +40,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
test_if1 = m1.get_interface("test_if")
test_if1.set_mtu(mtu)
@@ -198,6 +202,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -222,6 +227,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -253,6 +259,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*5)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -277,6 +284,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*5)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -353,6 +361,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -377,6 +386,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -408,6 +418,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -432,6 +443,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
index 5620d8a..a65c4ba 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -45,6 +46,9 @@ nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([h1, g1, g2, h2, g3, g4], pr_user_comment)
h1_nic1 = h1.get_interface("nic1")
h1_nic2 = h1.get_interface("nic2")
@@ -254,6 +258,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -280,6 +285,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -316,6 +322,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -342,6 +349,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
index 1e1020e..dfc54e3 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -41,6 +42,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([h1, g1, h2], pr_user_comment)
h2_vlan10 = h2.get_interface("vlan10")
g1_vlan10 = g1.get_interface("vlan10")
@@ -199,6 +203,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -225,6 +230,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -258,6 +264,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -284,6 +291,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
index 92549e2..154f0b9 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
@@ -3,6 +3,7 @@ from lnst.Controller.PerfRepoUtils import netperf_baseline_template
from lnst.Controller.PerfRepoUtils import netperf_result_template
from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
# ------
# SETUP
@@ -41,6 +42,9 @@ nperf_cpupin = ctl.get_alias("nperf_cpupin")
nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
nperf_mode = ctl.get_alias("nperf_mode")
nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([h1, g1, h2], pr_user_comment)
h2_vlan10 = h2.get_interface("vlan10")
g1_guestnic = g1.get_interface("guestnic")
@@ -198,6 +202,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp
@@ -224,6 +229,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
@@ -258,6 +264,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_tcp, tcp_res_data)
+ result_tcp.set_comment(pr_comment)
perf_api.save_result(result_tcp)
# prepare PerfRepo result for udp ipv6
@@ -284,6 +291,7 @@ for setting in offload_settings:
timeout = (netperf_duration + nperf_reserve)*nperf_max_runs)
netperf_result_template(result_udp, udp_res_data)
+ result_udp.set_comment(pr_comment)
perf_api.save_result(result_udp)
server_proc.intr()
--
2.4.3
8 years, 1 month
[PATCH v3 3/4] RecipeCommon: added PerfRepo helper functions module
for python tasks
by Jan Tluka
This module provides functions that are related to PerfRepo. Currently
contains just one function generate_perfrepo_comment() that returns
string containing various information such as kernel versions on the
hosts passed as argument, if running in Beaker environment the job url
and additional user specified string to be included in comment. This
function will be used in phase1/phase2 regression tests.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/RecipeCommon/PerfRepo.py | 44 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
create mode 100644 lnst/RecipeCommon/PerfRepo.py
diff --git a/lnst/RecipeCommon/PerfRepo.py b/lnst/RecipeCommon/PerfRepo.py
new file mode 100644
index 0000000..99ee22e
--- /dev/null
+++ b/lnst/RecipeCommon/PerfRepo.py
@@ -0,0 +1,44 @@
+"""
+This module defines helper functions for interacting with PerfRepo
+that can be imported directly into LNST Python tasks.
+
+Copyright 2016 Red Hat, Inc.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+jtluka(a)redhat.com (Jan Tluka)
+"""
+
+import os
+
+def generate_perfrepo_comment(hosts=[], user_comment=None):
+ """ Prepare the PerfRepo comment.
+
+ By default it will include kernel versions used on the hosts and
+ Beaker job url.
+
+ Keyword arguments:
+ hosts -- list of HostAPI objects
+ user_comment -- additional user specified comment
+ """
+
+ comment = ""
+
+ for host in hosts:
+ host_cfg = host.get_configuration()
+ comment += "Kernel (%s): %s<BR>" % \
+ (host_cfg['id'], host_cfg['kernel_release'])
+
+ # if we're running in Beaker environment, include job url
+ if 'BEAKER' in os.environ and 'JOBID' in os.environ:
+ bkr_server = os.environ['BEAKER']
+ bkr_jobid = os.environ['JOBID']
+ bkr_job_url = bkr_server + bkr_jobid
+ comment += "Beaker job: %s<BR>" % bkr_job_url
+
+ if user_comment:
+ comment += user_comment
+
+ return comment
--
2.4.3
8 years, 1 month