[PATCH 1/2] test_tools: added pin_dev_irqs
by Jan Tluka
This tool can be used to move IRQs assigned to a device to a specific CPU.
It's a simple shell script that takes two arguments, device name and
cpu. IRQs are determined by device name.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_tools/pin_dev_irqs/lnst-setup.sh | 4 ++++
test_tools/pin_dev_irqs/pin_dev_irqs.sh | 14 ++++++++++++++
2 files changed, 18 insertions(+)
create mode 100755 test_tools/pin_dev_irqs/lnst-setup.sh
create mode 100755 test_tools/pin_dev_irqs/pin_dev_irqs.sh
diff --git a/test_tools/pin_dev_irqs/lnst-setup.sh b/test_tools/pin_dev_irqs/lnst-setup.sh
new file mode 100755
index 0000000..feab344
--- /dev/null
+++ b/test_tools/pin_dev_irqs/lnst-setup.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+chmod u+x pin_dev_irqs.sh
+
diff --git a/test_tools/pin_dev_irqs/pin_dev_irqs.sh b/test_tools/pin_dev_irqs/pin_dev_irqs.sh
new file mode 100755
index 0000000..316f14d
--- /dev/null
+++ b/test_tools/pin_dev_irqs/pin_dev_irqs.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+DEV=$1
+CPU=$2
+
+dev_irqs=`grep $DEV /proc/interrupts | cut -f1 -d: | sed 's/ //'`
+
+for irq in $dev_irqs; do
+ echo "current cpu list for irq $irq"
+ cat /proc/irq/$irq/smp_affinity_list
+ echo "reassigning irq $irq to cpu $CPU"
+ echo $CPU > /proc/irq/$irq/smp_affinity_list
+done
+
--
2.4.3
8 years, 4 months
Using common code in python tasks
by Jan Tluka
This is a followup to the recent email thread [1] about pin_dev_irqs
test tool. Since irqs are under /proc directory it makes sense to use
HostAPI.config() method to set it and have LNST set it back when the
recipe finishes. So I decided to implement it in python and I'd like to
use this python code for all python tasks under
recipes/regression_tests/phase{1,2}.
So I placed it in recipes/regression_tests/common/common.py
I thought that I could use relative imports as described in [2] but this
did not work for me due to following error:
ValueError: Attempted relative import in non-package
Based on info I have found on forums I'm almost sure that this simply
can't be done with the current design how we handle python tasks.
Another solution that is possible and working without any support from
LNST is using following code in python tasks:
<cut>
# FILE: recipes/regression_tests/phase1/3_vlans.py
from imp import load_source
load_source("common", '../common/common.py')
from common import pin_dev_irqs
pin_dev_irqs()
</cut>
And the directory structure is following:
recipes/regression_tests/common
./common.py
recipes/regression_tests/phase1
./3_vlans.py
I'd like to get your opinion on this.
-Jan
[1] https://lists.fedorahosted.org/pipermail/lnst-developers/2015-November/00...
[2] https://docs.python.org/2/tutorial/modules.html#intra-package-references
8 years, 4 months
[PATCH] recipes: add aliases for ip addresses in phase1 and phase2 tests
by Jan Tluka
This patch adds few aliases to use other vlans and ipv4 address networks
than hardcoded ones.
For vlan setups aliases are:
vlan10_net=192.168.10
vlan10_tag=10
vlan20_net=192.168.20
vlan10_tag=20
vlan30_net=192.168.30
vlan10_tag=30
For baremetal setups:
net=192.168.0 this may vary between xmls
To use in lnst-ctl run:
lnst-ctl -A vlan10_tag=111 -A vlan20_tag=222 -A vlan30_tag=333 3_vlans.xml
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.xml | 30 +++++++++++++---------
.../phase1/3_vlans_over_active_backup_bond.xml | 30 +++++++++++++---------
.../regression_tests/phase1/active_backup_bond.xml | 5 ++--
.../phase1/active_backup_double_bond.xml | 5 ++--
recipes/regression_tests/phase1/ping_flood.xml | 5 ++--
...tual_bridge_2_vlans_over_active_backup_bond.xml | 28 +++++++++++---------
.../phase1/virtual_bridge_vlan_in_guest.xml | 12 +++++----
.../phase1/virtual_bridge_vlan_in_host.xml | 12 +++++----
.../phase2/3_vlans_over_active_backup_team.xml | 30 +++++++++++++---------
.../phase2/active_backup_double_team.xml | 7 +++--
.../regression_tests/phase2/active_backup_team.xml | 5 ++--
.../active_backup_team_vs_active_backup_bond.xml | 7 +++--
..._ovs_bridge_2_vlans_over_active_backup_bond.xml | 20 +++++++++------
.../phase2/virtual_ovs_bridge_vlan_in_guest.xml | 10 +++++---
.../phase2/virtual_ovs_bridge_vlan_in_host.xml | 10 +++++---
15 files changed, 126 insertions(+), 90 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.xml b/recipes/regression_tests/phase1/3_vlans.xml
index 18fc539..318508d 100644
--- a/recipes/regression_tests/phase1/3_vlans.xml
+++ b/recipes/regression_tests/phase1/3_vlans.xml
@@ -7,6 +7,12 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5"/>
<alias name="mapping_file" value="3_vlans.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
+ <alias name="vlan20_net" value="192.168.20"/>
+ <alias name="vlan20_tag" value="20"/>
+ <alias name="vlan30_net" value="192.168.30"/>
+ <alias name="vlan30_tag" value="30"/>
</define>
<network>
<host id="testmachine1">
@@ -14,37 +20,37 @@
<eth id="eth1" label="tnet" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.10.1/24" />
+ <address value="{$vlan10_net}.1/24" />
<address value="2002::10:1/64" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.20.1/24" />
+ <address value="{$vlan20_net}.1/24" />
<address value="2002::20:1/64" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
- <option name="vlan_tci" value="30" />
+ <option name="vlan_tci" value="{$vlan30_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.30.1/24" />
+ <address value="{$vlan30_net}.1/24" />
<address value="2002::30:1/64" />
</addresses>
</vlan>
@@ -55,37 +61,37 @@
<eth id="eth1" label="tnet" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.10.2/24" />
+ <address value="{$vlan10_net}.2/24" />
<address value="2002::10:2/64" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.20.2/24" />
+ <address value="{$vlan20_net}.2/24" />
<address value="2002::20:2/64" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
- <option name="vlan_tci" value="30" />
+ <option name="vlan_tci" value="{$vlan30_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.30.2/24" />
+ <address value="{$vlan30_net}.2/24" />
<address value="2002::30:2/64" />
</addresses>
</vlan>
diff --git a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
index a412adc..36a3659 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
@@ -7,6 +7,12 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5"/>
<alias name="mapping_file" value="3_vlans_over_active_backup_bond.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
+ <alias name="vlan20_net" value="192.168.20"/>
+ <alias name="vlan20_tag" value="20"/>
+ <alias name="vlan30_net" value="192.168.30"/>
+ <alias name="vlan30_tag" value="30"/>
</define>
<network>
<host id="testmachine1">
@@ -28,37 +34,37 @@
</bond>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="test_bond" />
</slaves>
<addresses>
- <address value="192.168.10.1/24" />
+ <address value="{$vlan10_net}.1/24" />
<address value="2002::10:1/64" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="test_bond" />
</slaves>
<addresses>
- <address value="192.168.20.1/24" />
+ <address value="{$vlan20_net}.1/24" />
<address value="2002::20:1/64" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
- <option name="vlan_tci" value="30" />
+ <option name="vlan_tci" value="{$vlan30_tag}" />
</options>
<slaves>
<slave id="test_bond" />
</slaves>
<addresses>
- <address value="192.168.30.1/24" />
+ <address value="{$vlan30_net}.1/24" />
<address value="2002::30:1/64" />
</addresses>
</vlan>
@@ -69,37 +75,37 @@
<eth id="eth1" label="tnet" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.10.2/24" />
+ <address value="{$vlan10_net}.2/24" />
<address value="2002::10:2/64" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.20.2/24" />
+ <address value="{$vlan20_net}.2/24" />
<address value="2002::20:2/64" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
- <option name="vlan_tci" value="30" />
+ <option name="vlan_tci" value="{$vlan30_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.30.2/24" />
+ <address value="{$vlan30_net}.2/24" />
<address value="2002::30:2/64" />
</addresses>
</vlan>
diff --git a/recipes/regression_tests/phase1/active_backup_bond.xml b/recipes/regression_tests/phase1/active_backup_bond.xml
index c9b3883..26e338d 100644
--- a/recipes/regression_tests/phase1/active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_bond.xml
@@ -7,6 +7,7 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5"/>
<alias name="mapping_file" value="active_backup_bond.mapping" />
+ <alias name="net" value="192.168.0"/>
</define>
<network>
<host id="testmachine1">
@@ -23,7 +24,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.1/24" />
+ <address value="{$net}.1/24" />
<address value="2002::1/64"/>
</addresses>
</bond>
@@ -33,7 +34,7 @@
<interfaces>
<eth id="test_if" label="tnet">
<addresses>
- <address value="192.168.0.2/24" />
+ <address value="{$net}.2/24" />
<address value="2002::2/64"/>
</addresses>
</eth>
diff --git a/recipes/regression_tests/phase1/active_backup_double_bond.xml b/recipes/regression_tests/phase1/active_backup_double_bond.xml
index 45258e9..044510a 100644
--- a/recipes/regression_tests/phase1/active_backup_double_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_double_bond.xml
@@ -7,6 +7,7 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5"/>
<alias name="mapping_file" value="active_backup_double_bond.mapping" />
+ <alias name="net" value="192.168.0"/>
</define>
<network>
<host id="testmachine1">
@@ -23,7 +24,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.1/24" />
+ <address value="{$net}.1/24" />
<address value="2002::1/64"/>
</addresses>
</bond>
@@ -43,7 +44,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.2/24" />
+ <address value="{$net}.2/24" />
<address value="2002::2/64"/>
</addresses>
</bond>
diff --git a/recipes/regression_tests/phase1/ping_flood.xml b/recipes/regression_tests/phase1/ping_flood.xml
index 9409227..29aa3ac 100644
--- a/recipes/regression_tests/phase1/ping_flood.xml
+++ b/recipes/regression_tests/phase1/ping_flood.xml
@@ -2,13 +2,14 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="net" value="192.168.101" />
</define>
<network>
<host id="machine1">
<interfaces>
<eth id="testiface" label="testnet">
<addresses>
- <address>192.168.101.10/24</address>
+ <address>{$net}.10/24</address>
<address>2002::1/64</address>
</addresses>
</eth>
@@ -18,7 +19,7 @@
<interfaces>
<eth id="testiface" label="testnet">
<addresses>
- <address>192.168.101.11/24</address>
+ <address>{$net}.11/24</address>
<address>2002::2/64</address>
</addresses>
</eth>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
index 04de618..e4c648e 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
@@ -7,6 +7,10 @@
<alias name="nperf_max_runs" value="5"/>
<alias name="mtu" value="1500" />
<alias name="mapping_file" value="virtual_bridge_2_vlans_over_active_backup_bond.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
+ <alias name="vlan20_net" value="192.168.20"/>
+ <alias name="vlan20_tag" value="20"/>
</define>
<network>
<host id="host1">
@@ -30,7 +34,7 @@
</bond>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="bond" />
@@ -38,7 +42,7 @@
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="bond" />
@@ -50,7 +54,7 @@
<slave id="vlan10" />
</slaves>
<addresses>
- <address>192.168.10.10/24</address>
+ <address>{$vlan10_net}.10/24</address>
</addresses>
</bridge>
<bridge id="br2">
@@ -59,7 +63,7 @@
<slave id="vlan20" />
</slaves>
<addresses>
- <address>192.168.20.10/24</address>
+ <address>{$vlan20_net}.10/24</address>
</addresses>
</bridge>
</interfaces>
@@ -68,7 +72,7 @@
<interfaces>
<eth id="guestnic" label="to_guest1">
<addresses>
- <address>192.168.10.100/24</address>
+ <address>{$vlan10_net}.100/24</address>
<address value="2002::10:100/64"/>
</addresses>
</eth>
@@ -78,7 +82,7 @@
<interfaces>
<eth id="guestnic" label="to_guest2">
<addresses>
- <address>192.168.20.100/24</address>
+ <address>{$vlan20_net}.100/24</address>
<address value="2002::20:100/64"/>
</addresses>
</eth>
@@ -106,7 +110,7 @@
</bond>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="bond" />
@@ -114,7 +118,7 @@
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="bond" />
@@ -126,7 +130,7 @@
<slave id="tap1"/>
</slaves>
<addresses>
- <address>192.168.10.11/24</address>
+ <address>{$vlan10_net}.11/24</address>
</addresses>
</bridge>
<bridge id="br2">
@@ -135,7 +139,7 @@
<slave id="tap2"/>
</slaves>
<addresses>
- <address>192.168.20.11/24</address>
+ <address>{$vlan20_net}.11/24</address>
</addresses>
</bridge>
</interfaces>
@@ -144,7 +148,7 @@
<interfaces>
<eth id="guestnic" label="to_guest3">
<addresses>
- <address>192.168.10.101/24</address>
+ <address>{$vlan10_net}.101/24</address>
<address value="2002::10:101/64"/>
</addresses>
</eth>
@@ -154,7 +158,7 @@
<interfaces>
<eth id="guestnic" label="to_guest4">
<addresses>
- <address>192.168.20.101/24</address>
+ <address>{$vlan20_net}.101/24</address>
<address value="2002::20:101/64"/>
</addresses>
</eth>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
index 7d36ba5..b8ec826 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
@@ -7,6 +7,8 @@
<alias name="nperf_max_runs" value="5"/>
<alias name="mtu" value="1500" />
<alias name="mapping_file" value="virtual_bridge_vlan_in_guest.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
</define>
<network>
<host id="host1">
@@ -19,7 +21,7 @@
<slave id="nic" />
</slaves>
<addresses>
- <address>192.168.10.1/24</address>
+ <address>{$vlan10_net}.1/24</address>
</addresses>
</bridge>
</interfaces>
@@ -33,13 +35,13 @@
</eth>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="guestnic" />
</slaves>
<addresses>
- <address>192.168.10.10/24</address>
+ <address>{$vlan10_net}.10/24</address>
<address>2002::10:10/64</address>
</addresses>
</vlan>
@@ -50,13 +52,13 @@
<eth id="nic" label="to_switch" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="nic" />
</slaves>
<addresses>
- <address>192.168.10.11/24</address>
+ <address>{$vlan10_net}.11/24</address>
<address>2002::10:11/64</address>
</addresses>
</vlan>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
index ae351b2..9c867a9 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
@@ -7,6 +7,8 @@
<alias name="nperf_max_runs" value="5"/>
<alias name="mtu" value="1500" />
<alias name="mapping_file" value="virtual_bridge_vlan_in_host.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
</define>
<network>
<host id="host1">
@@ -15,7 +17,7 @@
<eth id="tap" label="to_guest" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="nic" />
@@ -27,7 +29,7 @@
<slave id="vlan10" />
</slaves>
<addresses>
- <address>192.168.10.1/24</address>
+ <address>{$vlan10_net}.1/24</address>
</addresses>
</bridge>
</interfaces>
@@ -39,7 +41,7 @@
<param name="driver" value="virtio" />
</params>
<addresses>
- <address>192.168.10.10/24</address>
+ <address>{$vlan10_net}.10/24</address>
<address>2002::10:10/64</address>
</addresses>
</eth>
@@ -50,13 +52,13 @@
<eth id="nic" label="to_switch" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="nic" />
</slaves>
<addresses>
- <address>192.168.10.11/24</address>
+ <address>{$vlan10_net}.11/24</address>
<address>2002::10:11/64</address>
</addresses>
</vlan>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
index 2d2d6bf..1eb5a3a 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
@@ -7,6 +7,12 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="3_vlans_over_active_backup_team.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
+ <alias name="vlan20_net" value="192.168.20"/>
+ <alias name="vlan20_tag" value="20"/>
+ <alias name="vlan30_net" value="192.168.30"/>
+ <alias name="vlan30_tag" value="30"/>
</define>
<network>
<host id="testmachine1">
@@ -32,37 +38,37 @@
</team>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
- <address value="192.168.10.1/24" />
+ <address value="{$vlan10_net}.1/24" />
<address value="2002::10:1/64" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
- <address value="192.168.20.1/24" />
+ <address value="{$vlan20_net}.1/24" />
<address value="2002::20:1/64" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
- <option name="vlan_tci" value="30" />
+ <option name="vlan_tci" value="{$vlan30_tag}" />
</options>
<slaves>
<slave id="test_if" />
</slaves>
<addresses>
- <address value="192.168.30.1/24" />
+ <address value="{$vlan30_net}.1/24" />
<address value="2002::30:1/64" />
</addresses>
</vlan>
@@ -73,37 +79,37 @@
<eth id="eth1" label="tnet" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.10.2/24" />
+ <address value="{$vlan10_net}.2/24" />
<address value="2002::10:2/64" />
</addresses>
</vlan>
<vlan id="vlan20">
<options>
- <option name="vlan_tci" value="20" />
+ <option name="vlan_tci" value="{$vlan20_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.20.2/24" />
+ <address value="{$vlan20_net}.2/24" />
<address value="2002::20:2/64" />
</addresses>
</vlan>
<vlan id="vlan30">
<options>
- <option name="vlan_tci" value="30" />
+ <option name="vlan_tci" value="{$vlan30_tag}" />
</options>
<slaves>
<slave id="eth1" />
</slaves>
<addresses>
- <address value="192.168.30.2/24" />
+ <address value="{$vlan30_net}.2/24" />
<address value="2002::30:2/64" />
</addresses>
</vlan>
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml
index 34ed65e..8c2d5b7 100644
--- a/recipes/regression_tests/phase2/active_backup_double_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_double_team.xml
@@ -7,6 +7,7 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="active_backup_double_team.mapping" />
+ <alias name="net" value="192.168.0"/>
</define>
<network>
<host id="testmachine1">
@@ -27,7 +28,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.1/24" />
+ <address value="{$net}.1/24" />
<address value="2002::1/64" />
</addresses>
</team>
@@ -51,7 +52,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.2/24" />
+ <address value="{$net}.2/24" />
<address value="2002::2/64" />
</addresses>
</team>
@@ -61,5 +62,3 @@
<task python="team_test.py" />
</lnstrecipe>
-
-
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml
index ac3eb6f..4e7d419 100644
--- a/recipes/regression_tests/phase2/active_backup_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_team.xml
@@ -7,6 +7,7 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="active_backup_team.mapping" />
+ <alias name="net" value="192.168.0"/>
</define>
<network>
<host id="testmachine1">
@@ -27,7 +28,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.1/24" />
+ <address value="{$net}.1/24" />
<address value="2002::1/64" />
</addresses>
</team>
@@ -37,7 +38,7 @@
<interfaces>
<eth id="test_if" label="tnet">
<addresses>
- <address value="192.168.0.2/24" />
+ <address value="{$net}.2/24" />
<address value="2002::2/64" />
</addresses>
</eth>
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 d20348e..e421d2c 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
@@ -7,6 +7,7 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="active_backup_team_vs_active_backup_bond.mapping" />
+ <alias name="net" value="192.168.0"/>
</define>
<network>
<host id="testmachine1">
@@ -27,7 +28,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.1/24" />
+ <address value="{$net}.1/24" />
<address value="2002::1/64" />
</addresses>
</team>
@@ -47,7 +48,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="192.168.0.2/24" />
+ <address value="{$net}.2/24" />
<address value="2002::2/64" />
</addresses>
</bond>
@@ -57,5 +58,3 @@
<task python="team_test.py" />
</lnstrecipe>
-
-
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
index 97f9b6e..0d5fcf1 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
@@ -6,6 +6,10 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="virtual_ovs_bridge_2_vlans_over_active_backup_bond.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
+ <alias name="vlan20_net" value="192.168.20"/>
+ <alias name="vlan20_tag" value="20"/>
</define>
<network>
<host id="host1">
@@ -21,12 +25,12 @@
<slave id="tap1"/>
<slave id="tap2"/>
</slaves>
- <vlan tag="10">
+ <vlan tag="{$vlan10_tag}">
<slaves>
<slave id="tap1"/>
</slaves>
</vlan>
- <vlan tag="20">
+ <vlan tag="{$vlan20_tag}">
<slaves>
<slave id="tap2"/>
</slaves>
@@ -48,7 +52,7 @@
<interfaces>
<eth id="guestnic" label="to_guest1">
<addresses>
- <address>192.168.10.100/24</address>
+ <address>{$vlan10_net}.100/24</address>
<address>2002::10:100/64</address>
</addresses>
</eth>
@@ -58,7 +62,7 @@
<interfaces>
<eth id="guestnic" label="to_guest2">
<addresses>
- <address>192.168.20.100/24</address>
+ <address>{$vlan20_net}.100/24</address>
<address>2002::20:100/64</address>
</addresses>
</eth>
@@ -78,12 +82,12 @@
<slave id="tap1"/>
<slave id="tap2"/>
</slaves>
- <vlan tag="10">
+ <vlan tag="{$vlan10_tag}">
<slaves>
<slave id="tap1"/>
</slaves>
</vlan>
- <vlan tag="20">
+ <vlan tag="{$vlan20_tag}">
<slaves>
<slave id="tap2"/>
</slaves>
@@ -105,7 +109,7 @@
<interfaces>
<eth id="guestnic" label="to_guest3">
<addresses>
- <address>192.168.10.101/24</address>
+ <address>{$vlan10_net}.101/24</address>
<address>2002::10:101/64</address>
</addresses>
</eth>
@@ -115,7 +119,7 @@
<interfaces>
<eth id="guestnic" label="to_guest4">
<addresses>
- <address>192.168.20.101/24</address>
+ <address>{$vlan20_net}.101/24</address>
<address>2002::20:100/64</address>
</addresses>
</eth>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
index 80ad328..890e808 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
@@ -6,6 +6,8 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="virtual_ovs_bridge_vlan_in_guest.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
</define>
<network>
<host id="host1">
@@ -29,13 +31,13 @@
</eth>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="guestnic" />
</slaves>
<addresses>
- <address>192.168.10.10/24</address>
+ <address>{$vlan10_net}.10/24</address>
<address>2002::10:10/64</address>
</addresses>
</vlan>
@@ -46,13 +48,13 @@
<eth id="nic" label="to_switch" />
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="nic" />
</slaves>
<addresses>
- <address>192.168.10.11/24</address>
+ <address>{$vlan10_net}.11/24</address>
<address>2002::10:11/64</address>
</addresses>
</vlan>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
index 9995891..f6c5b28 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
@@ -6,6 +6,8 @@
<alias name="nperf_confidence" value="99,5" />
<alias name="nperf_max_runs" value="5" />
<alias name="mapping_file" value="virtual_ovs_bridge_vlan_in_host.mapping" />
+ <alias name="vlan10_net" value="192.168.10"/>
+ <alias name="vlan10_tag" value="10"/>
</define>
<network>
<host id="host1">
@@ -17,7 +19,7 @@
<slave id="tap" />
<slave id="nic" />
</slaves>
- <vlan tag="10">
+ <vlan tag="{$vlan10_tag}">
<slaves>
<slave id="tap"/>
</slaves>
@@ -32,7 +34,7 @@
<param name="driver" value="virtio"/>
</params>
<addresses>
- <address>192.168.10.10/24</address>
+ <address>{$vlan10_net}.10/24</address>
<address>2002::10:10/64</address>
</addresses>
</eth>
@@ -44,13 +46,13 @@
</eth>
<vlan id="vlan10">
<options>
- <option name="vlan_tci" value="10" />
+ <option name="vlan_tci" value="{$vlan10_tag}" />
</options>
<slaves>
<slave id="nic" />
</slaves>
<addresses>
- <address>192.168.10.11/24</address>
+ <address>{$vlan10_net}.11/24</address>
<address>2002::10:11/64</address>
</addresses>
</vlan>
--
2.4.3
8 years, 4 months
[PATCH v1] regression-tests: Add nperf_cpu_util alias to Python tasks
by Jiri Prochazka
This patch adds alias nperf_cpu_util, which is used in netperf test module for
enabling local/remote/both CPU utilization measure. When the value is different
from these three, no CPU utilization measure will be enabled.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.py | 13 +++++++++----
recipes/regression_tests/phase1/3_vlans_over_bond.py | 13 +++++++++----
recipes/regression_tests/phase1/bonding_test.py | 5 +++++
.../phase1/virtual_bridge_2_vlans_over_bond.py | 5 +++++
.../regression_tests/phase1/virtual_bridge_vlan_in_guest.py | 5 +++++
.../regression_tests/phase1/virtual_bridge_vlan_in_host.py | 5 +++++
recipes/regression_tests/phase2/3_vlans_over_team.py | 13 +++++++++----
recipes/regression_tests/phase2/team_test.py | 5 +++++
.../virtual_ovs_bridge_2_vlans_over_active_backup_bond.py | 5 +++++
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 5 +++++
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 5 +++++
11 files changed, 67 insertions(+), 12 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index c4d229b..69b958e 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -37,6 +37,7 @@ 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")
m1_phy1 = m1.get_interface("eth1")
m1_phy1.set_mtu(mtu)
@@ -75,28 +76,32 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"role" : "client",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_tcp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
for vlan1 in vlans:
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index e998480..adaf426 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -36,6 +36,7 @@ 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")
m1_bond = m1.get_interface("test_bond")
m1_bond.set_mtu(mtu)
@@ -76,28 +77,32 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"role" : "client",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_tcp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
for vlan1 in vlans:
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index 8909ca0..b73f0dc 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -36,6 +36,7 @@ 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")
test_if1 = m1.get_interface("test_if")
test_if1.set_mtu(mtu)
@@ -82,6 +83,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -92,6 +94,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -103,6 +106,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, test_if2.get_ip(1))
})
@@ -114,6 +118,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, test_if2.get_ip(1))
})
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 8b580a9..4ad0dc9 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
@@ -41,6 +41,7 @@ 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_cpu_util = ctl.get_alias("nperf_cpu_util")
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -105,6 +106,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : "-i %s -L %s" %
(nperf_max_runs, g3_guestnic.get_ip(0))
})
@@ -116,6 +118,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : "-i %s -L %s" %
(nperf_max_runs, g3_guestnic.get_ip(0))
})
@@ -128,6 +131,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, g3_guestnic.get_ip(1))
})
@@ -140,6 +144,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, g3_guestnic.get_ip(1))
})
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 de46b51..ec2400b 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -37,6 +37,7 @@ 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")
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -87,6 +88,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -97,6 +99,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -108,6 +111,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
@@ -120,6 +124,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
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 1ea1d46..8b235f8 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -37,6 +37,7 @@ 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")
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
@@ -86,6 +87,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -96,6 +98,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -107,6 +110,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
@@ -119,6 +123,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index de7f955..5855915 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -36,6 +36,7 @@ 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")
m1_team = m1.get_interface("test_if")
m1_team.set_mtu(mtu)
@@ -77,28 +78,32 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"role" : "client",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_tcp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
- "confidence" : nperf_confidence
+ "confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util
})
for vlan1 in vlans:
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index 50e8364..4897d8d 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -35,6 +35,7 @@ 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")
test_if1 = m1.get_interface("test_if")
test_if1.set_mtu(mtu)
@@ -82,6 +83,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -92,6 +94,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -103,6 +106,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, test_if2.get_ip(1))
})
@@ -114,6 +118,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, test_if2.get_ip(1))
})
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 6f02921..521b268 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
@@ -41,6 +41,7 @@ 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_cpu_util = ctl.get_alias("nperf_cpu_util")
h1_nic1 = h1.get_interface("nic1")
h1_nic2 = h1.get_interface("nic2")
@@ -103,6 +104,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : "-i %s -L %s" %
(nperf_max_runs, g3_guestnic.get_ip(0))
})
@@ -114,6 +116,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : "-i %s -L %s" %
(nperf_max_runs, g3_guestnic.get_ip(0))
})
@@ -126,6 +129,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, g3_guestnic.get_ip(1))
})
@@ -138,6 +142,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, g3_guestnic.get_ip(1))
})
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 32c1335..27bc63b 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
@@ -37,6 +37,7 @@ 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")
h2_vlan10 = h2.get_interface("vlan10")
g1_vlan10 = g1.get_interface("vlan10")
@@ -84,6 +85,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -94,6 +96,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -105,6 +108,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
@@ -117,6 +121,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
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 209b85a..3284851 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
@@ -37,6 +37,7 @@ 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")
h2_vlan10 = h2.get_interface("vlan10")
g1_guestnic = g1.get_interface("guestnic")
@@ -83,6 +84,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -93,6 +95,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" : p_opts
})
@@ -104,6 +107,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
@@ -116,6 +120,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
+ "cpu_util" : nperf_cpu_util,
"netperf_opts" :
"-i %s -L %s -6" % (nperf_max_runs, h2_vlan10.get_ip(1))
})
--
2.4.3
8 years, 4 months
[PATCH v2] test_modules/netperf: Add support for measuring CPU utilization, cleaner parsing of netperf output
by Jiri Prochazka
This patch adds support for measuring both local and remote CPU utilization:
New option for netperf client have been added:
cpu_util - when set to "local", netperf is run with -c argument, enabling measure of local CPU utilization during run,
when set to "remote", netperf is run with -C argument, enabling measure of remote CPU utilization during run,
when set to "both", netperf is run with both -c and -C arguments
Parsing of throughput and confidence interval has been made cleaner:
Using omni netperf output, all relevant data are now stored in key=val format,
which can be parsed more easily and is the same for all netperf test types.
Changes in v2:
Changed format of cpu_util argument (described above)
Renamed keys in res_val dict to from loc_cpu_util and rem_cpu util
to LOCAL_CPU_UTIL and REMOTE_CPU_UTIL
Fixed incorrect real confidence value, now the touple correctly
returns (CONFIDENCE_LEVEL, THROUGHPUT_CONFIDENCE_INTERVAL/2)
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
test_modules/Netperf.py | 87 +++++++++++++++++++++++++------------------------
1 file changed, 44 insertions(+), 43 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 868cca0..9a20ad2 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -34,6 +34,7 @@ class Netperf(TestGeneric):
self._confidence = self.get_opt("confidence")
self._bind = self.get_opt("bind", opt_type="addr")
self._family = self.get_opt("family")
+ self._cpu_util = self.get_opt("cpu_util")
self._runs = self.get_opt("runs", default=1)
if self._runs > 1 and self._confidence is not None:
@@ -61,7 +62,8 @@ class Netperf(TestGeneric):
composes commands for netperf and netserver based on xml recipe
"""
if self._role == "client":
- cmd = "netperf -H %s -f k" % self._netperf_server
+ # -P 0 disables banner header of output
+ cmd = "netperf -H %s -f k -P 0" % self._netperf_server
if self._port is not None:
"""
client connects on this port
@@ -89,11 +91,22 @@ class Netperf(TestGeneric):
"""
cmd += " -I %s" % self._confidence
+ if self._cpu_util is not None:
+ if self._cpu_util.lower() == "both":
+ cmd += " -c -C"
+ elif self._cpu_util.lower() == "local":
+ cmd += " -c"
+ elif self._cpu_util.lower() == "remote":
+ cmd += " -C"
+
if self._netperf_opts is not None:
"""
custom options for netperf
"""
cmd += " %s" % self._netperf_opts
+ # Print only relevant output
+ cmd += ' -- -k "THROUGHPUT, LOCAL_CPU_UTIL, REMOTE_CPU_UTIL, CONFIDENCE_LEVEL, THROUGHPUT_CONFID"'
+
elif self._role == "server":
cmd = "netserver -D"
if self._bind is not None:
@@ -114,58 +127,47 @@ class Netperf(TestGeneric):
return cmd
def _parse_output(self, output):
- if self._testname == "UDP_STREAM":
- # pattern for UDP_STREAM throughput output
- # decimal float decimal (float)
- pattern_udp_stream = "\d+\s+\d+\.\d+\s+\d+\s+(\d+(\.\d+){0,1})\n"
- r2 = re.search(pattern_udp_stream, output.lower())
- elif self._testname == "TCP_STREAM":
- # pattern for TCP_STREAM throughput output
- # decimal decimal decimal float (float)
- pattern_tcp_stream = "\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(\.\d+){0,1})"
- r2 = re.search(pattern_tcp_stream, output.lower())
- elif self._testname == "TCP_RR" or self._testname == "UDP_RR"\
- or self._testname == "SCTP_RR":
- # pattern for TCP_RR, UDP_RR and SCTP_RR throughput output
- # decimal decimal decimal decimal float (float)
- pattern_tcp_rr = "\d+\s+\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(\.\d+){0,1})"
- r2 = re.search(pattern_tcp_rr, output.lower())
- else:
- # pattern for SCTP streams and other tests
- # decimal decimal decimal float (float)
- pattern_sctp = "\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(\.\d+){0,1})"
- r2 = re.search(pattern_sctp, output.lower())
+ res_val = {}
- if r2 is None:
+ pattern_throughput = "THROUGHPUT=(\d+\.\d+)"
+ throughput = re.search(pattern_throughput, output)
+
+ if throughput is None:
rate_in_kb = 0.0
else:
- rate_in_kb = float(r2.group(1))
+ rate_in_kb = float(throughput.group(1))
+
+ res_val["rate"] = rate_in_kb*1000
+ res_val["unit"] = "bps"
+
+ if self._cpu_util is not None:
+ if self._cpu_util == "local" or self._cpu_util == "both":
+ pattern_loc_cpu_util = "LOCAL_CPU_UTIL=([-]?\d+\.\d+)"
+ loc_cpu_util = re.search(pattern_loc_cpu_util, output)
+ res_val["LOCAL_CPU_UTIL"] = float(loc_cpu_util.group(1))
+
+ if self._cpu_util == "remote" or self._cpu_util == "both":
+ pattern_rem_cpu_util = "REMOTE_CPU_UTIL=([-]?\d+\.\d+)"
+ rem_cpu_util = re.search(pattern_rem_cpu_util, output)
+ res_val["REMOTE_CPU_UTIL"] = float(rem_cpu_util.group(1))
if self._confidence is not None:
confidence = self._parse_confidence(output)
- return {"rate": rate_in_kb*1000,
- "unit": "bps",
- "confidence": confidence}
- else:
- return {"rate": rate_in_kb*1000,
- "unit": "bps"}
+ res_val["confidence"] = confidence
+
+ return res_val
def _parse_confidence(self, output):
- normal_pattern = r'\+/-(\d+\.\d*)% @ (\d+)% conf\.'
- warning_pattern = r'!!! Confidence intervals: Throughput\s+: (\d+\.\d*)%'
- normal_confidence = re.search(normal_pattern, output)
- warning_confidence = re.search(warning_pattern, output)
+ pattern_throughput_confid = "THROUGHPUT_CONFID=([-]?\d+\.\d+)"
+ pattern_confidence_level = "CONFIDENCE_LEVEL=(\d+)"
+ throughput_confid = float(re.search(pattern_throughput_confid, output).group(1))
+ confidence_level = int(re.search(pattern_confidence_level, output).group(1))
- if normal_confidence is None:
- logging.error("Failed to parse confidence!!")
+ if throughput_confid == -1.00:
+ logging.error("Failed to parse confidence!")
return (0, 0.0)
- if warning_confidence is None:
- real_confidence = (float(normal_confidence.group(2)),
- float(normal_confidence.group(1)))
- else:
- real_confidence = (float(normal_confidence.group(2)),
- float(warning_confidence.group(1))/2)
+ real_confidence = (confidence_level, throughput_confid/2)
return real_confidence
@@ -216,7 +218,6 @@ class Netperf(TestGeneric):
"throughput option"
return (False, res_data)
threshold_rate = float(r1.group(1))
- threshold_unit_size = ""
threshold_unit_type = "tps"
return {"rate": threshold_rate,
--
2.4.3
8 years, 4 months
[PATCH] test_modules/netperf: Add support for measuring CPU utilization, cleaner parsing of netperf output
by Jiri Prochazka
This patch adds support for measuring both local and remote CPU utilization:
Two new options for netperf client have been added:
loc_cpu_util - when set to True, netperf is run with -c argument, enabling measure of local CPU utilization during run
rem_cpu_util - same as above but for remote host with -C argument
Parsing of throughput and confidence interval has been made cleaner:
Using omni netperf output, all relevant data are now stored in key=val format,
which can be parsed more easily and is the same for all netperf test types.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
test_modules/Netperf.py | 91 +++++++++++++++++++++++++------------------------
1 file changed, 47 insertions(+), 44 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 868cca0..05e99e2 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -11,7 +11,7 @@ import errno
import re
from lnst.Common.TestsCommon import TestGeneric
from lnst.Common.ShellProcess import ShellProcess
-from lnst.Common.Utils import std_deviation, is_installed
+from lnst.Common.Utils import std_deviation, is_installed, bool_it
class Netperf(TestGeneric):
@@ -34,6 +34,8 @@ class Netperf(TestGeneric):
self._confidence = self.get_opt("confidence")
self._bind = self.get_opt("bind", opt_type="addr")
self._family = self.get_opt("family")
+ self._loc_cpu_util = self.get_opt("loc_cpu_util", default=False)
+ self._rem_cpu_util = self.get_opt("rem_cpu_util", default=False)
self._runs = self.get_opt("runs", default=1)
if self._runs > 1 and self._confidence is not None:
@@ -61,7 +63,8 @@ class Netperf(TestGeneric):
composes commands for netperf and netserver based on xml recipe
"""
if self._role == "client":
- cmd = "netperf -H %s -f k" % self._netperf_server
+ # -P 0 disables banner header of output
+ cmd = "netperf -H %s -f k -P 0" % self._netperf_server
if self._port is not None:
"""
client connects on this port
@@ -89,11 +92,26 @@ class Netperf(TestGeneric):
"""
cmd += " -I %s" % self._confidence
+ if bool_it(self._loc_cpu_util):
+ """
+ measure local CPU utilization
+ """
+ cmd += " -c"
+
+ if bool_it(self._rem_cpu_util):
+ """
+ measure remote CPU utilization
+ """
+ cmd += " -C"
+
if self._netperf_opts is not None:
"""
custom options for netperf
"""
cmd += " %s" % self._netperf_opts
+ # Print only relevant output
+ cmd += ' -- -k "THROUGHPUT, LOCAL_CPU_UTIL, REMOTE_CPU_UTIL, THROUGHPUT_CONFID"'
+
elif self._role == "server":
cmd = "netserver -D"
if self._bind is not None:
@@ -114,58 +132,44 @@ class Netperf(TestGeneric):
return cmd
def _parse_output(self, output):
- if self._testname == "UDP_STREAM":
- # pattern for UDP_STREAM throughput output
- # decimal float decimal (float)
- pattern_udp_stream = "\d+\s+\d+\.\d+\s+\d+\s+(\d+(\.\d+){0,1})\n"
- r2 = re.search(pattern_udp_stream, output.lower())
- elif self._testname == "TCP_STREAM":
- # pattern for TCP_STREAM throughput output
- # decimal decimal decimal float (float)
- pattern_tcp_stream = "\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(\.\d+){0,1})"
- r2 = re.search(pattern_tcp_stream, output.lower())
- elif self._testname == "TCP_RR" or self._testname == "UDP_RR"\
- or self._testname == "SCTP_RR":
- # pattern for TCP_RR, UDP_RR and SCTP_RR throughput output
- # decimal decimal decimal decimal float (float)
- pattern_tcp_rr = "\d+\s+\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(\.\d+){0,1})"
- r2 = re.search(pattern_tcp_rr, output.lower())
- else:
- # pattern for SCTP streams and other tests
- # decimal decimal decimal float (float)
- pattern_sctp = "\d+\s+\d+\s+\d+\s+\d+\.\d+\s+(\d+(\.\d+){0,1})"
- r2 = re.search(pattern_sctp, output.lower())
+ res_val = {}
- if r2 is None:
+ pattern_throughput = "THROUGHPUT=(\d+\.\d+)"
+ throughput = re.search(pattern_throughput, output)
+
+ if throughput is None:
rate_in_kb = 0.0
else:
- rate_in_kb = float(r2.group(1))
+ rate_in_kb = float(throughput.group(1))
+
+ res_val["rate"] = rate_in_kb*1000
+ res_val["unit"] = "bps"
+
+ if bool_it(self._loc_cpu_util):
+ pattern_loc_cpu_util = "LOCAL_CPU_UTIL=([-]?\d+\.\d+)"
+ loc_cpu_util = re.search(pattern_loc_cpu_util, output)
+ res_val["loc_cpu_util"] = float(loc_cpu_util.group(1))
+
+ if bool_it(self._rem_cpu_util):
+ pattern_rem_cpu_util = "REMOTE_CPU_UTIL=([-]?\d+\.\d+)"
+ rem_cpu_util = re.search(pattern_rem_cpu_util, output)
+ res_val["rem_cpu_util"] = float(rem_cpu_util.group(1))
if self._confidence is not None:
confidence = self._parse_confidence(output)
- return {"rate": rate_in_kb*1000,
- "unit": "bps",
- "confidence": confidence}
- else:
- return {"rate": rate_in_kb*1000,
- "unit": "bps"}
+ res_val["confidence"] = confidence
+
+ return res_val
def _parse_confidence(self, output):
- normal_pattern = r'\+/-(\d+\.\d*)% @ (\d+)% conf\.'
- warning_pattern = r'!!! Confidence intervals: Throughput\s+: (\d+\.\d*)%'
- normal_confidence = re.search(normal_pattern, output)
- warning_confidence = re.search(warning_pattern, output)
+ pattern_throughput_confid = "THROUGHPUT_CONFID=([-]?\d+\.\d+)"
+ throughput_confid = float(re.search(pattern_throughput_confid, output).group(1))
- if normal_confidence is None:
- logging.error("Failed to parse confidence!!")
+ if throughput_confid == -1.00:
+ logging.error("Failed to parse confidence!")
return (0, 0.0)
- if warning_confidence is None:
- real_confidence = (float(normal_confidence.group(2)),
- float(normal_confidence.group(1)))
- else:
- real_confidence = (float(normal_confidence.group(2)),
- float(warning_confidence.group(1))/2)
+ real_confidence = (throughput_confid, throughput_confid/2)
return real_confidence
@@ -216,7 +220,6 @@ class Netperf(TestGeneric):
"throughput option"
return (False, res_data)
threshold_rate = float(r1.group(1))
- threshold_unit_size = ""
threshold_unit_type = "tps"
return {"rate": threshold_rate,
--
2.4.3
8 years, 4 months
[PATCH] Netperf: add testname to res_data
by Jan Tluka
This patch adds netperf test name into res_data so that the summary or
html contains information on which netperf test was run.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/Netperf.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 868cca0..93eda82 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -235,6 +235,7 @@ class Netperf(TestGeneric):
logging.debug("running as client...")
res_data = {}
+ res_data["testname"] = self._testname
rv = 0
results = []
--
2.4.3
8 years, 4 months
[PATCH] regression-tests: completely remove rx offload
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The previous attempt to remove problems with rx offload on team and bond
devices turned out to be incorrect since i just removed the setting
where we tried running rx=off when in fact the problem is that we're
trying to run rx=on in every other setting. This patch removes the rx
offload from all the settings completely to fix this issue.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans_over_bond.py | 10 +++++-----
recipes/regression_tests/phase1/bonding_test.py | 10 +++++-----
.../phase1/virtual_bridge_2_vlans_over_bond.py | 10 +++++-----
recipes/regression_tests/phase2/3_vlans_over_team.py | 10 +++++-----
recipes/regression_tests/phase2/team_test.py | 10 +++++-----
.../virtual_ovs_bridge_2_vlans_over_active_backup_bond.py | 10 +++++-----
6 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index 291df08..e998480 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -23,11 +23,11 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
vlans = ["vlan10", "vlan20", "vlan30"]
-offloads = ["gro", "gso", "tso", "rx", "tx"]
-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")]]
+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")]]
ipv = ctl.get_alias("ipv")
mtu = ctl.get_alias("mtu")
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index 49632ab..8909ca0 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -23,11 +23,11 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# TESTS
# ------
-offloads = ["gro", "gso", "tso", "rx", "tx"]
-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")]]
+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")]]
ipv = ctl.get_alias("ipv")
mtu = ctl.get_alias("mtu")
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 9b255c5..8b580a9 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
@@ -30,11 +30,11 @@ g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# TESTS
# ------
-offloads = ["gro", "gso", "tso", "rx", "tx"]
-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")]]
+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")]]
ipv = ctl.get_alias("ipv")
netperf_duration = int(ctl.get_alias("netperf_duration"))
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 0920d69..de7f955 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -23,11 +23,11 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
vlans = ["vlan10", "vlan20", "vlan30"]
-offloads = ["gro", "gso", "tso", "rx", "tx"]
-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")]]
+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")]]
ipv = ctl.get_alias("ipv")
mtu = ctl.get_alias("mtu")
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index b17a5c0..50e8364 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -22,11 +22,11 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# TESTS
# ------
-offloads = ["gro", "gso", "tso", "rx", "tx"]
-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")]]
+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")]]
ipv = ctl.get_alias("ipv")
mtu = ctl.get_alias("mtu")
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 4b9b096..6f02921 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
@@ -30,11 +30,11 @@ g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# TESTS
# ------
-offloads = ["gro", "gso", "tso", "rx", "tx"]
-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")]]
+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")]]
ipv = ctl.get_alias("ipv")
netperf_duration = int(ctl.get_alias("netperf_duration"))
--
2.6.2
8 years, 4 months