This commit replaces InterfaceAPI methods get_ip() and get_devname() with
HostAPI methods which are supported and recommended.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
.../phase1/virtual_bridge_2_vlans_over_bond.py | 93 ++++++++++++----------
.../phase1/virtual_bridge_vlan_in_guest.py | 46 ++++++-----
.../phase1/virtual_bridge_vlan_in_host.py | 45 ++++++-----
3 files changed, 102 insertions(+), 82 deletions(-)
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 ed2de32..e1c7796 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
@@ -46,125 +46,134 @@ nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
+h1_nic1 = h1.get_interface("nic1")
+h1_nic2 = h1.get_interface("nic2")
+h2_nic1 = h2.get_interface("nic1")
+h2_nic2 = h2.get_interface("nic2")
+g1_guestnic = g1.get_interface("guestnic")
+g2_guestnic = g2.get_interface("guestnic")
+g3_guestnic = g3.get_interface("guestnic")
+g4_guestnic = g4.get_interface("guestnic")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : g3.get_ip("guestnic", 0),
+ "addr" : g3_guestnic.get_ip(0),
"count" : 100,
- "iface" : g1.get_devname("guestnic"),
+ "iface" : g1_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod2 = ctl.get_module("IcmpPing",
options={
- "addr" : g2.get_ip("guestnic", 0),
+ "addr" : g2_guestnic.get_ip(0),
"count" : 100,
- "iface" : g4.get_devname("guestnic"),
+ "iface" : g4_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod6 = ctl.get_module("Icmp6Ping",
options={
- "addr" : g3.get_ip("guestnic", 1),
+ "addr" : g3_guestnic.get_ip(1),
"count" : 100,
- "iface" : g1.get_devname("guestnic"),
+ "iface" : g1_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod62 = ctl.get_module("Icmp6Ping",
options={
- "addr" : g2.get_ip("guestnic", 1),
+ "addr" : g2_guestnic.get_ip(1),
"count" : 100,
- "iface" : g4.get_devname("guestnic"),
+ "iface" : g4_guestnic.get_devname(),
"interval" : 0.1
})
netperf_srv = ctl.get_module("Netperf",
options={
"role": "server",
- "bind" : g1.get_ip("guestnic")
+ "bind" : g1_guestnic.get_ip(0)
})
netperf_srv6 = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : g1.get_ip("guestnic", 1),
+ "bind" : g1_guestnic.get_ip(1),
"netperf_opts" : " -6",
})
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
- "netperf_server" :
g1.get_ip("guestnic"),
+ "netperf_server" :
g1_guestnic.get_ip(0),
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" : "-i %s -L %s"
%
- (nperf_max_runs,
g3.get_ip("guestnic"))
+ (nperf_max_runs,
g3_guestnic.get_ip(0))
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
- "netperf_server" :
g1.get_ip("guestnic"),
+ "netperf_server" :
g1_guestnic.get_ip(0),
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" : "-i %s -L %s"
%
- (nperf_max_runs,
g3.get_ip("guestnic"))
+ (nperf_max_runs,
g3_guestnic.get_ip(0))
})
netperf_cli_tcp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- g1.get_ip("guestnic", 1),
+ g1_guestnic.get_ip(1),
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" :
- "-i %s -L %s -6" % (nperf_max_runs,
g3.get_ip("guestnic", 1))
+ "-i %s -L %s -6" % (nperf_max_runs,
g3_guestnic.get_ip(1))
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- g1.get_ip("guestnic", 1),
+ g1_guestnic.get_ip(1),
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" :
- "-i %s -L %s -6" % (nperf_max_runs,
g3.get_ip("guestnic", 1))
+ "-i %s -L %s -6" % (nperf_max_runs,
g3_guestnic.get_ip(1))
})
ping_mod_bad = ctl.get_module("IcmpPing",
options={
- "addr" : g4.get_ip("guestnic"),
+ "addr" : g4_guestnic.get_ip(0),
"count" : 100,
- "iface" :
g1.get_devname("guestnic"),
+ "iface" : g1_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod_bad2 = ctl.get_module("IcmpPing",
options={
- "addr" : g2.get_ip("guestnic"),
+ "addr" : g2_guestnic.get_ip(0),
"count" : 100,
- "iface" :
g3.get_devname("guestnic"),
+ "iface" : g3_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod6_bad = ctl.get_module("Icmp6Ping",
options={
- "addr" : g4.get_ip("guestnic", 1),
+ "addr" : g4_guestnic.get_ip(1),
"count" : 100,
- "iface" : g1.get_devname("guestnic"),
+ "iface" : g1_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod6_bad2 = ctl.get_module("Icmp6Ping",
options={
- "addr" : g2.get_ip("guestnic", 1),
+ "addr" : g2_guestnic.get_ip(1),
"count" : 100,
- "iface" : g3.get_devname("guestnic"),
+ "iface" : g3_guestnic.get_devname(),
"interval" : 0.1
})
@@ -194,21 +203,21 @@ ctl.wait(15)
for setting in offload_settings:
for offload in setting:
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic1"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic1.get_devname(),
offload[0], offload[1]))
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic2"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic2.get_devname(),
offload[0], offload[1]))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic1"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic1.get_devname(),
offload[0], offload[1]))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic2"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic2.get_devname(),
offload[0], offload[1]))
- g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
+ g1.run("ethtool -K %s %s %s" % (g1_guestnic.get_devname(),
offload[0], offload[1]))
- g2.run("ethtool -K %s %s %s" % (g2.get_devname("guestnic"),
+ g2.run("ethtool -K %s %s %s" % (g2_guestnic.get_devname(),
offload[0], offload[1]))
- g3.run("ethtool -K %s %s %s" % (g3.get_devname("guestnic"),
+ g3.run("ethtool -K %s %s %s" % (g3_guestnic.get_devname(),
offload[0], offload[1]))
- g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
+ g4.run("ethtool -K %s %s %s" % (g4_guestnic.get_devname(),
offload[0], offload[1]))
if ipv in [ 'ipv4', 'both' ]:
@@ -317,19 +326,19 @@ for setting in offload_settings:
#reset offload states
for offload in offloads:
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic1"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic1.get_devname(),
offload, "on"))
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic2"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic2.get_devname(),
offload, "on"))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic1"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic1.get_devname(),
offload, "on"))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic2"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic2.get_devname(),
offload, "on"))
- g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
+ g1.run("ethtool -K %s %s %s" % (g1_guestnic.get_devname(),
offload, "on"))
- g2.run("ethtool -K %s %s %s" % (g2.get_devname("guestnic"),
+ g2.run("ethtool -K %s %s %s" % (g2_guestnic.get_devname(),
offload, "on"))
- g3.run("ethtool -K %s %s %s" % (g3.get_devname("guestnic"),
+ g3.run("ethtool -K %s %s %s" % (g3_guestnic.get_devname(),
offload, "on"))
- g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
+ g4.run("ethtool -K %s %s %s" % (g4_guestnic.get_devname(),
offload, "on"))
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 b762f8c..81e4a25 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -40,79 +40,85 @@ nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
+h2_vlan10 = h2.get_interface("vlan10")
+g1_vlan10 = g1.get_interface("vlan10")
+g1_guestnic = g1.get_interface("guestnic")
+h1_nic = h1.get_interface("nic")
+h2_nic = h2.get_interface("nic")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : h2.get_ip("vlan10", 0),
+ "addr" : h2_vlan10.get_ip(0),
"count" : 100,
- "iface" : g1.get_devname("vlan10"),
+ "iface" : g1_vlan10.get_devname(),
"interval" : 0.1
})
ping_mod6 = ctl.get_module("Icmp6Ping",
options={
- "addr" : h2.get_ip("vlan10", 1),
+ "addr" : h2_vlan10.get_ip(1),
"count" : 100,
- "iface" : g1.get_ip("vlan10", 1),
+ "iface" : g1_vlan10.get_ip(1),
"interval" : 0.1
})
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : g1.get_ip("vlan10")
+ "bind" : g1_vlan10.get_ip(0)
})
netperf_srv6 = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : g1.get_ip("vlan10", 1),
+ "bind" : g1_vlan10.get_ip(1),
"netperf_opts" : " -6",
})
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
- "netperf_server" :
g1.get_ip("vlan10"),
+ "netperf_server" : g1_vlan10.get_ip(0),
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" : "-i %s -L %s"
%
- (nperf_max_runs,
h2.get_ip("vlan10"))
+ (nperf_max_runs,
h2_vlan10.get_ip(0))
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
- "netperf_server" :
g1.get_ip("vlan10"),
+ "netperf_server" : g1_vlan10.get_ip(0),
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" : "-i %s -L %s"
%
- (nperf_max_runs,
h2.get_ip("vlan10"))
+ (nperf_max_runs,
h2_vlan10.get_ip(0))
})
netperf_cli_tcp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- g1.get_ip("vlan10", 1),
+ g1_vlan10.get_ip(1),
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" :
- "-i %s -L %s -6" % (nperf_max_runs,
h2.get_ip("vlan10", 1))
+ "-i %s -L %s -6" % (nperf_max_runs,
h2_vlan10.get_ip(1))
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- g1.get_ip("vlan10", 1),
+ g1_vlan10.get_ip(1),
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" :
- "-i %s -L %s -6" % (nperf_max_runs,
h2.get_ip("vlan10", 1))
+ "-i %s -L %s -6" % (nperf_max_runs,
h2_vlan10.get_ip(1))
})
# configure mtu
@@ -129,11 +135,11 @@ ctl.wait(15)
for setting in offload_settings:
for offload in setting:
- g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
+ g1.run("ethtool -K %s %s %s" % (g1_guestnic.get_devname(),
offload[0], offload[1]))
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic.get_devname(),
offload[0], offload[1]))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic.get_devname(),
offload[0], offload[1]))
if ipv in [ 'ipv4', 'both' ]:
@@ -236,9 +242,9 @@ for setting in offload_settings:
#reset offload states
for offload in offloads:
- g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
+ g1.run("ethtool -K %s %s %s" % (g1_guestnic.get_devname(),
offload, "on"))
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic.get_devname(),
offload, "on"))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic.get_devname(),
offload, "on"))
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 4c1a454..e5d4927 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -40,79 +40,84 @@ nperf_max_runs = int(ctl.get_alias("nperf_max_runs"))
mtu = ctl.get_alias("mtu")
enable_udp_perf = ctl.get_alias("enable_udp_perf")
+h2_vlan10 = h2.get_interface("vlan10")
+g1_guestnic= g1.get_interface("guestnic")
+h1_nic = h1.get_interface("nic")
+h2_nic = h2.get_interface("nic")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : h2.get_ip("vlan10"),
+ "addr" : h2_vlan10.get_ip(0),
"count" : 100,
- "iface" : g1.get_devname("guestnic"),
+ "iface" : g1_guestnic.get_devname(),
"interval" : 0.1
})
ping_mod6 = ctl.get_module("Icmp6Ping",
options={
- "addr" : h2.get_ip("vlan10", 1),
+ "addr" : h2_vlan10.get_ip(1),
"count" : 100,
- "iface" : g1.get_ip("guestnic", 1),
+ "iface" : g1_guestnic.get_ip(1),
"interval" : 0.1
})
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : g1.get_ip("guestnic")
+ "bind" : g1_guestnic.get_ip(0)
})
netperf_srv6 = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : g1.get_ip("guestnic", 1),
+ "bind" : g1_guestnic.get_ip(1),
"netperf_opts" : " -6",
})
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
- "netperf_server" :
g1.get_ip("guestnic"),
+ "netperf_server" :
g1_guestnic.get_ip(0),
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" : "-i %s -L %s"
%
- (nperf_max_runs,
h2.get_ip("vlan10"))
+ (nperf_max_runs,
h2_vlan10.get_ip(0))
})
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
- "netperf_server" :
g1.get_ip("guestnic"),
+ "netperf_server" :
g1_guestnic.get_ip(0),
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" : "-i %s -L %s"
%
- (nperf_max_runs,
h2.get_ip("vlan10"))
+ (nperf_max_runs,
h2_vlan10.get_ip(0))
})
netperf_cli_tcp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- g1.get_ip("guestnic", 1),
+ g1_guestnic.get_ip(1),
"duration" : netperf_duration,
"testname" : "TCP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" :
- "-i %s -L %s -6" % (nperf_max_runs,
h2.get_ip("vlan10", 1))
+ "-i %s -L %s -6" % (nperf_max_runs,
h2_vlan10.get_ip(1))
})
netperf_cli_udp6 = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- g1.get_ip("guestnic", 1),
+ g1_guestnic.get_ip(1),
"duration" : netperf_duration,
"testname" : "UDP_STREAM",
"confidence" : nperf_confidence,
"netperf_opts" :
- "-i %s -L %s -6" % (nperf_max_runs,
h2.get_ip("vlan10", 1))
+ "-i %s -L %s -6" % (nperf_max_runs,
h2_vlan10.get_ip(1))
})
# configure mtu
@@ -130,11 +135,11 @@ ctl.wait(15)
for setting in offload_settings:
for offload in setting:
- g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
+ g1.run("ethtool -K %s %s %s" % (g1_guestnic.get_devname(),
offload[0], offload[1]))
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic.get_devname(),
offload[0], offload[1]))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic.get_devname(),
offload[0], offload[1]))
if ipv in [ 'ipv4', 'both' ]:
@@ -237,9 +242,9 @@ for setting in offload_settings:
#reset offload states
for offload in offloads:
- g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
+ g1.run("ethtool -K %s %s %s" % (g1_guestnic.get_devname(),
offload, "on"))
- h1.run("ethtool -K %s %s %s" % (h1.get_devname("nic"),
+ h1.run("ethtool -K %s %s %s" % (h1_nic.get_devname(),
offload, "on"))
- h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ h2.run("ethtool -K %s %s %s" % (h2_nic.get_devname(),
offload, "on"))
--
2.4.3