[PATCH 1/2] Store interfaces driver info in SlavePool mapping and show it in summary
by Jiri Prochazka
For issue #111. Since RPC connection is created after mapping, we can't get
interface driver info sooner without creating extra connection to the Slave.
This patch stores driver info after device configuration, after method
interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/NetTestController.py | 5 +++++
lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 5c2695d..0791897 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces:
iface.configure()
+ if m._libvirt_domain is None:
+ driver = iface._driver
+ if_id = iface._id
+ mapped_machine = self._slave_pool._map['machines'][m_id]
+ mapped_machine['interfaces'][if_id]['driver'] = driver
for iface in ifaces:
iface.up()
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py
index 9f8955a..49f632c 100644
--- a/lnst/Controller/NetTestResultSerializer.py
+++ b/lnst/Controller/NetTestResultSerializer.py
@@ -100,9 +100,17 @@ class NetTestResultSerializer:
(m_id, m["target"]), ""))
for if_id, pool_if in m["interfaces"].iteritems():
pool_id = pool_if["target"]
- output_pairs.append((6*" " + "interface \"%s\" "\
- "matched to \"%s\"" %\
- (if_id, pool_id), ""))
+ if "driver" in pool_if:
+ driver = pool_if["driver"]
+ output_pairs.append((6*" " + "interface \"%s\" "
+ "matched to \"%s\" "
+ "(driver: \"%s\")" %
+ (if_id, pool_id,
+ driver), ""))
+ else:
+ output_pairs.append((6*" " + "interface \"%s\" "
+ "matched to \"%s\" " %
+ (if_id, pool_id), ""))
if recipe["result"] == "FAIL" and \
"err_msg" in recipe and recipe["err_msg"] != "":
--
2.4.3
8 years, 3 months
[PATCH] Fix possibility of defining non-unique interface IDs
by Jiri Prochazka
This patch fixes possibility to define interfaces with non-unique IDs per machine.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/RecipeParser.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 73422f1..936a870 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -66,10 +66,18 @@ class RecipeParser(XmlParser):
machine["interfaces"] = XmlCollection(interfaces_tag)
lo_netns = []
+ unique_ids = []
for interface_tag in interfaces_tag:
interfaces = self._process_interface(interface_tag)
for interface in interfaces:
+ if interface['id'] in unique_ids:
+ msg = "Interface with ID \"%s\" has already been "\
+ "defined for this machine." % interface['id']
+ raise RecipeError(msg, interface_tag)
+ else:
+ unique_ids.append(interface['id'])
+
if interface['type'] != 'lo':
continue
elif interface['netns'] in lo_netns:
@@ -77,6 +85,7 @@ class RecipeParser(XmlParser):
raise RecipeError(msg, interface_tag)
else:
lo_netns.append(interface['netns'])
+
machine["interfaces"].extend(interfaces)
return machine
--
2.4.3
8 years, 3 months
[PATCH] Make netperf duration configurable via alias in regression tests
by Jiri Prochazka
Default value is set to 60 seconds.
Closes #118
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
recipes/regression_tests/phase1/3_vlans.py | 13 +++++++------
recipes/regression_tests/phase1/3_vlans.xml | 1 +
.../phase1/3_vlans_over_active_backup_bond.xml | 1 +
.../regression_tests/phase1/3_vlans_over_bond.py | 13 +++++++------
.../phase1/3_vlans_over_round_robin_bond.xml | 1 +
.../regression_tests/phase1/active_backup_bond.xml | 1 +
.../phase1/active_backup_double_bond.xml | 1 +
recipes/regression_tests/phase1/bonding_test.py | 13 +++++++------
.../regression_tests/phase1/round_robin_bond.xml | 1 +
.../phase1/round_robin_double_bond.xml | 1 +
recipes/regression_tests/phase1/simple_ping.py | 4 ++--
...rtual_bridge_2_vlans_over_active_backup_bond.xml | 1 +
.../phase1/virtual_bridge_2_vlans_over_bond.py | 9 +++++----
.../phase1/virtual_bridge_vlan_in_guest.py | 9 +++++----
.../phase1/virtual_bridge_vlan_in_guest.xml | 1 +
.../phase1/virtual_bridge_vlan_in_host.py | 9 +++++----
.../phase1/virtual_bridge_vlan_in_host.xml | 1 +
.../phase2/3_vlans_over_active_backup_team.xml | 1 +
.../phase2/3_vlans_over_round_robin_team.xml | 1 +
.../regression_tests/phase2/3_vlans_over_team.py | 13 +++++++------
.../phase2/active_backup_double_team.xml | 1 +
.../regression_tests/phase2/active_backup_team.xml | 1 +
.../active_backup_team_vs_active_backup_bond.xml | 1 +
.../active_backup_team_vs_round_robin_bond.xml | 1 +
.../phase2/round_robin_double_team.xml | 1 +
.../regression_tests/phase2/round_robin_team.xml | 1 +
.../round_robin_team_vs_active_backup_bond.xml | 1 +
.../phase2/round_robin_team_vs_round_robin_bond.xml | 1 +
recipes/regression_tests/phase2/team_test.py | 21 +++++++++++----------
...al_ovs_bridge_2_vlans_over_active_backup_bond.py | 9 +++++----
...l_ovs_bridge_2_vlans_over_active_backup_bond.xml | 1 +
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 9 +++++----
.../phase2/virtual_ovs_bridge_vlan_in_guest.xml | 1 +
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 9 +++++----
.../phase2/virtual_ovs_bridge_vlan_in_host.xml | 1 +
35 files changed, 94 insertions(+), 60 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 7e79a9f..7e2360e 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -17,8 +17,9 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
-ipv = ctl.get_alias('ipv')
-mtu = ctl.get_alias('mtu')
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = ctl.get_alias("netperf_duration")
m1_phy1 = m1.get_interface("eth1")
m1_phy1.set_mtu(mtu)
@@ -69,7 +70,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
@@ -80,7 +81,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
@@ -91,7 +92,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip(vlan1, 1)
@@ -102,7 +103,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip(vlan1, 1)
diff --git a/recipes/regression_tests/phase1/3_vlans.xml b/recipes/regression_tests/phase1/3_vlans.xml
index ba0455c..aeb3ed1 100644
--- a/recipes/regression_tests/phase1/3_vlans.xml
+++ b/recipes/regression_tests/phase1/3_vlans.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
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 60b2efd..bcaf221 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
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index dde2359..6fa1d80 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -17,8 +17,9 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
-ipv = ctl.get_alias('ipv')
-mtu = ctl.get_alias('mtu')
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = ctl.get_alias("netperf_duration")
m1_bond = m1.get_interface("test_bond")
m1_bond.set_mtu(mtu)
@@ -69,7 +70,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1, 0)
@@ -80,7 +81,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1, 0)
@@ -91,7 +92,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip(vlan1, 1)
@@ -102,7 +103,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip(vlan1, 1)
diff --git a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
index 1aa0149..922f696 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/active_backup_bond.xml b/recipes/regression_tests/phase1/active_backup_bond.xml
index 596dec5..720c6c2 100644
--- a/recipes/regression_tests/phase1/active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/active_backup_double_bond.xml b/recipes/regression_tests/phase1/active_backup_double_bond.xml
index dec15df..417622c 100644
--- a/recipes/regression_tests/phase1/active_backup_double_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_double_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index d2d6378..acc3748 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -17,8 +17,9 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["tso", "gro", "gso"]
-ipv = ctl.get_alias('ipv')
-mtu = ctl.get_alias('mtu')
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = ctl.get_alias("netperf_duration")
test_if1 = m1.get_interface("test_if")
test_if1.set_mtu(mtu)
@@ -58,7 +59,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m1.get_ip("test_if", 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
@@ -67,7 +68,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m1.get_ip("test_if", 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
@@ -77,7 +78,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
m1.get_ip("test_if", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip("test_if", 1)
@@ -87,7 +88,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
m1.get_ip("test_if", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip("test_if", 1)
diff --git a/recipes/regression_tests/phase1/round_robin_bond.xml b/recipes/regression_tests/phase1/round_robin_bond.xml
index 516bf5b..619b4f5 100644
--- a/recipes/regression_tests/phase1/round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/round_robin_double_bond.xml b/recipes/regression_tests/phase1/round_robin_double_bond.xml
index 51a871e..4c00f70 100644
--- a/recipes/regression_tests/phase1/round_robin_double_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_double_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/simple_ping.py b/recipes/regression_tests/phase1/simple_ping.py
index 0882fed..f9e5837 100644
--- a/recipes/regression_tests/phase1/simple_ping.py
+++ b/recipes/regression_tests/phase1/simple_ping.py
@@ -24,8 +24,8 @@ ping_mod6 = ctl.get_module("Icmp6Ping",
ctl.wait(15)
-ipv = ctl.get_alias('ipv')
-mtu = ctl.get_alias('mtu')
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
test_if1 = hostA.get_interface("testiface")
test_if1.set_mtu(mtu)
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 6877739..2c9ed11 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
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="host1">
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 141f4f0..c4f93d7 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
@@ -25,6 +25,7 @@ g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias("ipv")
+netperf_duration = ctl.get_alias("netperf_duration")
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -74,7 +75,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
@@ -84,7 +85,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
@@ -95,7 +96,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % g3.get_ip("guestnic", 1)
@@ -106,7 +107,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % g3.get_ip("guestnic", 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 1a2f911..bc90f5d 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -19,6 +19,7 @@ h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias("ipv")
+netperf_duration = ctl.get_alias("netperf_duration")
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -53,7 +54,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("vlan10"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -63,7 +64,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("vlan10"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -74,7 +75,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("vlan10", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
@@ -85,7 +86,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("vlan10", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
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 1899b38..ea49082 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="host1">
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 0188686..0344641 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -19,6 +19,7 @@ h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias("ipv")
+netperf_duration = ctl.get_alias("netperf_duration")
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -53,7 +54,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -63,7 +64,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -74,7 +75,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
@@ -85,7 +86,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
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 7fb917e..3649ca9 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="host1">
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 4d27752..87a056a 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
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
index d8115b5..612fe01 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 74b5a5a..fc04b29 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -17,8 +17,9 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
-ipv = ctl.get_alias('ipv')
-mtu = ctl.get_alias('mtu')
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = ctl.get_alias("netperf_duration")
m1_team = m1.get_interface("test_if")
m1_team.set_mtu(mtu)
@@ -70,7 +71,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1, 0)
@@ -81,7 +82,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1, 0)
@@ -92,7 +93,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip(vlan1, 1)
@@ -102,7 +103,7 @@ for vlan1 in vlans:
"role" : "client",
"netperf_server" :
m1.get_ip(vlan1, 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip(vlan1, 1)
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml
index 387937a..ade6a3e 100644
--- a/recipes/regression_tests/phase2/active_backup_double_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_double_team.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml
index b798f5b..1897d4f 100644
--- a/recipes/regression_tests/phase2/active_backup_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_team.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
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 b1cdbfe..21b5463 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
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
index 6905721..a949c07 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_double_team.xml b/recipes/regression_tests/phase2/round_robin_double_team.xml
index 8fcedca..450bad8 100644
--- a/recipes/regression_tests/phase2/round_robin_double_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_double_team.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_team.xml b/recipes/regression_tests/phase2/round_robin_team.xml
index d9d277b..ba1b8fc 100644
--- a/recipes/regression_tests/phase2/round_robin_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_team.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
index 76513da..e389126 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
index e91558c..31e354a 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
@@ -2,6 +2,7 @@
<define>
<alias name="ipv" value="both" />
<alias name="mtu" value="1500" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index 88cbb8c..ee0456a 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -16,8 +16,9 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["tso", "gro", "gso"]
-ipv = ctl.get_alias('ipv')
-mtu = ctl.get_alias('mtu')
+ipv = ctl.get_alias("ipv")
+mtu = ctl.get_alias("mtu")
+netperf_duration = ctl.get_alias("netperf_duration")
test_if1 = m1.get_interface("test_if")
test_if1.set_mtu(mtu)
@@ -58,7 +59,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m1.get_ip("test_if", 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
@@ -67,7 +68,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m1.get_ip("test_if", 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
@@ -77,7 +78,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
m1.get_ip("test_if", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip("test_if", 1)
@@ -87,7 +88,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
m1.get_ip("test_if", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % m2.get_ip("test_if", 1)
@@ -150,7 +151,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m2.get_ip("test_if", 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" % m1.get_ip("test_if", 0)
})
@@ -159,7 +160,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
"netperf_server" : m2.get_ip("test_if", 0),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" % m1.get_ip("test_if", 0)
})
@@ -169,7 +170,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
m2.get_ip("test_if", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % m1.get_ip("test_if", 1)
@@ -179,7 +180,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
m2.get_ip("test_if", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % m1.get_ip("test_if", 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 8daa471..4dcded8 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
@@ -25,6 +25,7 @@ g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias("ipv")
+netperf_duration = ctl.get_alias("netperf_duration")
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -75,7 +76,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
@@ -85,7 +86,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
@@ -96,7 +97,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % g3.get_ip("guestnic", 1)
@@ -107,7 +108,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % g3.get_ip("guestnic", 1)
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 5e54823..4f1c7b1 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
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="host1">
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 662e888..e8099b8 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
@@ -19,6 +19,7 @@ h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias("ipv")
+netperf_duration = ctl.get_alias("netperf_duration")
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -53,7 +54,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("vlan10"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -63,7 +64,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("vlan10"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -74,7 +75,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("vlan10", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
@@ -85,7 +86,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("vlan10", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
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 eb031b8..6f08cdd 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
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="host1">
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 15122c4..fdf7186 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
@@ -19,6 +19,7 @@ h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias("ipv")
+netperf_duration = ctl.get_alias("netperf_duration")
ping_mod = ctl.get_module("IcmpPing",
options={
@@ -53,7 +54,7 @@ netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -63,7 +64,7 @@ netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" : g1.get_ip("guestnic"),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
@@ -74,7 +75,7 @@ netperf_cli_tcp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
@@ -85,7 +86,7 @@ netperf_cli_udp6 = ctl.get_module("Netperf",
"role" : "client",
"netperf_server" :
g1.get_ip("guestnic", 1),
- "duration" : 60,
+ "duration" : netperf_duration,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s -6" % h2.get_ip("vlan10", 1)
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 d425b82..a5bbc39 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
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="netperf_duration" value="60" />
</define>
<network>
<host id="host1">
--
2.4.3
8 years, 3 months
[PATCH] Add timeout to _poll_loop function to avoid infinite looping
by Jiri Prochazka
When Slave is using NetworkManager, polling is used to activate DBus connection.
This may result in infinite loop (eg. when device is not in LOWER_UP state, but is in UP state).
This patch adds timeout control in _poll_loop method, timeout value is set to 10s.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 8e2f1dd..c884d70 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -28,6 +28,7 @@ from lnst.Common.Config import lnst_config
NM_BUS = "org.freedesktop.NetworkManager"
OBJ_PRE = "/org/freedesktop/NetworkManager"
IF_PRE = NM_BUS
+POLL_LOOP_TIMEOUT = 10
#NetworkManager constants for state values
_ACON_ACTIVATED = 2
@@ -152,11 +153,15 @@ class NmConfigDeviceGeneric(object):
if self._device_state == self._wait_for:
self._loop.quit()
- def _poll_loop(self, func, expected_val, *args):
- while True:
+ def _poll_loop(self, func, expected_val, timeout, *args):
+ timer = 0
+ while timer < timeout:
if func(*args) == expected_val:
- break
+ return
time.sleep(1)
+ timer += 1
+ msg = "Timed out during NetworkManager polling."
+ raise Exception(msg)
def _convert_hwaddr(self, dev_config):
if "hwaddr" in dev_config:
@@ -276,6 +281,7 @@ class NmConfigDeviceGeneric(object):
"org.freedesktop.DBus.Properties")
self._poll_loop(act_con_props.Get,
_ACON_ACTIVATED,
+ POLL_LOOP_TIMEOUT,
IF_PRE + ".Connection.Active", "State")
def _nm_deactivate_connection(self):
@@ -341,6 +347,7 @@ class NmConfigDeviceEth(NmConfigDeviceGeneric):
self._poll_loop(dev_props.Get,
_DEV_DISCONNECTED,
+ POLL_LOOP_TIMEOUT,
IF_PRE + ".Device", "State")
else:
exec_cmd("ip link set %s up" % config["name"])
--
2.4.3
8 years, 3 months
[PATCH] Add support for vti6 device type
by Jan Tluka
This patch adds support for vti6 device in LNST. It is similar to vti device
that is already supported but works on top of IPv6 stack.
To use it you need a system with iproute2 v3.17 to make vti6 working.
The recipe xml looks like this:
<lnstrecipe>
<network>
<host id="1">
<interfaces>
<eth id="phy1" label="default" />
<vti6 id="vti6_one">
<options>
<option name="local" value="2002::1/64"/>
<option name="remote" value="2002::2/64"/>
<option name="key" value="10"/>
</options>
</vti6>
</interfaces>
</host>
</network>
<task>
<run command="ip link show" host="1"/>
</task>
</lnstrecipe>
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Controller/RecipeParser.py | 2 +-
lnst/Slave/InterfaceManager.py | 2 ++
lnst/Slave/NetConfigDevice.py | 40 ++++++++++++++++++++++++++++++++++++++++
lnst/Slave/NmConfigDevice.py | 7 +++++++
schema-recipe.rng | 19 +++++++++++++++++++
5 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 73422f1..12b4506 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -157,7 +157,7 @@ class RecipeParser(XmlParser):
opts = self._process_options(opts_tag)
if len(opts) > 0:
iface["options"] = opts
- elif iface["type"] in ["vti"]:
+ elif iface["type"] in ["vti", "vti6"]:
# interface options
opts_tag = iface_tag.find("options")
opts = self._process_options(opts_tag)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index ab7efcd..fae80b8 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -250,6 +250,8 @@ class InterfaceManager(object):
return self._assign_name_pair("veth")
elif dev_type == "vti":
return self._assign_name_generic("vti")
+ elif dev_type == "vti6":
+ return self._assign_name_generic("t_ip6vti")
else:
return self._assign_name_generic("dev")
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 6569410..a065f00 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -490,6 +490,45 @@ class NetConfigDeviceVti(NetConfigDeviceGeneric):
def deconfigure(self):
return True
+class NetConfigDeviceVti6(NetConfigDeviceGeneric):
+ _modulename = ""
+ _moduleload = False
+
+ def create(self):
+ conf = self._dev_config
+ local = ''
+ remote = ''
+ key = None
+ device = ''
+ for opt, val in conf['options']:
+ if opt == 'local':
+ local = 'local ' + val
+ elif opt == 'remote':
+ remote = 'remote ' + val
+ elif opt == 'key':
+ key = val
+ elif opt == 'dev':
+ device = 'dev ' + val
+ else:
+ pass
+
+ if key == None:
+ raise Exception("Option 'key' not set for a vti6 device")
+
+ exec_cmd("ip link add %s type vti6 %s %s key %s %s" %
+ (conf["name"], local, remote, key, device))
+
+ def destroy(self):
+ conf = self._dev_config
+ exec_cmd("ip link del %s" % conf["name"])
+
+ def configure(self):
+ #no configuration options supported at the moment
+ return True
+
+ def deconfigure(self):
+ return True
+
type_class_mapping = {
"eth": NetConfigDeviceEth,
"bond": NetConfigDeviceBond,
@@ -500,6 +539,7 @@ type_class_mapping = {
"ovs_bridge": NetConfigDeviceOvsBridge,
"veth": NetConfigDeviceVEth,
"vti": NetConfigDeviceVti,
+ "vti6": NetConfigDeviceVti6,
"lo": NetConfigDeviceLoopback
}
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 8e2f1dd..4875c07 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -833,6 +833,12 @@ class NmConfigDeviceVti(NmConfigDeviceGeneric):
def is_nm_managed(cls, dev_config, if_manager):
return False
+class NmConfigDeviceVti6(NmConfigDeviceGeneric):
+ #Not supported by NetworkManager
+ @classmethod
+ def is_nm_managed(cls, dev_config, if_manager):
+ return False
+
class NmConfigDeviceLoopback(NmConfigDeviceGeneric):
#Not supported by NetworkManager
@classmethod
@@ -849,6 +855,7 @@ type_class_mapping = {
"ovs_bridge": NmConfigDeviceOvsBridge,
"veth": NmConfigDeviceVEth,
"vti": NmConfigDeviceVti,
+ "vti6": NmConfigDeviceVti6,
"lo": NmConfigDeviceLoopback
}
diff --git a/schema-recipe.rng b/schema-recipe.rng
index 4cb0e9e..c1ffbed 100644
--- a/schema-recipe.rng
+++ b/schema-recipe.rng
@@ -137,6 +137,7 @@
<ref name="ovs_bridge"/>
<ref name="veth_pair"/>
<ref name="vti"/>
+ <ref name="vti6"/>
<ref name="lo"/>
</choice>
</zeroOrMore>
@@ -392,6 +393,24 @@
</element>
</define>
+ <define name="vti6">
+ <element name="vti6">
+ <attribute name="id"/>
+ <optional>
+ <attribute name="netns"/>
+ </optional>
+ <interleave>
+ <optional>
+ <ref name="define"/>
+ </optional>
+
+ <zeroOrMore>
+ <ref name="options"/>
+ </zeroOrMore>
+ </interleave>
+ </element>
+ </define>
+
<define name="lo">
<element name="lo">
<attribute name="id"/>
--
1.9.3
8 years, 3 months
[PATCH] recipes: use devname instead of ip address in virtual_bridge_2_vlans_over_bond test
by Jan Tluka
We want to bind ping to specific device for vlan test. Using
get_devname() is more appropriate and should be used instead of
get_ip().
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 141f4f0..86adc7b 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
@@ -37,7 +37,7 @@ ping_mod2 = ctl.get_module("IcmpPing",
options={
"addr" : g2.get_ip("guestnic", 0),
"count" : 100,
- "iface" : g4.get_ip("guestnic"),
+ "iface" : g4.get_devname("guestnic"),
"interval" : 0.1
})
--
1.9.3
8 years, 3 months
[PATCH] Add timeout to _poll_loop function to avoid infinite looping
by Jiri Prochazka
When Slave is using NetworkManager, polling is used to activate DBus connection.
This may result in infinite loop (eg. when device is not in LOWER_UP state, but is in UP state).
This patch adds timeout control in _poll_loop method, timeout value is set to 10s.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 8e2f1dd..3da54f1 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -153,10 +153,14 @@ class NmConfigDeviceGeneric(object):
self._loop.quit()
def _poll_loop(self, func, expected_val, *args):
- while True:
+ timer = 0
+ while timer < 10:
if func(*args) == expected_val:
- break
+ return
time.sleep(1)
+ timer += 1
+ msg = "Timed out during NetworkManager polling."
+ raise Exception(msg)
def _convert_hwaddr(self, dev_config):
if "hwaddr" in dev_config:
--
2.4.3
8 years, 3 months
[PATCH] Add timeout to _poll_loop function to avoid infinite looping
by Jiri Prochazka
When Slave is using NetworkManager, polling is used to activate DBus connection.
This may result in infinite loop (eg. when device is not in LOWER_UP state, but is in UP state).
This patch adds timeout control in _poll_loop method, timeout value is set to 10s.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 8e2f1dd..82e0cb8 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -153,10 +153,14 @@ class NmConfigDeviceGeneric(object):
self._loop.quit()
def _poll_loop(self, func, expected_val, *args):
- while True:
+ timer = 0
+ while timer < 10:
if func(*args) == expected_val:
break
time.sleep(1)
+ timer += 1
+ msg = "Timed out during NetworkManager polling."
+ raise Exception(msg)
def _convert_hwaddr(self, dev_config):
if "hwaddr" in dev_config:
--
2.4.3
8 years, 3 months
[PATCH] Fix issue 124 - define non-unique interface IDs
by Jiri Prochazka
This patch fixes possibility to define interfaces with non-unique IDs per machine.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/RecipeParser.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 73422f1..936a870 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -66,10 +66,18 @@ class RecipeParser(XmlParser):
machine["interfaces"] = XmlCollection(interfaces_tag)
lo_netns = []
+ unique_ids = []
for interface_tag in interfaces_tag:
interfaces = self._process_interface(interface_tag)
for interface in interfaces:
+ if interface['id'] in unique_ids:
+ msg = "Interface with ID \"%s\" has already been "\
+ "defined for this machine." % interface['id']
+ raise RecipeError(msg, interface_tag)
+ else:
+ unique_ids.append(interface['id'])
+
if interface['type'] != 'lo':
continue
elif interface['netns'] in lo_netns:
@@ -77,6 +85,7 @@ class RecipeParser(XmlParser):
raise RecipeError(msg, interface_tag)
else:
lo_netns.append(interface['netns'])
+
machine["interfaces"].extend(interfaces)
return machine
--
2.4.3
8 years, 3 months
[PATCH] Fix issue 124
by Jiri Prochazka
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/RecipeParser.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 73422f1..936a870 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -66,10 +66,18 @@ class RecipeParser(XmlParser):
machine["interfaces"] = XmlCollection(interfaces_tag)
lo_netns = []
+ unique_ids = []
for interface_tag in interfaces_tag:
interfaces = self._process_interface(interface_tag)
for interface in interfaces:
+ if interface['id'] in unique_ids:
+ msg = "Interface with ID \"%s\" has already been "\
+ "defined for this machine." % interface['id']
+ raise RecipeError(msg, interface_tag)
+ else:
+ unique_ids.append(interface['id'])
+
if interface['type'] != 'lo':
continue
elif interface['netns'] in lo_netns:
@@ -77,6 +85,7 @@ class RecipeParser(XmlParser):
raise RecipeError(msg, interface_tag)
else:
lo_netns.append(interface['netns'])
+
machine["interfaces"].extend(interfaces)
return machine
--
2.4.3
8 years, 3 months