[PATCH] recipes: move delay after setting MTU
by Jan Tluka
We have to wait few seconds after setting different MTU rather than before.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/simple_ping.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/recipes/regression_tests/phase1/simple_ping.py b/recipes/regression_tests/phase1/simple_ping.py
index 3591402..a421497 100644
--- a/recipes/regression_tests/phase1/simple_ping.py
+++ b/recipes/regression_tests/phase1/simple_ping.py
@@ -25,8 +25,6 @@ ping_mod6 = ctl.get_module("Icmp6Ping",
"iface" : hostA_testiface.get_ip(1),
"limit_rate": 90})
-ctl.wait(15)
-
ipv = ctl.get_alias("ipv")
mtu = ctl.get_alias("mtu")
@@ -35,6 +33,7 @@ test_if1.set_mtu(mtu)
test_if2 = hostB.get_interface("testiface")
test_if2.set_mtu(mtu)
+ctl.wait(15)
if ipv in [ 'ipv6', 'both' ]:
hostA.run(ping_mod6)
--
2.7.4
7 years, 6 months
[PATCH 0/2] offloads alias
by Kamil Jerabek
Patch 1 add Offloads module that contains method for offloads alias parsing.
Patch 2 add offloads alias to all tasks in regression_tests phase1 and phase2.
Kamil Jerabek (2):
RecipeCommon: add Offloads module
regression_tests: add offloads alias
lnst/RecipeCommon/Offloads.py | 49 ++++++++++++++++++++++
recipes/regression_tests/phase1/3_vlans.py | 7 ++++
.../regression_tests/phase1/3_vlans_over_bond.py | 7 ++++
recipes/regression_tests/phase1/bonding_test.py | 7 ++++
recipes/regression_tests/phase1/simple_netperf.py | 7 ++++
.../phase1/virtual_bridge_2_vlans_over_bond.py | 7 ++++
.../phase1/virtual_bridge_vlan_in_guest.py | 7 ++++
.../phase1/virtual_bridge_vlan_in_host.py | 7 ++++
.../regression_tests/phase2/3_vlans_over_team.py | 7 ++++
recipes/regression_tests/phase2/team_test.py | 7 ++++
...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 7 ++++
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 7 ++++
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 7 ++++
13 files changed, 133 insertions(+)
create mode 100644 lnst/RecipeCommon/Offloads.py
--
2.5.5
7 years, 6 months
LNST v12 scratch builds
by Ondrej Lichtner
Hi,
I've sent one final patch to the list that fixes the #28 regression
test and continued with the v12 release.
Right now I have the commits only locally so that I can fix stuff, and
I've made scratch builds for rawhide (also usable by F23, F24, RHEL7)
and EPEL6:
http://koji.fedoraproject.org/koji/taskinfo?taskID=15981799
http://koji.fedoraproject.org/koji/taskinfo?taskID=15984998
Please try them out and send me any issues you find. Installing the
packages should get you all the required dependencies, but some optional
ones used often will have to be installed manually...
One minor note... on F23 you need NM version 1.4.x (from F24) for LNST
to work properly... since F23 is nearing end of life anyway I don't
think it's important... I'm considering just ignoring F23 for the v12
update and just leaving it on v11.
-Ondrej
7 years, 6 months
[PATCH] InterfaceAPI: Configure IP addresses following reset()
by Ido Schimmel
From: Ido Schimmel <idosch(a)mellanox.com>
Up until commit 82f606fb169e ("{Net, Nm}ConfigDevice: split up() into
up+address_setup") up() used to both set the admin state of an interface
and configure it with IP address(es). However, the mentioned commit
split up() into up() and address_setup() and introduced a regression in
sections of code where up() isn't followed by address_setup().
Fix this by following the call to up() with a call to address_setup() in
reset(), which seems to be the only place where this was missed.
Fixes: 82f606fb169e ("{Net, Nm}ConfigDevice: split up() into up+address_setup")
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
Tested with three recipes from recipes/switchdev that used to fail
before the patch.
---
lnst/Controller/Task.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index 84091af..6cbb165 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -617,6 +617,7 @@ class InterfaceAPI(object):
return self._if.get_netns()
def reset(self, ip=None, netns=None):
+ self._if.address_cleanup()
self._if.down()
self._if.deconfigure()
@@ -628,6 +629,7 @@ class InterfaceAPI(object):
self._if.configure()
self._if.up()
+ self._if.address_setup()
def set_addresses(self, ips):
self._if.set_addresses(ips)
--
2.7.4
7 years, 6 months
[PATCH] regression-tests: remove assert_logs from test 28
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
These checked if stdout from an exec_cmd was printed out in the result
summary. This behaviour changed in 14370a671f614cc728922a13f68963618695c656,
breaking the 28th regression test.
However, these assert_log commands are not needed for the purposes of
this regression test - the required functionality is tested from within
the python task. Because of that it's safe to remove them, in order to
fix the regression test.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
regression-tests/tests/28/run.sh | 3 ---
1 file changed, 3 deletions(-)
diff --git a/regression-tests/tests/28/run.sh b/regression-tests/tests/28/run.sh
index 9901282..a066c0f 100755
--- a/regression-tests/tests/28/run.sh
+++ b/regression-tests/tests/28/run.sh
@@ -25,9 +25,6 @@ assert_status "pass" "$rv1"
assert_status "pass" "$rv2"
assert_status "pass" "$rv3"
assert_status "pass" "$rv4"
-assert_log "INFO" "stdout:.*test" "$log1"
-assert_log "INFO" "stdout:.*test" "$log2"
-assert_log "INFO" "stdout:.*test" "$log4"
rm -f test.log
--
2.10.0
7 years, 6 months
[PATCH] NetTestSlave: kill netns subprocess before deleting namespace
by Jan Tluka
On RHEL6 the netns can't be deleted if there are processes referencing it.
The fix is to move the namespace deletion after the kill of the process.
I tested this with the LNST regression test suite both on RHEL7 and RHEL6.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NetTestSlave.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 956ce1d..8e26b4b 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -737,6 +737,10 @@ class SlaveMethods:
libc = ctypes.CDLL(libc_name)
netns_path = "/var/run/netns/" + netns
+ netns_pid = self._net_namespaces[netns]["pid"]
+ os.kill(netns_pid, signal.SIGUSR1)
+ os.waitpid(netns_pid, 0)
+
# Remove named namespace
try:
libc.umount2(netns_path, MNT_DETACH)
@@ -744,9 +748,6 @@ class SlaveMethods:
except:
logging.warning("Unable to remove named namespace %s." % netns_path)
- netns_pid = self._net_namespaces[netns]["pid"]
- os.kill(netns_pid, signal.SIGUSR1)
- os.waitpid(netns_pid, 0)
logging.debug("Network namespace %s removed." % netns)
self._net_namespaces[netns]["pipe"].close()
--
2.4.11
7 years, 6 months
[PATCH] modules: fix PktgenTx to work with python2.6
by Jan Tluka
RHEL6 has older python version 2.6.6 and that version requires an index in
formatting string, e.g. {0}
For python versions 2.7 and above the index can be omitted.
Fixes: d2bee9f ("PktgenTx: Remove all devices from all threads in init")
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/PktgenTx.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_modules/PktgenTx.py b/test_modules/PktgenTx.py
index 51fcd4c..fa32261 100644
--- a/test_modules/PktgenTx.py
+++ b/test_modules/PktgenTx.py
@@ -62,7 +62,7 @@ def pktget_options_merge(pktgen_options, default_pktgen_options):
def pktgen_devices_remove():
for cpu in range(os.sysconf('SC_NPROCESSORS_ONLN')):
- cmd = "echo rem_device_all > /proc/net/pktgen/kpktgend_{}"
+ cmd = "echo rem_device_all > /proc/net/pktgen/kpktgend_{0}"
exec_cmd(cmd.format(cpu))
class PktgenTx(TestGeneric):
--
2.4.11
7 years, 6 months
[PATCH v2] regression-tests: add simple_macsec test
by Kamil Jerabek
This patch adds new test to phase3. The topology is the same as in
phase1 simple_netperf test.
This tests covers performance of macsec over ethernet. Ping and netperf is run.
Covered are both macsec options encrypt on and off.
---
v2: Availability check by ipv4 ping between physical interfaces moved before
test loop.
Signed-off-by: Kamil Jerabek <kjerabek(a)redhat.com>
---
.../regression_tests/phase3/simple_macsec.README | 90 +++++++
recipes/regression_tests/phase3/simple_macsec.py | 282 +++++++++++++++++++++
recipes/regression_tests/phase3/simple_macsec.xml | 36 +++
3 files changed, 408 insertions(+)
create mode 100644 recipes/regression_tests/phase3/simple_macsec.README
create mode 100644 recipes/regression_tests/phase3/simple_macsec.py
create mode 100644 recipes/regression_tests/phase3/simple_macsec.xml
diff --git a/recipes/regression_tests/phase3/simple_macsec.README b/recipes/regression_tests/phase3/simple_macsec.README
new file mode 100644
index 0000000..8c5d9b4
--- /dev/null
+++ b/recipes/regression_tests/phase3/simple_macsec.README
@@ -0,0 +1,90 @@
+Topology:
+
+ switch
+ +------+
+ | |
+ | |
+ +-------------+ +-------------+
+ | | | |
+ | | | |
+ | +------+ |
+ | |
+ | |
+ +-+--+ +-+--+
++-------|eth1|------+ +-------|eth1|------+
+| +-+--+ | | +-+--+ |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| host1 | | host2 |
+| | | |
+| | | |
+| | | |
++-------------------+ +-------------------+
+
+Number of hosts: 2
+Host #1 description:
+ One ethernet device configured with ip address {$net}.1/24
+
+ Macsec interface configured with ip addresses:
+ 192.168.100.1/24
+ fc00::1/64
+
+Host #2 description:
+ One ethernet device configured with ip address {$net}.2/24
+
+ Macsec interface configured with ip addresses:
+ 192.168.100.2/24
+ fc00::2/64
+
+Test name:
+ simple_macsec.py
+Test description:
+ Ping:
+ + count: 100
+ + interval: 0.1s
+ + between physical interfaces expecting PASS
+ + between macsec interfaces expecting PASS
+ Ping6:
+ + count: 100
+ + interval: 0.1s
+ + between macsec interfaces expecting PASS
+ Netperf:
+ + duration: 60s
+ + TCP_STREAM and UDP_STREAM
+ + ipv4 and ipv6
+ + between macsec interfaces
+ Macsec
+ + tested both encryption on and off
+
+PerfRepo integration:
+ First, preparation in PerfRepo is required - you need to create Test objects
+ through the web interface that properly describe the individual Netperf
+ tests that this recipe runs. Don't forget to also add appropriate metrics.
+ For these Netperf tests it's always:
+ * throughput
+ * throughput_min
+ * throughput_max
+ * throughput_deviation
+
+ After that, to enable support for PerfRepo you need to create the file
+ vxlan_remote.mapping and define the following id mappings:
+ tcp_ipv4_id -> to store ipv4 TCP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+ tcp_ipv6_id -> to store ipv6 TCP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+ udp_ipv4_id -> to store ipv4 UDP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+ udp_ipv6_id -> to store ipv4 UDP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+
+ To enable result comparison agains baselines you need to create a Report in
+ PerfRepo that will store the baseline. Set up the Report to only contain results
+ with the same hash tag and then add a new mapping to the mapping file, with
+ this format:
+ <some_hash> = <report_id>
+
+ The hash value is automatically generated during test execution and added
+ to each result stored in PerfRepo. To get the Report id you need to open
+ that report in our browser and find if in the URL.
+
+ When running this recipe you should also define the 'product_name' alias
+ (e.g. RHEL7) in order to tag the result object in PerfRepo.
diff --git a/recipes/regression_tests/phase3/simple_macsec.py b/recipes/regression_tests/phase3/simple_macsec.py
new file mode 100644
index 0000000..2f6dd6a
--- /dev/null
+++ b/recipes/regression_tests/phase3/simple_macsec.py
@@ -0,0 +1,282 @@
+from lnst.Controller.Task import ctl
+from lnst.Controller.PerfRepoUtils import perfrepo_baseline_to_dict
+from lnst.Controller.PerfRepoUtils import netperf_result_template
+
+from lnst.RecipeCommon.ModuleWrap import ping, ping6, netperf
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
+
+# ------
+# SETUP
+# ------
+
+mapping_file = ctl.get_alias("mapping_file")
+perf_api = ctl.connect_PerfRepo(mapping_file)
+
+product_name = ctl.get_alias("product_name")
+
+m1 = ctl.get_host("machine1")
+m2 = ctl.get_host("machine2")
+
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+
+# ------
+# TESTS
+# ------
+
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = int(ctl.get_alias("netperf_duration"))
+nperf_reserve = int(ctl.get_alias("nperf_reserve"))
+nperf_confidence = ctl.get_alias("nperf_confidence")
+nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
+nperf_cpupin = ctl.get_alias("nperf_cpupin")
+nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
+nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+nperf_debug = ctl.get_alias("nperf_debug")
+nperf_max_dev = ctl.get_alias("nperf_max_dev")
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
+
+m1_phy = m1.get_interface("eth")
+m2_phy = m2.get_interface("eth")
+
+m1_phy_name = m1_phy.get_devname()
+m2_phy_name = m2_phy.get_devname()
+
+m1_phy_addr = m1_phy.get_ip()
+m2_phy_addr = m2_phy.get_ip()
+
+m1_phy_hwaddr = m1_phy.get_hwaddr()
+m2_phy_hwaddr = m2_phy.get_hwaddr()
+
+key1 = "7a16780284000775d4f0a3c0f0e092c0"
+key2 = "3212ef5c4cc5d0e4210b17208e88779e"
+
+msec_tif_name = "macsec0"
+m1_tif_addr = "192.168.100.1"
+m2_tif_addr = "192.168.100.2"
+
+m1_tif_addr6 = "fc00::1"
+m2_tif_addr6 = "fc00::2"
+
+#macsec setup
+def macsecSetup(encryption):
+ m1.run("ip link add link %s %s type macsec encrypt %s" %
+ (m1_phy_name, msec_tif_name, encryption))
+ m1.run("ip macsec add %s rx port 1 address %s" % (msec_tif_name, m2_phy_hwaddr))
+ m1.run("ip macsec add %s tx sa 0 pn 1 on key 00 %s" % (msec_tif_name, key1))
+ m1.run("ip macsec add %s rx port 1 address %s sa 0 pn 1 on key 01 %s" %
+ (msec_tif_name, m2_phy_hwaddr, key2))
+
+ m2.run("ip link add link %s %s type macsec encrypt %s" %
+ (m2_phy_name, msec_tif_name, encryption))
+ m2.run("ip macsec add %s rx port 1 address %s" % (msec_tif_name, m1_phy_hwaddr))
+ m2.run("ip macsec add %s tx sa 0 pn 1 on key 01 %s" % (msec_tif_name, key2))
+ m2.run("ip macsec add %s rx port 1 address %s sa 0 pn 1 on key 00 %s" %
+ (msec_tif_name, m1_phy_hwaddr, key1))
+
+ m1.run("ip link set %s up" % msec_tif_name)
+ m2.run("ip link set %s up" % msec_tif_name)
+
+ m1.run("ip addr add %s/24 dev %s" % (m1_tif_addr, msec_tif_name))
+ m2.run("ip addr add %s/24 dev %s" % (m2_tif_addr, msec_tif_name))
+
+ m1.run("ip -6 addr add %s/64 dev %s" % (m1_tif_addr6, msec_tif_name))
+ m2.run("ip -6 addr add %s/64 dev %s" % (m2_tif_addr6, msec_tif_name))
+
+
+if nperf_cpupin:
+ m1.run("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ dev_list = [(m1, m1_phy), (m2, m2_phy)]
+
+ # this will pin devices irqs to cpu #0
+ for m, d in dev_list:
+ pin_dev_irqs(m, d, 0)
+
+nperf_opts = ""
+if nperf_cpupin and nperf_num_parallel == 1:
+ nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
+ctl.wait(15)
+
+ping_opts = {"count": 100, "interval": 0.1}
+
+encryption_settings = ['on', 'off']
+
+#availability check
+ping((m1, m1_phy, 0, {"scope": 0}),
+ (m2, m2_phy, 0, {"scope": 0}),
+ options=ping_opts)
+
+ctl.wait(2)
+
+for setting in encryption_settings:
+ #macsec setup
+ macsecSetup(setting)
+ m1_tif = m1.get_device(msec_tif_name)
+ m2_tif = m2.get_device(msec_tif_name)
+
+ if ipv in [ 'ipv4', 'both' ]:
+ ping((m1, m1_tif, 0, {"scope": 0}),
+ (m2, m2_tif, 0, {"scope": 0}),
+ options=ping_opts)
+
+ ctl.wait(2)
+
+
+ # prepare PerfRepo result for tcp
+ result_tcp = perf_api.new_result("tcp_ipv4_id",
+ "tcp_ipv4_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_tcp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_tcp.add_tag("multithreaded")
+ result_tcp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_tcp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_tcp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ tcp_res_data = netperf((m1, m1_tif, 0, {"scope": 0}),
+ (m2, m2_tif, 0, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "TCP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts": nperf_opts},
+ baseline = baseline,
+ 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
+ result_udp = perf_api.new_result("udp_ipv4_id",
+ "udp_ipv4_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_udp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_udp.add_tag("multithreaded")
+ result_udp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_udp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_udp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ udp_res_data = netperf((m1, m1_tif, 0, {"scope": 0}),
+ (m2, m2_tif, 0, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "UDP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts": nperf_opts},
+ baseline = baseline,
+ 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)
+
+
+ if ipv in [ 'ipv6', 'both' ]:
+ ping6((m1, m1_tif, 1, {"scope": 0}),
+ (m2, m2_tif, 1, {"scope": 0}),
+ options=ping_opts)
+
+ ctl.wait(2)
+
+ # prepare PerfRepo result for tcp ipv6
+ result_tcp = perf_api.new_result("tcp_ipv6_id",
+ "tcp_ipv6_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_tcp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_tcp.add_tag("multithreaded")
+ result_tcp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_tcp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_tcp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ tcp_res_data = netperf((m1, m1_tif, 1, {"scope": 0}),
+ (m2, m2_tif, 1, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "TCP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts" : nperf_opts + " -6"},
+ baseline = baseline,
+ 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
+ result_udp = perf_api.new_result("udp_ipv6_id",
+ "udp_ipv6_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_udp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_udp.add_tag("multithreaded")
+ result_udp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_udp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_udp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ udp_res_data = netperf((m1, m1_tif, 1, {"scope": 0}),
+ (m2, m2_tif, 1, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "UDP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts" : nperf_opts + "-6"},
+ baseline = baseline,
+ 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)
+
+
+ m1.run("ip link delete %s" % msec_tif_name)
+ m2.run("ip link delete %s" % msec_tif_name)
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
diff --git a/recipes/regression_tests/phase3/simple_macsec.xml b/recipes/regression_tests/phase3/simple_macsec.xml
new file mode 100644
index 0000000..83fbccc
--- /dev/null
+++ b/recipes/regression_tests/phase3/simple_macsec.xml
@@ -0,0 +1,36 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
+ <alias name="nperf_reserve" value="20" />
+ <alias name="nperf_confidence" value="99,5" />
+ <alias name="nperf_max_runs" value="5" />
+ <alias name="nperf_num_parallel" value="1" />
+ <alias name="nperf_debug" value="0"/>
+ <alias name="nperf_max_dev" value="20%"/>
+ <alias name="mapping_file" value="simple_macsec.mapping" />
+ <alias name="net" value="192.168.0" />
+ </define>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="eth" label="tnet">
+ <addresses>
+ <address>{$net}.1/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="eth" label="tnet">
+ <addresses>
+ <address>{$net}.2/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="simple_macsec.py"/>
+</lnstrecipe>
--
2.5.5
7 years, 6 months
[PATCH v2 00/16] Quality of Service recipes
by Ido Schimmel
From: Ido Schimmel <idosch(a)mellanox.com>
Hi,
Patches 1-11 add the missing lldptool and devlink infrastructure to LNST
and also extend the PktgenTx module for the QoS recipes.
Patches 12-16 add the individual QoS recipes.
Please check the individual commit messages for more details.
Thanks.
v1->v2:
-------
* 01/16 - Replace lldpad enable / disable with generic service
enable / disable methods. Supports both Systemd and SysVinit based
systems (Ondrej)
* 03/16 - Return a dictionary of all the ethtool statistics instead
of just one stat (Ondrej)
* Make sure switchdev recipes set 'vlan_id' before 'vlan_p' in pktgen
options (Jan)
* Change the individual recipes according to the above changes
Ido Schimmel (16):
HostAPI: Add enable / disable service methods
HostAPI: Allow recipes to query number of CPUs
InterfaceAPI: Add ethtool statistics query
InterfaceAPI: Add LLDP support
InterfaceAPI: Add PAUSE frames setting methods
PktgenTx: Add per-thread options
PktgenTx: Remove all devices from all threads in init
recipes: switchdev: TestLib: Add wrappers for LLDP operations
recipes: switchdev: TestLib: Add wrappers for devlink operations
recipes: switchdev: TestLib: Add kwargs support for pktgen invocation
recipes: switchdev: TestLib: Set VLAN ID before PCP
recipes: switchdev: qos: Add recipe for PCP to PG mapping
recipes: switchdev: qos: Add recipe for PCP to TC mapping
recipes: switchdev: qos: Add recipe for PAUSE frames
recipes: switchdev: qos: Add recipe for PFC frames
recipes: switchdev: qos: Add recipe for ETS
lnst/Controller/Machine.py | 34 +++++++
lnst/Controller/Task.py | 21 +++++
lnst/Slave/InterfaceManager.py | 22 +++++
lnst/Slave/NetConfigDevice.py | 20 ++++
lnst/Slave/NetTestSlave.py | 54 +++++++++++
recipes/switchdev/TestLib.py | 168 +++++++++++++++++++++++++++++++++-
recipes/switchdev/default_aliases.xml | 4 +
recipes/switchdev/qos-001-pg.py | 71 ++++++++++++++
recipes/switchdev/qos-001-pg.xml | 22 +++++
recipes/switchdev/qos-002-tc.py | 71 ++++++++++++++
recipes/switchdev/qos-002-tc.xml | 22 +++++
recipes/switchdev/qos-003-pause.py | 91 ++++++++++++++++++
recipes/switchdev/qos-003-pause.xml | 22 +++++
recipes/switchdev/qos-004-pfc.py | 95 +++++++++++++++++++
recipes/switchdev/qos-004-pfc.xml | 22 +++++
recipes/switchdev/qos-005-ets.py | 133 +++++++++++++++++++++++++++
recipes/switchdev/qos-005-ets.xml | 22 +++++
test_modules/PktgenTx.py | 16 +++-
18 files changed, 904 insertions(+), 6 deletions(-)
create mode 100644 recipes/switchdev/qos-001-pg.py
create mode 100644 recipes/switchdev/qos-001-pg.xml
create mode 100644 recipes/switchdev/qos-002-tc.py
create mode 100644 recipes/switchdev/qos-002-tc.xml
create mode 100644 recipes/switchdev/qos-003-pause.py
create mode 100644 recipes/switchdev/qos-003-pause.xml
create mode 100644 recipes/switchdev/qos-004-pfc.py
create mode 100644 recipes/switchdev/qos-004-pfc.xml
create mode 100644 recipes/switchdev/qos-005-ets.py
create mode 100644 recipes/switchdev/qos-005-ets.xml
--
2.7.4
7 years, 6 months
[PATCH] regression-tests: add simple_macsec test
by Kamil Jerabek
This patch adds new test to phase3. The topology is the same as in
phase1 simple_netperf test.
This tests covers performance of macsec over ethernet. Ping and netperf is run.
Covered are both macsec options encrypt on and off.
Signed-off-by: Kamil Jerabek <kjerabek(a)redhat.com>
---
.../regression_tests/phase3/simple_macsec.README | 90 +++++++
recipes/regression_tests/phase3/simple_macsec.py | 280 +++++++++++++++++++++
recipes/regression_tests/phase3/simple_macsec.xml | 37 +++
3 files changed, 407 insertions(+)
create mode 100644 recipes/regression_tests/phase3/simple_macsec.README
create mode 100644 recipes/regression_tests/phase3/simple_macsec.py
create mode 100644 recipes/regression_tests/phase3/simple_macsec.xml
diff --git a/recipes/regression_tests/phase3/simple_macsec.README b/recipes/regression_tests/phase3/simple_macsec.README
new file mode 100644
index 0000000..571a659
--- /dev/null
+++ b/recipes/regression_tests/phase3/simple_macsec.README
@@ -0,0 +1,90 @@
+Topology:
+
+ switch
+ +------+
+ | |
+ | |
+ +-------------+ +-------------+
+ | | | |
+ | | | |
+ | +------+ |
+ | |
+ | |
+ +-+--+ +-+--+
++-------|eth1|------+ +-------|eth1|------+
+| +-+--+ | | +-+--+ |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| host1 | | host2 |
+| | | |
+| | | |
+| | | |
++-------------------+ +-------------------+
+
+Number of hosts: 2
+Host #1 description:
+ One ethernet device configured with ip address {$net}.1/24
+
+ Macsec interface configured with ip addresses:
+ 192.168.100.1/24
+ fc00::1/64
+
+Host #2 description:
+ One ethernet device configured with ip address {$net}.2/24
+
+ Macsec interface configured with ip addresses:
+ 192.168.100.2/24
+ fc00::2/64
+
+Test name:
+ simple_macsec.py
+Test description:
+ Ping:
+ + count: 100
+ + interval: 0.1s
+ + between physical interfaces expecting PASS
+ + between macsec interfaces expecting PASS
+ Ping6:
+ + count: 100
+ + interval: 0.1s
+ + between macsec interfaces expecting PASS
+ Netperf:
+ + duration: 60s
+ + TCP_STREAM and UDP_STREAM
+ + ipv4 and ipv6
+ + between physical interfaces
+ Macsec
+ + tested both encryption on and off
+
+PerfRepo integration:
+ First, preparation in PerfRepo is required - you need to create Test objects
+ through the web interface that properly describe the individual Netperf
+ tests that this recipe runs. Don't forget to also add appropriate metrics.
+ For these Netperf tests it's always:
+ * throughput
+ * throughput_min
+ * throughput_max
+ * throughput_deviation
+
+ After that, to enable support for PerfRepo you need to create the file
+ vxlan_remote.mapping and define the following id mappings:
+ tcp_ipv4_id -> to store ipv4 TCP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+ tcp_ipv6_id -> to store ipv6 TCP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+ udp_ipv4_id -> to store ipv4 UDP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+ udp_ipv6_id -> to store ipv4 UDP_STREAM Netperf test results, maps to TestUid of a PerfRepo Test object
+
+ To enable result comparison agains baselines you need to create a Report in
+ PerfRepo that will store the baseline. Set up the Report to only contain results
+ with the same hash tag and then add a new mapping to the mapping file, with
+ this format:
+ <some_hash> = <report_id>
+
+ The hash value is automatically generated during test execution and added
+ to each result stored in PerfRepo. To get the Report id you need to open
+ that report in our browser and find if in the URL.
+
+ When running this recipe you should also define the 'product_name' alias
+ (e.g. RHEL7) in order to tag the result object in PerfRepo.
diff --git a/recipes/regression_tests/phase3/simple_macsec.py b/recipes/regression_tests/phase3/simple_macsec.py
new file mode 100644
index 0000000..9cd9c56
--- /dev/null
+++ b/recipes/regression_tests/phase3/simple_macsec.py
@@ -0,0 +1,280 @@
+from lnst.Controller.Task import ctl
+from lnst.Controller.PerfRepoUtils import perfrepo_baseline_to_dict
+from lnst.Controller.PerfRepoUtils import netperf_result_template
+
+from lnst.RecipeCommon.ModuleWrap import ping, ping6, netperf
+from lnst.RecipeCommon.IRQ import pin_dev_irqs
+from lnst.RecipeCommon.PerfRepo import generate_perfrepo_comment
+
+# ------
+# SETUP
+# ------
+
+mapping_file = ctl.get_alias("mapping_file")
+perf_api = ctl.connect_PerfRepo(mapping_file)
+
+product_name = ctl.get_alias("product_name")
+
+m1 = ctl.get_host("machine1")
+m2 = ctl.get_host("machine2")
+
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+
+# ------
+# TESTS
+# ------
+
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = int(ctl.get_alias("netperf_duration"))
+nperf_reserve = int(ctl.get_alias("nperf_reserve"))
+nperf_confidence = ctl.get_alias("nperf_confidence")
+nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
+nperf_cpupin = ctl.get_alias("nperf_cpupin")
+nperf_cpu_util = ctl.get_alias("nperf_cpu_util")
+nperf_num_parallel = int(ctl.get_alias("nperf_num_parallel"))
+nperf_debug = ctl.get_alias("nperf_debug")
+nperf_max_dev = ctl.get_alias("nperf_max_dev")
+pr_user_comment = ctl.get_alias("perfrepo_comment")
+
+pr_comment = generate_perfrepo_comment([m1, m2], pr_user_comment)
+
+m1_phy = m1.get_interface("eth")
+m2_phy = m2.get_interface("eth")
+
+m1_phy_name = m1_phy.get_devname()
+m2_phy_name = m2_phy.get_devname()
+
+m1_phy_addr = m1_phy.get_ip()
+m2_phy_addr = m2_phy.get_ip()
+
+m1_phy_hwaddr = m1_phy.get_hwaddr()
+m2_phy_hwaddr = m2_phy.get_hwaddr()
+
+key1 = "7a16780284000775d4f0a3c0f0e092c0"
+key2 = "3212ef5c4cc5d0e4210b17208e88779e"
+
+msec_tif_name = "macsec0"
+m1_tif_addr = "192.168.100.1"
+m2_tif_addr = "192.168.100.2"
+
+m1_tif_addr6 = "fc00::1"
+m2_tif_addr6 = "fc00::2"
+
+#macsec setup
+def macsecSetup(encryption):
+ m1.run("ip link add link %s %s type macsec encrypt %s" %
+ (m1_phy_name, msec_tif_name, encryption))
+ m1.run("ip macsec add %s rx port 1 address %s" % (msec_tif_name, m2_phy_hwaddr))
+ m1.run("ip macsec add %s tx sa 0 pn 1 on key 00 %s" % (msec_tif_name, key1))
+ m1.run("ip macsec add %s rx port 1 address %s sa 0 pn 1 on key 01 %s" %
+ (msec_tif_name, m2_phy_hwaddr, key2))
+
+ m2.run("ip link add link %s %s type macsec encrypt %s" %
+ (m2_phy_name, msec_tif_name, encryption))
+ m2.run("ip macsec add %s rx port 1 address %s" % (msec_tif_name, m1_phy_hwaddr))
+ m2.run("ip macsec add %s tx sa 0 pn 1 on key 01 %s" % (msec_tif_name, key2))
+ m2.run("ip macsec add %s rx port 1 address %s sa 0 pn 1 on key 00 %s" %
+ (msec_tif_name, m1_phy_hwaddr, key1))
+
+ m1.run("ip link set %s up" % msec_tif_name)
+ m2.run("ip link set %s up" % msec_tif_name)
+
+ m1.run("ip addr add %s/24 dev %s" % (m1_tif_addr, msec_tif_name))
+ m2.run("ip addr add %s/24 dev %s" % (m2_tif_addr, msec_tif_name))
+
+ m1.run("ip -6 addr add %s/64 dev %s" % (m1_tif_addr6, msec_tif_name))
+ m2.run("ip -6 addr add %s/64 dev %s" % (m2_tif_addr6, msec_tif_name))
+
+
+if nperf_cpupin:
+ m1.run("service irqbalance stop")
+ m2.run("service irqbalance stop")
+
+ dev_list = [(m1, m1_phy), (m2, m2_phy)]
+
+ # this will pin devices irqs to cpu #0
+ for m, d in dev_list:
+ pin_dev_irqs(m, d, 0)
+
+nperf_opts = ""
+if nperf_cpupin and nperf_num_parallel == 1:
+ nperf_opts = " -T%s,%s" % (nperf_cpupin, nperf_cpupin)
+
+ctl.wait(15)
+
+ping_opts = {"count": 100, "interval": 0.1}
+
+encryption_settings = ['on', 'off']
+
+for setting in encryption_settings:
+ #macsec setup
+ macsecSetup(setting)
+ m1_tif = m1.get_device(msec_tif_name)
+ m2_tif = m2.get_device(msec_tif_name)
+
+ if ipv in [ 'ipv4', 'both' ]:
+ ping((m1, m1_tif, 0, {"scope": 0}),
+ (m2, m2_tif, 0, {"scope": 0}),
+ options=ping_opts)
+
+ ctl.wait(2)
+
+ ping((m1, m1_phy, 0, {"scope": 0}),
+ (m2, m2_phy, 0, {"scope": 0}),
+ options=ping_opts)
+
+ ctl.wait(2)
+
+ # prepare PerfRepo result for tcp
+ result_tcp = perf_api.new_result("tcp_ipv4_id",
+ "tcp_ipv4_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_tcp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_tcp.add_tag("multithreaded")
+ result_tcp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_tcp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_tcp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ tcp_res_data = netperf((m1, m1_tif, 0, {"scope": 0}),
+ (m2, m2_tif, 0, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "TCP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts": nperf_opts},
+ baseline = baseline,
+ 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
+ result_udp = perf_api.new_result("udp_ipv4_id",
+ "udp_ipv4_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_udp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_udp.add_tag("multithreaded")
+ result_udp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_udp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_udp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ udp_res_data = netperf((m1, m1_tif, 0, {"scope": 0}),
+ (m2, m2_tif, 0, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "UDP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts": nperf_opts},
+ baseline = baseline,
+ 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)
+
+
+ if ipv in [ 'ipv6', 'both' ]:
+ ping6((m1, m1_tif, 1, {"scope": 0}),
+ (m2, m2_tif, 1, {"scope": 0}),
+ options=ping_opts)
+
+ ctl.wait(2)
+
+ # prepare PerfRepo result for tcp ipv6
+ result_tcp = perf_api.new_result("tcp_ipv6_id",
+ "tcp_ipv6_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_tcp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_tcp.add_tag("multithreaded")
+ result_tcp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_tcp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_tcp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ tcp_res_data = netperf((m1, m1_tif, 1, {"scope": 0}),
+ (m2, m2_tif, 1, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "TCP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts" : nperf_opts + " -6"},
+ baseline = baseline,
+ 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
+ result_udp = perf_api.new_result("udp_ipv6_id",
+ "udp_ipv6_result",
+ hash_ignore=[
+ r'kernel_release',
+ r'redhat_release'])
+ result_udp.add_tag(product_name)
+ if nperf_num_parallel > 1:
+ result_udp.add_tag("multithreaded")
+ result_udp.set_parameter('num_parallel', nperf_num_parallel)
+
+ result_udp.set_parameter('encryption', setting)
+
+ baseline = perf_api.get_baseline_of_result(result_udp)
+ baseline = perfrepo_baseline_to_dict(baseline)
+
+ udp_res_data = netperf((m1, m1_tif, 1, {"scope": 0}),
+ (m2, m2_tif, 1, {"scope": 0}),
+ client_opts={"duration" : netperf_duration,
+ "testname" : "UDP_STREAM",
+ "confidence" : nperf_confidence,
+ "num_parallel" : nperf_num_parallel,
+ "cpu_util" : nperf_cpu_util,
+ "runs": nperf_max_runs,
+ "debug": nperf_debug,
+ "max_deviation": nperf_max_dev,
+ "netperf_opts" : nperf_opts + "-6"},
+ baseline = baseline,
+ 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)
+
+
+ m1.run("ip link delete %s" % msec_tif_name)
+ m2.run("ip link delete %s" % msec_tif_name)
+
+if nperf_cpupin:
+ m1.run("service irqbalance start")
+ m2.run("service irqbalance start")
diff --git a/recipes/regression_tests/phase3/simple_macsec.xml b/recipes/regression_tests/phase3/simple_macsec.xml
new file mode 100644
index 0000000..275db4a
--- /dev/null
+++ b/recipes/regression_tests/phase3/simple_macsec.xml
@@ -0,0 +1,37 @@
+<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
+ <alias name="nperf_reserve" value="20" />
+ <alias name="nperf_confidence" value="99,5" />
+ <alias name="nperf_max_runs" value="5" />
+ <alias name="nperf_mode" value="default" />
+ <alias name="nperf_num_parallel" value="2" />
+ <alias name="nperf_debug" value="0"/>
+ <alias name="nperf_max_dev" value="20%"/>
+ <alias name="mapping_file" value="simple_macsec.mapping" />
+ <alias name="net" value="192.168.0" />
+ </define>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="eth" label="tnet">
+ <addresses>
+ <address>{$net}.1/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="eth" label="tnet">
+ <addresses>
+ <address>{$net}.2/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="simple_macsec.py"/>
+</lnstrecipe>
--
2.5.5
7 years, 6 months