[patch lnst] TestsCommon: add desctiprion to result summary
by Jiri Pirko
From: Jiri Pirko <jiri(a)mellanox.com>
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>
---
lnst/Common/TestsCommon.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py
index accb6b8..817d747 100644
--- a/lnst/Common/TestsCommon.py
+++ b/lnst/Common/TestsCommon.py
@@ -142,5 +142,9 @@ class TestGeneric(NetTestCommandGeneric):
bg_id = " bg_id: %s" % self._command["bg_id"]
else:
bg_id = ""
- cmd = "%-9s%s%s" %(cmd_type, cmd_val, bg_id)
+ if "desc" in self._command:
+ desc = " desc: \"%s\"" % self._command["desc"]
+ else:
+ desc = ""
+ cmd = "%-9s%s%s%s" %(cmd_type, cmd_val, bg_id, desc)
return cmd
--
2.4.3
8 years, 2 months
[patch lnst v3 1/2] TestsCommon: allow test module to get all existing single options
by Jiri Pirko
From: Jiri Pirko <jiri(a)mellanox.com>
This is dependency for "Custom" test module. Allows it to get all
available single-value options.
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>
---
v2->v3:
- removed forgotten "print" pointed out by jprochaz
v1->v2:
- no change
---
lnst/Common/TestsCommon.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py
index e29a609..accb6b8 100644
--- a/lnst/Common/TestsCommon.py
+++ b/lnst/Common/TestsCommon.py
@@ -127,6 +127,14 @@ class TestGeneric(NetTestCommandGeneric):
'''
return self.get_multi_opt(name, mandatory=True, opt_type=opt_type)
+ def get_single_opts(self):
+ opts = {}
+ for key in self._command["options"]:
+ item = self._command["options"][key]
+ if len(item) == 1:
+ opts[key] = item[0]["value"]
+ return opts
+
def _format_cmd_res_header(self):
cmd_val = self._command["module"]
cmd_type = self._command["type"]
--
2.4.3
8 years, 2 months
[patch lnst v2 1/2] TestsCommon: allow test module to get all existing single options
by Jiri Pirko
From: Jiri Pirko <jiri(a)mellanox.com>
This is dependency for "Custom" test module. Allows it to get all
available single-value options.
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>
---
v1->v2:
- no change
---
lnst/Common/TestsCommon.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py
index e29a609..4d5a0ed 100644
--- a/lnst/Common/TestsCommon.py
+++ b/lnst/Common/TestsCommon.py
@@ -127,6 +127,15 @@ class TestGeneric(NetTestCommandGeneric):
'''
return self.get_multi_opt(name, mandatory=True, opt_type=opt_type)
+ def get_single_opts(self):
+ opts = {}
+ for key in self._command["options"]:
+ item = self._command["options"][key]
+ if len(item) == 1:
+ print item[0]["value"]
+ opts[key] = item[0]["value"]
+ return opts
+
def _format_cmd_res_header(self):
cmd_val = self._command["module"]
cmd_type = self._command["type"]
--
2.4.3
8 years, 2 months
[patch lnst 1/2] TestsCommon: allow test module to get all existing single options
by Jiri Pirko
From: Jiri Pirko <jiri(a)mellanox.com>
This is dependency for "Custom" test module. Allows it to get all
available single-value options.
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>
---
lnst/Common/TestsCommon.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py
index e29a609..4d5a0ed 100644
--- a/lnst/Common/TestsCommon.py
+++ b/lnst/Common/TestsCommon.py
@@ -127,6 +127,15 @@ class TestGeneric(NetTestCommandGeneric):
'''
return self.get_multi_opt(name, mandatory=True, opt_type=opt_type)
+ def get_single_opts(self):
+ opts = {}
+ for key in self._command["options"]:
+ item = self._command["options"][key]
+ if len(item) == 1:
+ print item[0]["value"]
+ opts[key] = item[0]["value"]
+ return opts
+
def _format_cmd_res_header(self):
cmd_val = self._command["module"]
cmd_type = self._command["type"]
--
2.4.3
8 years, 2 months
[patch lnst 1/2] Task: allow to query device for bridge build-in vlans
by Jiri Pirko
From: Jiri Pirko <jiri(a)mellanox.com>
Kernel exposes an interface primary used by bridge to work with internal
VLAN implementation. However, other devices (for example SR-IOV drivers)
implement this as well making this not bridge-specific.
Allow task to query device bridge VLAN settings. This is implemented
simply by calling "bridge" utility. This may be later on changed to
pyroute2 implementation, alas it does not implement PF_BRIDGE Netlink
at the moment.
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>
---
lnst/Controller/Machine.py | 3 +++
lnst/Controller/Task.py | 3 +++
lnst/Slave/BridgeTool.py | 17 +++++++++++++++++
lnst/Slave/NetTestSlave.py | 8 ++++++++
4 files changed, 31 insertions(+)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 9a1d914..6a17a08 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -771,6 +771,9 @@ class Interface(object):
self._machine._rpc_call_x(self._netns, "del_br_vlan",
self._id, br_vlan_info)
+ def get_br_vlans(self):
+ return self._machine._rpc_call_x(self._netns, "get_br_vlans", self._id)
+
def add_br_fdb(self, br_fdb_info):
self._machine._rpc_call_x(self._netns, "add_br_fdb",
self._id, br_fdb_info)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index eb35a33..5786ed3 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -546,6 +546,9 @@ class InterfaceAPI(object):
"untagged": untagged,
"self": self, "master": master})
+ def get_br_vlans(self):
+ return self._if.get_br_vlans()
+
def add_br_fdb(_self, hwaddr, self=False, master=False, vlan_tci=None):
_self._if.add_br_fdb({"hwaddr": hwaddr, "self": self, "master": master,
"vlan_id": vlan_tci})
diff --git a/lnst/Slave/BridgeTool.py b/lnst/Slave/BridgeTool.py
index 1d87cd9..368b475 100644
--- a/lnst/Slave/BridgeTool.py
+++ b/lnst/Slave/BridgeTool.py
@@ -11,6 +11,7 @@ jiri(a)mellanox.com (Jiri Pirko)
"""
from lnst.Common.ExecCmd import exec_cmd
+import re
class BridgeTool:
def __init__(self, dev_name):
@@ -35,6 +36,22 @@ class BridgeTool:
def del_vlan(self, br_vlan_info):
return self._add_del_vlan("del", br_vlan_info)
+ def get_vlans(self):
+ output = exec_cmd("bridge vlan show dev %s" % self._dev_name,
+ die_on_err=False)[0]
+ br_vlan_info_list = []
+ for line in output.split("\n"):
+ match = re.match(r'.*\s+(\d+)', line)
+ if match:
+ vlan_id = int(match.groups()[0])
+ pvid = True if re.match(r'.*\s+PVID', line) else False
+ untagged = True if re.match(r'.*\s+Egress Untagged', line) \
+ else False
+ br_vlan_info = {"vlan_id": vlan_id, "pvid": pvid,
+ "untagged": untagged}
+ br_vlan_info_list.append(br_vlan_info)
+ return br_vlan_info_list
+
def _add_del_fdb(self, op, br_fdb_info):
cmd = "bridge fdb %s %s dev %s" % (op, br_fdb_info["hwaddr"],
self._dev_name)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index b257b50..4bfa445 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -711,6 +711,14 @@ class SlaveMethods:
brt.del_vlan(br_vlan_info)
return True
+ def get_br_vlans(self, if_id):
+ dev = self._if_manager.get_mapped_device(if_id)
+ if not dev:
+ logging.error("Device with id '%s' not found." % if_id)
+ return False
+ brt = BridgeTool(dev.get_name())
+ return brt.get_vlans()
+
def add_br_fdb(self, if_id, br_fdb_info):
dev = self._if_manager.get_mapped_device(if_id)
if not dev:
--
2.4.3
8 years, 2 months
[PATCH] recipes: use local IPv6 unicast addresses in non vlan setups
by Jan Tluka
This patch changes IPv6 addresses used in regression tests. The original
address format should be used for documentation purposes only.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/active_backup_bond.xml | 4 ++--
recipes/regression_tests/phase1/active_backup_double_bond.xml | 4 ++--
recipes/regression_tests/phase1/ping_flood.xml | 4 ++--
recipes/regression_tests/phase1/simple_netperf.xml | 4 ++--
recipes/regression_tests/phase2/active_backup_double_team.xml | 4 ++--
recipes/regression_tests/phase2/active_backup_team.xml | 4 ++--
.../phase2/active_backup_team_vs_active_backup_bond.xml | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/recipes/regression_tests/phase1/active_backup_bond.xml b/recipes/regression_tests/phase1/active_backup_bond.xml
index 6eb686f..76e8f75 100644
--- a/recipes/regression_tests/phase1/active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_bond.xml
@@ -27,7 +27,7 @@
</slaves>
<addresses>
<address value="{$net}.1/24" />
- <address value="2002::1/64"/>
+ <address value="fc00:0:0:0::1/64"/>
</addresses>
</bond>
</interfaces>
@@ -37,7 +37,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="{$net}.2/24" />
- <address value="2002::2/64"/>
+ <address value="fc00:0:0:0::2/64"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/active_backup_double_bond.xml b/recipes/regression_tests/phase1/active_backup_double_bond.xml
index 3fba12e..92f486b 100644
--- a/recipes/regression_tests/phase1/active_backup_double_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_double_bond.xml
@@ -27,7 +27,7 @@
</slaves>
<addresses>
<address value="{$net}.1/24" />
- <address value="2002::1/64"/>
+ <address value="fc00:0:0:0::1/64"/>
</addresses>
</bond>
</interfaces>
@@ -47,7 +47,7 @@
</slaves>
<addresses>
<address value="{$net}.2/24" />
- <address value="2002::2/64"/>
+ <address value="fc00:0:0:0::2/64"/>
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase1/ping_flood.xml b/recipes/regression_tests/phase1/ping_flood.xml
index 29aa3ac..5ccac21 100644
--- a/recipes/regression_tests/phase1/ping_flood.xml
+++ b/recipes/regression_tests/phase1/ping_flood.xml
@@ -10,7 +10,7 @@
<eth id="testiface" label="testnet">
<addresses>
<address>{$net}.10/24</address>
- <address>2002::1/64</address>
+ <address>fc00:0:0:0::1/64</address>
</addresses>
</eth>
</interfaces>
@@ -20,7 +20,7 @@
<eth id="testiface" label="testnet">
<addresses>
<address>{$net}.11/24</address>
- <address>2002::2/64</address>
+ <address>fc00:0:0:0::2/64</address>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/simple_netperf.xml b/recipes/regression_tests/phase1/simple_netperf.xml
index 2123b3e..8f0884e 100644
--- a/recipes/regression_tests/phase1/simple_netperf.xml
+++ b/recipes/regression_tests/phase1/simple_netperf.xml
@@ -17,7 +17,7 @@
<eth id="testiface" label="testnet">
<addresses>
<address>{$net}.10/24</address>
- <address>2002::1/64</address>
+ <address>fc00:0:0:0::1/64</address>
</addresses>
</eth>
</interfaces>
@@ -27,7 +27,7 @@
<eth id="testiface" label="testnet">
<addresses>
<address>{$net}.11/24</address>
- <address>2002::2/64</address>
+ <address>fc00:0:0:0::2/64</address>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml
index 22a2795..6639907 100644
--- a/recipes/regression_tests/phase2/active_backup_double_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_double_team.xml
@@ -31,7 +31,7 @@
</slaves>
<addresses>
<address value="{$net}.1/24" />
- <address value="2002::1/64" />
+ <address value="fc00:0:0:0::1/64" />
</addresses>
</team>
</interfaces>
@@ -55,7 +55,7 @@
</slaves>
<addresses>
<address value="{$net}.2/24" />
- <address value="2002::2/64" />
+ <address value="fc00:0:0:0::2/64" />
</addresses>
</team>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml
index dacf0c7..a9a18a4 100644
--- a/recipes/regression_tests/phase2/active_backup_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_team.xml
@@ -31,7 +31,7 @@
</slaves>
<addresses>
<address value="{$net}.1/24" />
- <address value="2002::1/64" />
+ <address value="fc00:0:0:0::1/64" />
</addresses>
</team>
</interfaces>
@@ -41,7 +41,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="{$net}.2/24" />
- <address value="2002::2/64" />
+ <address value="fc00:0:0:0::2/64" />
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
index 6ddb930..8f246c2 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
@@ -31,7 +31,7 @@
</slaves>
<addresses>
<address value="{$net}.1/24" />
- <address value="2002::1/64" />
+ <address value="fc00:0:0:0::1/64" />
</addresses>
</team>
</interfaces>
@@ -51,7 +51,7 @@
</slaves>
<addresses>
<address value="{$net}.2/24" />
- <address value="2002::2/64" />
+ <address value="fc00:0:0:0::2/64" />
</addresses>
</bond>
</interfaces>
--
2.4.3
8 years, 2 months
[PATCH] recipes: add pinning to ipv6 regression tests
by Jan Tluka
This patch adds CPU pinning to IPv6 tests as we do for IPv4 tests.
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 | 12 +++++++-----
recipes/regression_tests/phase1/simple_netperf.py | 10 ++++++----
.../phase1/virtual_bridge_vlan_in_guest.py | 10 ++++++----
.../phase1/virtual_bridge_vlan_in_host.py | 10 ++++++----
recipes/regression_tests/phase2/3_vlans_over_team.py | 8 ++++++--
recipes/regression_tests/phase2/team_test.py | 18 ++++++++++++------
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 12 +++++++-----
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 10 ++++++----
10 files changed, 68 insertions(+), 38 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 65c6d49..78eedcf 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -81,6 +81,10 @@ p_opts = "-L %s" % (m2_vlan1.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (m2_vlan1.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
@@ -123,7 +127,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts": "-L %s -6" % (m2_vlan1.get_ip(1))
+ "netperf_opts": p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
@@ -134,7 +138,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts": "-L %s -6" % (m2_vlan1.get_ip(1))
+ "netperf_opts": p_opts6
})
if nperf_mode == "multi":
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index d942e9b..ff83121 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -82,6 +82,10 @@ p_opts = "-L %s" % (m2_vlan1.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (m2_vlan1.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
@@ -124,7 +128,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts": "-L %s -6" % (m2_vlan1.get_ip(1))
+ "netperf_opts": p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
@@ -135,7 +139,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts": "-L %s -6" % (m2_vlan1.get_ip(1))
+ "netperf_opts": p_opts6
})
if nperf_mode == "multi":
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index c285b7c..e125fb9 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -91,13 +91,17 @@ netperf_srv6 = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : test_if1.get_ip(1),
- "netperf_opts" : " -6",
+ "netperf_opts" : " -6"
})
p_opts = "-L %s" % (test_if2.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (test_if2.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
@@ -132,8 +136,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (test_if2.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
@@ -145,8 +148,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (test_if2.get_ip(1))
+ "netperf_opts" : p_opts6
})
if nperf_mode == "multi":
diff --git a/recipes/regression_tests/phase1/simple_netperf.py b/recipes/regression_tests/phase1/simple_netperf.py
index 659befd..6762a60 100644
--- a/recipes/regression_tests/phase1/simple_netperf.py
+++ b/recipes/regression_tests/phase1/simple_netperf.py
@@ -59,6 +59,10 @@ p_opts = "-L %s" % (m2_testiface.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (m2_testiface.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -80,8 +84,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs" : nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (m2_testiface.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp = ctl.get_module("Netperf",
@@ -105,8 +108,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs" : nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (m2_testiface.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_srv = ctl.get_module("Netperf",
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 92422e7..d3e4790 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -92,6 +92,10 @@ p_opts = "-L %s" % (h2_vlan10.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s" % nperf_cpupin
+p_opts6 = "-L %s -6" % (h2_vlan10.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s" % nperf_cpupin
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -126,8 +130,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
@@ -140,8 +143,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
if nperf_mode == "multi":
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 dabc6c9..6070beb 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -91,6 +91,10 @@ p_opts = "-L %s" % (h2_vlan10.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s" % nperf_cpupin
+p_opts6 = "-L %s -6" % (h2_vlan10.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s" % nperf_cpupin
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -125,8 +129,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
@@ -139,8 +142,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
if nperf_mode == "multi":
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 60ff335..972f94f 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -82,6 +82,10 @@ p_opts = "-L %s" % (m2_vlan1.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (m2_vlan1.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
@@ -124,7 +128,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts": "-L %s -6" % (m2_vlan1.get_ip(1))
+ "netperf_opts": p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
@@ -135,7 +139,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts": "-L %s -6" % (m2_vlan1.get_ip(1))
+ "netperf_opts": p_opts6
})
if nperf_mode == "multi":
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index d5d9a30..7cc66dd 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -97,6 +97,10 @@ p_opts = "-L %s" % (test_if2.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (test_if2.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
@@ -131,8 +135,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (test_if2.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
@@ -144,8 +147,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (test_if2.get_ip(1))
+ "netperf_opts" : p_opts6
})
if nperf_mode == "multi":
@@ -300,6 +302,10 @@ p_opts = "-L %s" % (test_if1.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+p_opts6 = "-L %s -6" % (test_if1.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
netperf_cli_tcp.update_options({"netperf_server" : test_if2.get_ip(0),
"netperf_opts" : p_opts})
@@ -307,10 +313,10 @@ netperf_cli_udp.update_options({"netperf_server" : test_if2.get_ip(0),
"netperf_opts" : p_opts})
netperf_cli_tcp6.update_options({"netperf_server" : test_if2.get_ip(1),
- "netperf_opts" : "-L %s -6" % (test_if1.get_ip(1))})
+ "netperf_opts" : p_opts6 })
netperf_cli_udp6.update_options({"netperf_server" : test_if2.get_ip(1),
- "netperf_opts" : "-L %s -6" % (test_if1.get_ip(1))})
+ "netperf_opts" : p_opts6 })
for setting in offload_settings:
dev_features = ""
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 3c0faf9..1e1020e 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
@@ -89,6 +89,10 @@ p_opts = "-L %s" % (h2_vlan10.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s" % nperf_cpupin
+p_opts6 = "-L %s -6" % (h2_vlan10.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s" % nperf_cpupin
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -123,8 +127,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
@@ -137,9 +140,8 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
- })
+ "netperf_opts" : p_opts6
+ })
if nperf_mode == "multi":
netperf_cli_tcp.unset_option("confidence")
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 9a4d18c..92549e2 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
@@ -88,6 +88,10 @@ p_opts = "-L %s" % (h2_vlan10.get_ip(0))
if nperf_cpupin and nperf_mode != "multi":
p_opts += " -T%s" % nperf_cpupin
+p_opts6 = "-L %s -6" % (h2_vlan10.get_ip(1))
+if nperf_cpupin and nperf_mode != "multi":
+ p_opts6 += " -T%s" % nperf_cpupin
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -122,8 +126,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
netperf_cli_udp6 = ctl.get_module("Netperf",
@@ -136,8 +139,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"confidence" : nperf_confidence,
"cpu_util" : nperf_cpu_util,
"runs": nperf_max_runs,
- "netperf_opts" :
- "-L %s -6" % (h2_vlan10.get_ip(1))
+ "netperf_opts" : p_opts6
})
if nperf_mode == "multi":
--
2.4.3
8 years, 2 months
[PATCH] NetTestController: Fix typo in _get_machine_requierements method
by Jiri Prochazka
Error message should say "Host '%s' has no interfaces specified." instead
of "Hot '%s' has no interfaces specified."
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/NetTestController.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 6476593..6e112d1 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -154,7 +154,7 @@ class NetTestController:
# Each machine must have at least one interface
if "interfaces" not in machine or \
("interfaces" in machine and len(machine["interfaces"]) == 0):
- msg = "Hot '%s' has no interfaces specified." % m_id
+ msg = "Host '%s' has no interfaces specified." % m_id
raise RecipeError(msg, machine)
ifaces = {}
--
2.4.3
8 years, 2 months
[PATCH v2 1/2] InterfaceManager: Add speed setting methods
by Ido Schimmel
In order to test speed negotiation it is useful to have methods that
can change the speed of an interface.
The first method, 'set_speed', allows one to specify a speed (in Mb/s,
as in ethtool) to be set on an interface. At its lowest level, it's
implemented by calling 'ethtool' with desired 'speed' parameter and
'autoneg' set to 'off'. This is needed in order to prevent the driver
from advertising any other speeds.
On the other end of the link, the 'set_autoneg' method should be used
(again, implemented via 'ethtool'). When set it basically tells the
driver to advertise all the supported speeds.
To make sure no interface is left with auto negotiation off, set auto
negotation on when the Ethernet device is deconfigured.
Note that it's possible to tell the driver which speed and duplex to
advertise in autonegotiation, but for now we omit that and simply
advertise all of them. If needed, this can be added in the future.
Reviewed-by: Jiri Pirko <jiri(a)mellanox.com>
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
v1->v2:
* s/dev.error/logging.error/ as noted by Jiri Prochazka.
---
lnst/Controller/Machine.py | 6 ++++++
lnst/Controller/Task.py | 6 ++++++
lnst/Slave/InterfaceManager.py | 6 ++++++
lnst/Slave/NetConfigDevice.py | 1 +
lnst/Slave/NetTestSlave.py | 18 ++++++++++++++++++
5 files changed, 37 insertions(+)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 7281203..89ea05a 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -779,6 +779,12 @@ class Interface(object):
self._machine._rpc_call_x(self._netns, "del_br_fdb",
self._id, br_fdb_info)
+ def set_speed(self, speed):
+ self._machine._rpc_call_x(self._netns, "set_speed", self._id, speed)
+
+ def set_autoneg(self):
+ self._machine._rpc_call_x(self._netns, "set_autoneg", self._id)
+
class StaticInterface(Interface):
""" Static interface
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index e47b025..0ae1b25 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -528,6 +528,12 @@ class InterfaceAPI(object):
_self._if.del_br_fdb({"hwaddr": hwaddr, "self": self, "master": master,
"vlan_id": vlan_tci})
+ def set_speed(self, speed):
+ return self._if.set_speed(speed)
+
+ def set_autoneg(self):
+ return self._if.set_autoneg()
+
class ModuleAPI(object):
""" An API class representing a module. """
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index a99c2ae..be45153 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -530,3 +530,9 @@ class Device(object):
"mtu": self._mtu,
"driver": self._driver}
return if_data
+
+ def set_speed(self, speed):
+ exec_cmd("ethtool -s %s speed %s autoneg off" % (self._name, speed))
+
+ def set_autoneg(self):
+ exec_cmd("ethtool -s %s autoneg on" % self._name)
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 809c0c5..7d41873 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -90,6 +90,7 @@ class NetConfigDeviceEth(NetConfigDeviceGeneric):
def deconfigure(self):
config = self._dev_config
+ exec_cmd("ethtool -s %s autoneg on" % config["name"])
if "netem_cmd" in config:
exec_cmd(config["netem_cmd"].replace("add", "del"))
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index d65db5a..b257b50 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -729,6 +729,24 @@ class SlaveMethods:
brt.del_fdb(br_fdb_info)
return True
+ def set_speed(self, if_id, speed):
+ dev = self._if_manager.get_mapped_device(if_id)
+ if dev is not None:
+ dev.set_speed(speed)
+ else:
+ logging.error("Device with id '%s' not found." % if_id)
+ return False
+ return True
+
+ def set_autoneg(self, if_id):
+ dev = self._if_manager.get_mapped_device(if_id)
+ if dev is not None:
+ dev.set_autoneg()
+ else:
+ logging.error("Device with id '%s' not found." % if_id)
+ return False
+ return True
+
class ServerHandler(ConnectionHandler):
def __init__(self, addr):
super(ServerHandler, self).__init__()
--
2.4.10
8 years, 2 months
[PATCH] Task: add log message about missing PerfRepo library
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
In case PerfRepo connection is incomplete because the Python PerfRepo
library is missing the user will get an additional log message
explaining the situation.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Task.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index f821ccf..566fb35 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -134,6 +134,8 @@ class ControllerAPI(object):
self._perf_repo_api.load_mapping(path)
if not self._perf_repo_api.connected():
+ if PerfRepoRESTAPI is None:
+ logging.warn("Python PerfRepo library not found.")
logging.warn("Connection to PerfRepo incomplete, further "\
"PerfRepo commands will be ignored.")
return self._perf_repo_api
--
2.6.4
8 years, 2 months