From: Christos Sfakianakis <csfakian(a)redhat.com>
Adopt more consistent naming for machines and devices.
Have machine names indexed from 1 and device names indexed
from 0.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/BondRecipe.py | 66 ++++++------
lnst/Recipes/ENRT/DoubleBondRecipe.py | 74 ++++++-------
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 88 +++++++--------
lnst/Recipes/ENRT/PingFloodRecipe.py | 28 ++---
lnst/Recipes/ENRT/SimplePerfRecipe.py | 78 +++++++-------
lnst/Recipes/ENRT/TeamRecipe.py | 66 ++++++------
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 88 +++++++--------
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 36 +++----
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 36 +++----
.../VirtualBridgeVlanInHostMirroredRecipe.py | 30 +++---
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 34 +++---
.../ENRT/VirtualBridgeVlansOverBondRecipe.py | 100 +++++++++---------
...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 52 ++++-----
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 38 +++----
...irtualOvsBridgeVlanInHostMirroredRecipe.py | 35 +++---
.../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 26 ++---
.../VirtualOvsBridgeVlansOverBondRecipe.py | 57 +++++-----
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 94 ++++++++--------
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 94 ++++++++--------
lnst/Recipes/ENRT/VlansRecipe.py | 84 +++++++--------
20 files changed, 601 insertions(+), 603 deletions(-)
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py
index 8305ddd..1b4dd75 100644
--- a/lnst/Recipes/ENRT/BondRecipe.py
+++ b/lnst/Recipes/ENRT/BondRecipe.py
@@ -9,12 +9,12 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe,
EnrtConfiguration
from lnst.Devices import BondDevice
class BondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="net1")
+ host1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="net1")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -26,58 +26,58 @@ class BondRecipe(BaseEnrtRecipe):
miimon_value = IntParam(mandatory=True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.bond0 = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
- m1.eth0.down()
- m1.eth1.down()
- m1.bond0.slave_add(m1.eth0)
- m1.bond0.slave_add(m1.eth1)
+ host1.bond0 = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
+ host1.eth0.down()
+ host1.eth1.down()
+ host1.bond0.slave_add(host1.eth0)
+ host1.bond0.slave_add(host1.eth1)
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.bond0
- configuration.endpoint2 = m2.eth0
+ configuration.endpoint1 = host1.bond0
+ configuration.endpoint2 = host2.eth0
if "mtu" in self.params:
- m1.bond0.mtu = self.params.mtu
- m2.eth0.mtu = self.params.mtu
+ host1.bond0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
net_addr = "192.168.101"
net_addr6 = "fc00:0:0:0"
- m1.bond0.ip_add(ipaddress(net_addr + ".1/24"))
- m1.bond0.ip_add(ipaddress(net_addr6 + "::1/64"))
- m1.eth0.up()
- m1.eth1.up()
- m1.bond0.up()
+ host1.bond0.ip_add(ipaddress(net_addr + ".1/24"))
+ host1.bond0.ip_add(ipaddress(net_addr6 + "::1/64"))
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.bond0.up()
- m2.eth0.ip_add(ipaddress(net_addr + ".2/24"))
- m2.eth0.ip_add(ipaddress(net_addr6 + "::2/64"))
- m2.eth0.up()
+ host2.eth0.ip_add(ipaddress(net_addr + ".2/24"))
+ host2.eth0.ip_add(ipaddress(net_addr6 + "::2/64"))
+ host2.eth0.up()
if "adaptive_rx_coalescing" in self.params:
- for dev in [m1.eth0, m1.eth1, m2.eth0]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for dev in [m1.eth0, m1.eth1, m2.eth0]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m1.eth0, m1.eth1, m2.eth0]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m, d in [(m1, m1.eth0), (m1, m1.eth1), (m2, m2.eth0)]:
- m.run("tc qdisc replace dev %s root mq" % d.name)
+ for host, dev in [(host1, host1.eth0), (host1, host1.eth1), (host2,
host2.eth0)]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py
b/lnst/Recipes/ENRT/DoubleBondRecipe.py
index 23d695b..a3cb3bb 100644
--- a/lnst/Recipes/ENRT/DoubleBondRecipe.py
+++ b/lnst/Recipes/ENRT/DoubleBondRecipe.py
@@ -9,13 +9,13 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe,
EnrtConfiguration
from lnst.Devices import BondDevice
class DoubleBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="net1")
+ host1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- m2.eth1 = DeviceReq(label="net1")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="net1")
+ host2.eth1 = DeviceReq(label="net1")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -27,59 +27,59 @@ class DoubleBondRecipe(BaseEnrtRecipe):
miimon_value = IntParam(mandatory=True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- for m in (m1, m2):
- m.bond = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
- m.eth0.down()
- m.eth1.down()
- m.bond.slave_add(m.eth0)
- m.bond.slave_add(m.eth1)
+ for host in (host1, host2):
+ host.bond0 = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
+ host.eth0.down()
+ host.eth1.down()
+ host.bond0.slave_add(host.eth0)
+ host.bond0.slave_add(host.eth1)
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.bond
- configuration.endpoint2 = m2.bond
+ configuration.endpoint1 = host1.bond0
+ configuration.endpoint2 = host2.bond0
if "mtu" in self.params:
- m1.bond.mtu = self.params.mtu
- m2.bond.mtu = self.params.mtu
+ host1.bond0.mtu = self.params.mtu
+ host2.bond0.mtu = self.params.mtu
net_addr = "192.168.101"
net_addr6 = "fc00:0:0:0"
- for i, m in enumerate([m1, m2]):
- m.bond.ip_add(ipaddress(net_addr + "." + str(i+1) +
"/24"))
- m.bond.ip_add(ipaddress(net_addr6 + "::" + str(i+1) +
"/64"))
- m.eth0.up()
- m.eth1.up()
- m.bond.up()
+ for i, host in enumerate([host1, host2]):
+ host.bond0.ip_add(ipaddress(net_addr + "." + str(i+1) +
"/24"))
+ host.bond0.ip_add(ipaddress(net_addr6 + "::" + str(i+1) +
"/64"))
+ host.eth0.up()
+ host.eth1.up()
+ host.bond0.up()
if "adaptive_tx_coalescing" in self.params:
- for m in [m1, m2]:
- for dev in [m.eth0, m.eth1]:
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for m in [m1, m2]:
- for dev in [m.eth0, m.eth1]:
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m.eth0, m.eth1]:
- self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host.eth0, host.eth1]:
+ self._pin_dev_interrupts(host.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [m1, m2]:
- for dev in [m.eth0, m.eth1]:
- m.run("tc qdisc replace dev %s root mq" % dev.name)
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py
b/lnst/Recipes/ENRT/DoubleTeamRecipe.py
index 6449b3a..a4f9d5b 100644
--- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py
+++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py
@@ -9,13 +9,13 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe,
EnrtConfiguration
from lnst.Devices import TeamDevice
class DoubleTeamRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth1 = DeviceReq(label="tnet")
- m1.eth2 = DeviceReq(label="tnet")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="tnet")
+ host1.eth1 = DeviceReq(label="tnet")
- m2 = HostReq()
- m2.eth1 = DeviceReq(label="tnet")
- m2.eth2 = DeviceReq(label="tnet")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="tnet")
+ host2.eth1 = DeviceReq(label="tnet")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -27,73 +27,73 @@ class DoubleTeamRecipe(BaseEnrtRecipe):
runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.eth1.down()
- m1.eth2.down()
+ host1.eth0.down()
+ host1.eth1.down()
#The config argument needs to be used with a team device normally (e.g to
specify
#the runner mode), but it is not used here due to a bug in the TeamDevice module
- m1.team = TeamDevice()
- m1.team.slave_add(m1.eth1)
- m1.team.slave_add(m1.eth2)
+ host1.team0 = TeamDevice()
+ host1.team0.slave_add(host1.eth0)
+ host1.team0.slave_add(host1.eth1)
- m2.eth1.down()
- m2.eth2.down()
- m2.team = TeamDevice()
- m2.team.slave_add(m2.eth1)
- m2.team.slave_add(m2.eth2)
+ host2.eth0.down()
+ host2.eth1.down()
+ host2.team0 = TeamDevice()
+ host2.team0.slave_add(host2.eth0)
+ host2.team0.slave_add(host2.eth1)
#EnrtConfiguration and both-side Netperf config need to be checked
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.team
- configuration.endpoint2 = m2.team
+ configuration.endpoint1 = host1.team0
+ configuration.endpoint2 = host2.team0
if "mtu" in self.params:
- m1.team.mtu = self.params.mtu
- m2.team.mtu = self.params.mtu
+ host1.team0.mtu = self.params.mtu
+ host2.team0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
- m1.team.ip_add(ipaddress(net_addr_1 + ".1/24"))
- m1.team.ip_add(ipaddress(net_addr6_1 + "::1/64"))
- m2.team.ip_add(ipaddress(net_addr_1 + ".2/24"))
- m2.team.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ host1.team0.ip_add(ipaddress(net_addr_1 + ".1/24"))
+ host1.team0.ip_add(ipaddress(net_addr6_1 + "::1/64"))
+ host2.team0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.team0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
- m1.eth1.up()
- m1.eth2.up()
- m1.team.up()
- m2.eth1.up()
- m2.eth2.up()
- m2.team.up()
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.team0.up()
+ host2.eth0.up()
+ host2.eth1.up()
+ host2.team0.up()
if "adaptive_rx_coalescing" in self.params:
- for m in [m1, m2]:
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for m in [m1, m2]:
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host.eth0, host.eth1]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [m1, m2]:
- for dev in [m.eth1, m.eth2]:
- m.run("tc qdisc replace dev %s root mq" % dev.name)
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/PingFloodRecipe.py b/lnst/Recipes/ENRT/PingFloodRecipe.py
index b7fff01..8512335 100644
--- a/lnst/Recipes/ENRT/PingFloodRecipe.py
+++ b/lnst/Recipes/ENRT/PingFloodRecipe.py
@@ -10,11 +10,11 @@ from lnst.Controller import HostReq, DeviceReq
from lnst.RecipeCommon.Ping import PingConf, PingTestAndEvaluate
class PingFloodRecipe(PingTestAndEvaluate):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="net1")
#TODO: use a parameter for the network
src_addr = StrParam(default = "192.168.1.1/24")
@@ -24,25 +24,25 @@ class PingFloodRecipe(PingTestAndEvaluate):
size = IntParam(default = None)
def test(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.eth0.ip_add(ipaddress(self.params.src_addr))
- m2.eth0.ip_add(ipaddress(self.params.dst_addr))
+ host1.eth0.ip_add(ipaddress(self.params.src_addr))
+ host2.eth0.ip_add(ipaddress(self.params.dst_addr))
if "mtu" in self.params:
- m1.eth0.mtu = self.params.mtu
- m2.eth0.mtu = self.params.mtu
+ host1.eth0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
- m1.eth0.up()
- m2.eth0.up()
+ host1.eth0.up()
+ host2.eth0.up()
- if1 = m1.eth0
- ip2 = m2.eth0.ips[0]
+ if1 = host1.eth0
+ ip2 = host2.eth0.ips[0]
cn = self.params.count
iv = self.params.interval
sz = self.params.size
- pcfg=PingConf(m1, if1, m2, ip2, count = cn, interval = iv, size = sz or None)
+ pcfg=PingConf(host1, if1, host2, ip2, count = cn, interval = iv, size = sz or
None)
result = self.ping_test(pcfg)
self.ping_evaluate_and_report(pcfg, result)
diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py
b/lnst/Recipes/ENRT/SimplePerfRecipe.py
index 2c3f717..1f0c614 100644
--- a/lnst/Recipes/ENRT/SimplePerfRecipe.py
+++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py
@@ -7,11 +7,11 @@ from lnst.Controller import HostReq, DeviceReq, RecipeParam
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
class SimplePerfRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="net1",
driver=RecipeParam("driver"))
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="net1",
driver=RecipeParam("driver"))
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on", rx="on"),
@@ -21,65 +21,65 @@ class SimplePerfRecipe(BaseEnrtRecipe):
dict(gro="on", gso="on", tso="on",
tx="on", rx="off")))
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.eth0
- configuration.endpoint2 = m2.eth0
+ configuration.endpoint1 = host1.eth0
+ configuration.endpoint2 = host2.eth0
if "mtu" in self.params:
- m1.eth0.mtu = self.params.mtu
- m2.eth0.mtu = self.params.mtu
+ host1.eth0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
#TODO redo
# configuration.saved_coalescing_state = dict(
- # m1_if = dict(tx = m1.eth0.adaptive_tx_coalescing,
- # rx = m1.eth0.adaptive_rx_coalescing),
- # m2_if = dict(tx = m2.eth0.adaptive_tx_coalescing,
- # rx = m2.eth0.adaptive_rx_coalescing))
+ # host1_if = dict(tx = host1.eth0.adaptive_tx_coalescing,
+ # rx = host1.eth0.adaptive_rx_coalescing),
+ # host2_if = dict(tx = host2.eth0.adaptive_tx_coalescing,
+ # rx = host2.eth0.adaptive_rx_coalescing))
- # m1.eth0.adaptive_tx_coalescing = self.params.adaptive_coalescing
- # m1.eth0.adaptive_rx_coalescing = self.params.adaptive_coalescing
- # m2.eth0.adaptive_tx_coalescing = self.params.adaptive_coalescing
- # m2.eth0.adaptive_rx_coalescing = self.params.adaptive_coalescing
+ # host1.eth0.adaptive_tx_coalescing = self.params.adaptive_coalescing
+ # host1.eth0.adaptive_rx_coalescing = self.params.adaptive_coalescing
+ # host2.eth0.adaptive_tx_coalescing = self.params.adaptive_coalescing
+ # host2.eth0.adaptive_rx_coalescing = self.params.adaptive_coalescing
- m1.eth0.ip_add(ipaddress("192.168.101.1/24"))
- m1.eth0.ip_add(ipaddress("fc00::1/64"))
- m1.eth0.up()
+ host1.eth0.ip_add(ipaddress("192.168.101.1/24"))
+ host1.eth0.ip_add(ipaddress("fc00::1/64"))
+ host1.eth0.up()
- m2.eth0.ip_add(ipaddress("192.168.101.2/24"))
- m2.eth0.ip_add(ipaddress("fc00::2/64"))
- m2.eth0.up()
+ host2.eth0.ip_add(ipaddress("192.168.101.2/24"))
+ host2.eth0.ip_add(ipaddress("fc00::2/64"))
+ host2.eth0.up()
if "adaptive_rx_coalescing" in self.params:
- for m in [m1, m2]:
- m.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
+ for host in [host1, host2]:
+ host.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for m in [m1, m2]:
- m.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
+ for host in [host1, host2]:
+ host.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [m1, m2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
# redo
- # m1.eth0.adaptive_tx_coalescing =
self.saved_coalescing_state["m1_if"]["tx"]
- # m1.eth0.adaptive_rx_coalescing =
self.saved_coalescing_state["m1_if"]["rx"]
- # m2.eth0.adaptive_tx_coalescing =
self.saved_coalescing_state["m2_if"]["tx"]
- # m2.eth0.adaptive_rx_coalescing =
self.saved_coalescing_state["m2_if"]["rx"]
+ # host1.eth0.adaptive_tx_coalescing =
self.saved_coalescing_state["host1_if"]["tx"]
+ # host1.eth0.adaptive_rx_coalescing =
self.saved_coalescing_state["host1_if"]["rx"]
+ # host2.eth0.adaptive_tx_coalescing =
self.saved_coalescing_state["host2_if"]["tx"]
+ # host2.eth0.adaptive_rx_coalescing =
self.saved_coalescing_state["host2_if"]["rx"]
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index ea2dd7a..98e10ce 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -9,12 +9,12 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe,
EnrtConfiguration
from lnst.Devices import TeamDevice
class TeamRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth1 = DeviceReq(label="tnet")
- m1.eth2 = DeviceReq(label="tnet")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="tnet")
+ host1.eth1 = DeviceReq(label="tnet")
- m2 = HostReq()
- m2.eth1 = DeviceReq(label="tnet")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="tnet")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -26,62 +26,62 @@ class TeamRecipe(BaseEnrtRecipe):
runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.eth1.down()
- m1.eth2.down()
+ host1.eth0.down()
+ host1.eth1.down()
#The config argument needs to be used with a team device normally (e.g to
specify
#the runner mode), but it is not used here due to a bug in the TeamDevice module
- m1.team = TeamDevice()
- m1.team.slave_add(m1.eth1)
- m1.team.slave_add(m1.eth2)
+ host1.team0 = TeamDevice()
+ host1.team0.slave_add(host1.eth0)
+ host1.team0.slave_add(host1.eth1)
#EnrtConfiguration and both-side Netperf config need to be checked
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.team
- configuration.endpoint2 = m2.eth1
+ configuration.endpoint1 = host1.team0
+ configuration.endpoint2 = host2.eth0
if "mtu" in self.params:
- m1.team.mtu = self.params.mtu
- m2.eth1.mtu = self.params.mtu
+ host1.team0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
- m1.team.ip_add(ipaddress(net_addr_1 + ".1/24"))
- m1.team.ip_add(ipaddress(net_addr6_1 + "::1/64"))
- m2.eth1.ip_add(ipaddress(net_addr_1 + ".2/24"))
- m2.eth1.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ host1.team0.ip_add(ipaddress(net_addr_1 + ".1/24"))
+ host1.team0.ip_add(ipaddress(net_addr6_1 + "::1/64"))
+ host2.eth0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.eth0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
- m1.eth1.up()
- m1.eth2.up()
- m1.team.up()
- m2.eth1.up()
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.team0.up()
+ host2.eth0.up()
if "adaptive_rx_coalescing" in self.params:
- for dev in [m1.eth1, m1.eth2, m2.eth1]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for dev in [m1.eth1, m1.eth2, m2.eth1]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m1.eth1, m1.eth2, m2.eth1]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m, d in [(m1, m1.eth1), (m1, m1.eth2), (m2, m2.eth1)]:
- m.run("tc qdisc replace dev %s root mq" % d.name)
+ for host, dev in [(host1, host1.eth0), (host1, host1.eth1), (host2,
host2.eth0)]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
index 8a5b8b3..4820f65 100644
--- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py
+++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py
@@ -11,13 +11,13 @@ from lnst.Devices import TeamDevice
from lnst.Devices import BondDevice
class TeamVsBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth1 = DeviceReq(label="tnet")
- m1.eth2 = DeviceReq(label="tnet")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="tnet")
+ host1.eth1 = DeviceReq(label="tnet")
- m2 = HostReq()
- m2.eth1 = DeviceReq(label="tnet")
- m2.eth2 = DeviceReq(label="tnet")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="tnet")
+ host2.eth1 = DeviceReq(label="tnet")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -31,73 +31,73 @@ class TeamVsBondRecipe(BaseEnrtRecipe):
miimon_value = IntParam(mandatory = True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.eth1.down()
- m1.eth2.down()
+ host1.eth0.down()
+ host1.eth1.down()
#The config argument needs to be used with a team device normally (e.g to
specify
#the runner mode), but it is not used here due to a bug in the TeamDevice module
- m1.team = TeamDevice()
- m1.team.slave_add(m1.eth1)
- m1.team.slave_add(m1.eth2)
+ host1.team0 = TeamDevice()
+ host1.team0.slave_add(host1.eth0)
+ host1.team0.slave_add(host1.eth1)
- m2.eth1.down()
- m2.eth2.down()
- m2.bond = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
- m2.bond.slave_add(m2.eth1)
- m2.bond.slave_add(m2.eth2)
+ host2.eth0.down()
+ host2.eth1.down()
+ host2.bond0 = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
+ host2.bond0.slave_add(host2.eth0)
+ host2.bond0.slave_add(host2.eth1)
#EnrtConfiguration and both-side Netperf config need to be checked
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.team
- configuration.endpoint2 = m2.bond
+ configuration.endpoint1 = host1.team0
+ configuration.endpoint2 = host2.bond0
if "mtu" in self.params:
- m1.team.mtu = self.params.mtu
- m2.bond.mtu = self.params.mtu
+ host1.team0.mtu = self.params.mtu
+ host2.bond0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
- m1.team.ip_add(ipaddress(net_addr_1 + ".1/24"))
- m1.team.ip_add(ipaddress(net_addr6_1 + "::1/64"))
- m2.bond.ip_add(ipaddress(net_addr_1 + ".2/24"))
- m2.bond.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ host1.team0.ip_add(ipaddress(net_addr_1 + ".1/24"))
+ host1.team0.ip_add(ipaddress(net_addr6_1 + "::1/64"))
+ host2.bond0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.bond0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
- m1.eth1.up()
- m1.eth2.up()
- m1.team.up()
- m2.eth1.up()
- m2.eth2.up()
- m2.bond.up()
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.team0.up()
+ host2.eth0.up()
+ host2.eth1.up()
+ host2.bond0.up()
if "adaptive_rx_coalescing" in self.params:
- for m in [m1, m2]:
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for m in [m1, m2]:
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host.eth0, host.eth1]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [m1, m2]:
- for dev in [m.eth1, m.eth2]:
- m.run("tc qdisc replace dev %s root mq" % dev.name)
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
index 9cd66a9..4232e36 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
@@ -48,16 +48,16 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host2.br0.slave_add(host2.tap0)
guest1.eth0.down()
- guest1.vlan1 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
+ guest1.vlan0 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
guest2.eth0.down()
- guest2.vlan1 = VlanDevice(realdev=guest2.eth0, vlan_id=10)
+ guest2.vlan0 = VlanDevice(realdev=guest2.eth0, vlan_id=10)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = guest1.vlan1
- configuration.endpoint2 = guest2.vlan1
+ configuration.endpoint1 = guest1.vlan0
+ configuration.endpoint2 = guest2.vlan0
if "mtu" in self.params:
host1.eth0.mtu = self.params.mtu
@@ -68,18 +68,18 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
- guest1.vlan1.mtu = self.params.mtu
- guest2.vlan1.mtu = self.params.mtu
+ guest1.vlan0.mtu = self.params.mtu
+ guest2.vlan0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
host1.br0.ip_add(ipaddress(net_addr_1 + ".1/24"))
host2.br0.ip_add(ipaddress(net_addr_1 + ".2/24"))
- guest1.vlan1.ip_add(ipaddress(net_addr_1 + ".3/24"))
- guest1.vlan1.ip_add(ipaddress(net_addr6_1 + "::3/64"))
- guest2.vlan1.ip_add(ipaddress(net_addr_1 + ".4/24"))
- guest2.vlan1.ip_add(ipaddress(net_addr6_1 + "::4/64"))
+ guest1.vlan0.ip_add(ipaddress(net_addr_1 + ".3/24"))
+ guest1.vlan0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
+ guest2.vlan0.ip_add(ipaddress(net_addr_1 + ".4/24"))
+ guest2.vlan0.ip_add(ipaddress(net_addr6_1 + "::4/64"))
host1.eth0.up()
host1.tap0.up()
@@ -88,22 +88,22 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host2.tap0.up()
host2.br0.up()
guest1.eth0.up()
- guest1.vlan1.up()
+ guest1.vlan0.up()
guest2.eth0.up()
- guest2.vlan1.up()
+ guest2.vlan0.up()
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -112,5 +112,5 @@ class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
index 44c5212..4875db7 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
@@ -38,54 +38,54 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
host1.br0.slave_add(host1.tap0)
host2.eth0.down()
- host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
guest1.eth0.down()
- guest1.vlan1 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
+ guest1.vlan0 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = guest1.vlan1
- configuration.endpoint2 = host2.vlan1
+ configuration.endpoint1 = guest1.vlan0
+ configuration.endpoint2 = host2.vlan0
if "mtu" in self.params:
host1.eth0.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
- guest1.vlan1.mtu = self.params.mtu
+ guest1.vlan0.mtu = self.params.mtu
host2.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
host1.br0.ip_add(ipaddress(net_addr_1 + ".1/24"))
- host2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24"))
- host2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64"))
- guest1.vlan1.ip_add(ipaddress(net_addr_1 + ".3/24"))
- guest1.vlan1.ip_add(ipaddress(net_addr6_1 + "::3/64"))
+ host2.vlan0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.vlan0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ guest1.vlan0.ip_add(ipaddress(net_addr_1 + ".3/24"))
+ guest1.vlan0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
host1.eth0.up()
host1.tap0.up()
host1.br0.up()
host2.eth0.up()
- host2.vlan1.up()
+ host2.vlan0.up()
guest1.eth0.up()
- guest1.vlan1.up()
+ guest1.vlan0.up()
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, 0)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, 0)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -94,5 +94,5 @@ class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
- for m in [host1, hpst2]:
- m.run("service irqbalance start")
+ for host in [host1, hpst2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
index 73a6f01..6e81279 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
@@ -37,16 +37,16 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1.eth0.down()
host1.tap0.down()
- host1.vlan1 = VlanDevice(realdev=host1.eth0, vlan_id=10)
+ host1.vlan0 = VlanDevice(realdev=host1.eth0, vlan_id=10)
host1.br0 = BridgeDevice()
- host1.br0.slave_add(host1.vlan1)
+ host1.br0.slave_add(host1.vlan0)
host1.br0.slave_add(host1.tap0)
host2.eth0.down()
host2.tap0.down()
- host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
host2.br0 = BridgeDevice()
- host2.br0.slave_add(host2.vlan1)
+ host2.br0.slave_add(host2.vlan0)
host2.br0.slave_add(host2.tap0)
guest1.eth0.down()
@@ -60,11 +60,11 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
if "mtu" in self.params:
host1.eth0.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
- host1.vlan1.mtu = self.params.mtu
+ host1.vlan0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host2.eth0.mtu = self.params.mtu
host2.tap0.mtu = self.params.mtu
- host2.vlan1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
@@ -81,11 +81,11 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1.eth0.up()
host1.tap0.up()
- host1.vlan1.up()
+ host1.vlan0.up()
host1.br0.up()
host2.eth0.up()
host2.tap0.up()
- host2.vlan1.up()
+ host2.vlan0.up()
host2.br0.up()
guest1.eth0.up()
guest2.eth0.up()
@@ -95,13 +95,13 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -110,5 +110,5 @@ class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
index fe3a07e..6b390a3 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
@@ -33,44 +33,44 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1.eth0.down()
host1.tap0.down()
- host1.vlan1 = VlanDevice(realdev=host1.eth0, vlan_id=10)
+ host1.vlan0 = VlanDevice(realdev=host1.eth0, vlan_id=10)
host1.br0 = BridgeDevice()
- host1.br0.slave_add(host1.vlan1)
+ host1.br0.slave_add(host1.vlan0)
host1.br0.slave_add(host1.tap0)
host2.eth0.down()
- host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
guest1.eth0.down()
configuration = EnrtConfiguration()
configuration.endpoint1 = guest1.eth0
- configuration.endpoint2 = host2.vlan1
+ configuration.endpoint2 = host2.vlan0
if "mtu" in self.params:
host1.eth0.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
- host1.vlan1.mtu = self.params.mtu
+ host1.vlan0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host2.eth0.mtu = self.params.mtu
- host2.vlan1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
host1.br0.ip_add(ipaddress(net_addr_1 + ".1/24"))
- host2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24"))
- host2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ host2.vlan0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.vlan0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
guest1.eth0.ip_add(ipaddress(net_addr_1 + ".3/24"))
guest1.eth0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
host1.eth0.up()
host1.tap0.up()
- host1.vlan1.up()
+ host1.vlan0.up()
host1.br0.up()
host2.eth0.up()
- host2.vlan1.up()
+ host2.vlan0.up()
guest1.eth0.up()
#TODO better service handling through HostAPI
@@ -78,13 +78,13 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, 0)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, 0)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -93,5 +93,5 @@ class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
index 316eb4f..16b9570 100644
--- a/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlansOverBondRecipe.py
@@ -48,25 +48,25 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
def test_wide_configuration(self):
host1, host2, guest1, guest2, guest3, guest4 = self.matched.host1,
self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3,
self.matched.guest4
- for m, n in [(host1, 10),(host2, 10)]:
- m.eth0.down()
- m.eth1.down()
- m.tap0.down()
- m.tap1.down()
- m.bond = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
- m.bond.slave_add(m.eth0)
- m.bond.slave_add(m.eth1)
- m.vlan1 = VlanDevice(realdev=m.bond, vlan_id=n)
- m.vlan2 = VlanDevice(realdev=m.bond, vlan_id=2*n)
- m.br0 = BridgeDevice()
- m.br0.slave_add(m.vlan1)
- m.br0.slave_add(m.tap0)
- m.br1 = BridgeDevice()
- m.br1.slave_add(m.vlan2)
- m.br1.slave_add(m.tap1)
-
- for m in (guest1, guest2, guest3, guest4):
- m.eth0.down()
+ for host, n in [(host1, 10), (host2, 10)]:
+ host.eth0.down()
+ host.eth1.down()
+ host.tap0.down()
+ host.tap1.down()
+ host.bond = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
+ host.bond.slave_add(host.eth0)
+ host.bond.slave_add(host.eth1)
+ host.vlan0 = VlanDevice(realdev=host.bond, vlan_id=n)
+ host.vlan1 = VlanDevice(realdev=host.bond, vlan_id=2*n)
+ host.br0 = BridgeDevice()
+ host.br0.slave_add(host.vlan0)
+ host.br0.slave_add(host.tap0)
+ host.br1 = BridgeDevice()
+ host.br1.slave_add(host.vlan1)
+ host.br1.slave_add(host.tap1)
+
+ for guest in (guest1, guest2, guest3, guest4):
+ guest.eth0.down()
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
@@ -78,15 +78,15 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
host1.bond.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
host1.tap1.mtu = self.params.mtu
+ host1.vlan0.mtu = self.params.mtu
host1.vlan1.mtu = self.params.mtu
- host1.vlan2.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host1.br1.mtu = self.params.mtu
host2.bond.mtu = self.params.mtu
host2.tap0.mtu = self.params.mtu
host2.tap1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
host2.vlan1.mtu = self.params.mtu
- host2.vlan2.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
host2.br1.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
@@ -99,42 +99,42 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
- for m, (g1, g2), n in [(host1, (guest1, guest2), 1), (host2, (guest3, guest4),
3)]:
- m.bond.ip_add(ipaddress("1.2.3.4"))
- m.br0.ip_add(ipaddress(net_addr_1 + "." + str(n) +
"/24"))
- m.br1.ip_add(ipaddress(net_addr_2 + "." + str(n) +
"/24"))
- g1.eth0.ip_add(ipaddress(net_addr_1 + "." + str(n+1) +
"/24"))
- g1.eth0.ip_add(ipaddress(net_addr6_1 + "::" + str(n+1) +
"/64"))
- g2.eth0.ip_add(ipaddress(net_addr_2 + "." + str(n+1) +
"/24"))
- g2.eth0.ip_add(ipaddress(net_addr6_2 + "::" + str(n+1) +
"/64"))
-
- for m, g1, g2 in [(host1, guest1, guest2), (host2, guest3, guest4)]:
- m.eth0.up()
- m.eth1.up()
- m.tap0.up()
- m.tap1.up()
- m.bond.up()
- m.vlan1.up()
- m.vlan2.up()
- m.br0.up()
- m.br1.up()
- g1.eth0.up()
- g2.eth0.up()
+ for host, (guest_a, guest_b), n in [(host1, (guest1, guest2), 1), (host2,
(guest3, guest4), 3)]:
+ host.bond.ip_add(ipaddress("1.2.3.4"))
+ host.br0.ip_add(ipaddress(net_addr_1 + "." + str(n) +
"/24"))
+ host.br1.ip_add(ipaddress(net_addr_2 + "." + str(n) +
"/24"))
+ guest_a.eth0.ip_add(ipaddress(net_addr_1 + "." + str(n+1) +
"/24"))
+ guest_a.eth0.ip_add(ipaddress(net_addr6_1 + "::" + str(n+1) +
"/64"))
+ guest_b.eth0.ip_add(ipaddress(net_addr_2 + "." + str(n+1) +
"/24"))
+ guest_b.eth0.ip_add(ipaddress(net_addr6_2 + "::" + str(n+1) +
"/64"))
+
+ for host, guest_a, guest_b in [(host1, guest1, guest2), (host2, guest3,
guest4)]:
+ host.eth0.up()
+ host.eth1.up()
+ host.tap0.up()
+ host.tap1.up()
+ host.bond.up()
+ host.vlan0.up()
+ host.vlan1.up()
+ host.br0.up()
+ host.br1.up()
+ guest_a.eth0.up()
+ guest_b.eth0.up()
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- for dev in [m.eth0, m.eth1]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host.eth0, host.eth1]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- for dev in [m.eth0, m.eth1]:
- m.run("tc qdisc replace dev %s root mq" % dev.name)
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
@@ -143,5 +143,5 @@ class VirtualBridgeVlansOverBondRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
index bb90d16..da3bd81 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
@@ -39,30 +39,30 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host1.eth1.down()
host1.tap0.down()
host1.br0 = OvsBridgeDevice()
- for m, d in [(host1, host1.eth1), (host1, host1.tap0)]:
- m.br0.port_add(d)
+ for host, dev in [(host1, host1.eth1), (host1, host1.tap0)]:
+ host.br0.port_add(dev)
host2.eth1.down()
host2.tap0.down()
host2.br0 = OvsBridgeDevice()
- for m, d in [(host2, host2.eth1), (host2, host2.tap0)]:
- if d.master != None:
- if "ovs" not in d.master.name:
- m.br0.port_add(d)
+ for host, dev in [(host2, host2.eth1), (host2, host2.tap0)]:
+ if dev.master != None:
+ if "ovs" not in dev.master.name:
+ host.br0.port_add(dev)
else:
- m.br0.port_add(d)
+ host.br0.port_add(dev)
guest1.eth0.down()
- guest1.vlan1 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
+ guest1.vlan0 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
guest2.eth0.down()
- guest2.vlan1 = VlanDevice(realdev=guest2.eth0, vlan_id=10)
+ guest2.vlan0 = VlanDevice(realdev=guest2.eth0, vlan_id=10)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = guest1.vlan1
- configuration.endpoint2 = guest2.vlan1
+ configuration.endpoint1 = guest1.vlan0
+ configuration.endpoint2 = guest2.vlan0
if "mtu" in self.params:
host1.eth1.mtu = self.params.mtu
@@ -72,17 +72,17 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host2.tap0.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
- guest1.vlan1.mtu = self.params.mtu
+ guest1.vlan0.mtu = self.params.mtu
guest2.eth0.mtu = self.params.mtu
- guest2.vlan1.mtu = self.params.mtu
+ guest2.vlan0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
- guest1.vlan1.ip_add(ipaddress(net_addr_1 + ".3/24"))
- guest1.vlan1.ip_add(ipaddress(net_addr6_1 + "::3/64"))
- guest2.vlan1.ip_add(ipaddress(net_addr_1 + ".4/24"))
- guest2.vlan1.ip_add(ipaddress(net_addr6_1 + "::4/64"))
+ guest1.vlan0.ip_add(ipaddress(net_addr_1 + ".3/24"))
+ guest1.vlan0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
+ guest2.vlan0.ip_add(ipaddress(net_addr_1 + ".4/24"))
+ guest2.vlan0.ip_add(ipaddress(net_addr6_1 + "::4/64"))
host1.eth1.up()
host1.tap0.up()
@@ -91,22 +91,22 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
host2.tap0.up()
host2.br0.up()
guest1.eth0.up()
- guest1.vlan1.up()
+ guest1.vlan0.up()
guest2.eth0.up()
- guest2.vlan1.up()
+ guest2.vlan0.up()
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth1, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth1.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth1.name)
return configuration
@@ -115,5 +115,5 @@ class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
index ff05dd5..84928d2 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
@@ -38,54 +38,54 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
host1.br0.port_add(host1.tap0)
host2.eth0.down()
- host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
guest1.eth0.down()
- guest1.vlan1 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
+ guest1.vlan0 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = guest1.vlan1
- configuration.endpoint2 = host2.vlan1
+ configuration.endpoint1 = guest1.vlan0
+ configuration.endpoint2 = host2.vlan0
if "mtu" in self.params:
host1.eth0.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host2.eth0.mtu = self.params.mtu
- host2.vlan1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
- guest1.vlan1.mtu = self.params.mtu
+ guest1.vlan0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
- host2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24"))
- host2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64"))
- guest1.vlan1.ip_add(ipaddress(net_addr_1 + ".3/24"))
- guest1.vlan1.ip_add(ipaddress(net_addr6_1 + "::3/64"))
+ host2.vlan0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.vlan0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ guest1.vlan0.ip_add(ipaddress(net_addr_1 + ".3/24"))
+ guest1.vlan0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
host1.eth0.up()
host1.tap0.up()
host1.br0.up()
host2.eth0.up()
- host2.vlan1.up()
+ host2.vlan0.up()
guest1.eth0.up()
- guest1.vlan1.up()
+ guest1.vlan0.up()
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, 0)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, 0)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -94,5 +94,5 @@ class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
index dd6a188..fcb5bf3 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
@@ -7,17 +7,16 @@ from lnst.Common.Parameters import Param
from lnst.Common.IpAddress import ipaddress
from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
-from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
host1 = HostReq()
- host1.eth1 = DeviceReq(label="to_switch")
+ host1.eth0 = DeviceReq(label="to_switch")
host1.tap0 = DeviceReq(label="to_guest1")
host2 = HostReq()
- host2.eth1 = DeviceReq(label="to_switch")
+ host2.eth0 = DeviceReq(label="to_switch")
host2.tap0 = DeviceReq(label="to_guest2")
guest1 = HostReq()
@@ -36,16 +35,16 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
def test_wide_configuration(self):
host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
- host1.eth1.down()
+ host1.eth0.down()
host1.tap0.down()
host1.br0 = OvsBridgeDevice()
- host1.br0.port_add(host1.eth1)
+ host1.br0.port_add(host1.eth0)
host1.br0.port_add(host1.tap0, tag="10")
- host2.eth1.down()
+ host2.eth0.down()
host2.tap0.down()
host2.br0 = OvsBridgeDevice()
- host2.br0.port_add(host2.eth1)
+ host2.br0.port_add(host2.eth0)
host2.br0.port_add(host2.tap0, tag="10")
guest1.eth0.down()
@@ -59,10 +58,10 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest2.eth0
if "mtu" in self.params:
- host1.eth1.mtu = self.params.mtu
+ host1.eth0.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
- host2.eth1.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
host2.tap0.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
@@ -76,10 +75,10 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
guest2.eth0.ip_add(ipaddress(net_addr_1 + ".4/24"))
guest2.eth0.ip_add(ipaddress(net_addr6_1 + "::4/64"))
- host1.eth1.up()
+ host1.eth0.up()
host1.tap0.up()
host1.br0.up()
- host2.eth1.up()
+ host2.eth0.up()
host2.tap0.up()
host2.br0.up()
guest1.eth0.up()
@@ -90,13 +89,13 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
raise LnstError("'perf_cpu_pin' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth1, self.params.dev_intr_cpu)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth1.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -105,5 +104,5 @@ class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
index 656d28a..8655a7a 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
@@ -38,14 +38,14 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1.br0.port_add(host1.tap0, tag="10")
host2.eth0.down()
- host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id="10")
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id="10")
guest1.eth0.down()
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = host2.vlan1
+ configuration.endpoint1 = host2.vlan0
configuration.endpoint2 = guest1.eth0
if "mtu" in self.params:
@@ -53,14 +53,14 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1.tap0.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
host2.eth0.mtu = self.params.mtu
- host2.vlan1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
guest1.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
- host2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24"))
- host2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64"))
+ host2.vlan0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ host2.vlan0.ip_add(ipaddress(net_addr6_1 + "::2/64"))
guest1.eth0.ip_add(ipaddress(net_addr_1 + ".3/24"))
guest1.eth0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
@@ -68,7 +68,7 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
host1.tap0.up()
host1.br0.up()
host2.eth0.up()
- host2.vlan1.up()
+ host2.vlan0.up()
guest1.eth0.up()
#TODO better service handling through HostAPI
@@ -76,13 +76,13 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
raise LnstError("'dev_intr_cpu' (%d) should not be set for this
test" % self.params.dev_intr_cpu)
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, 0)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, 0)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -91,5 +91,5 @@ class VirtualOvsBridgeVlanInHostRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "perf_tool_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
index d56e759..c359907 100644
--- a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
@@ -8,20 +8,19 @@ from lnst.Common.Parameters import Param, IntParam, StrParam
from lnst.Common.IpAddress import ipaddress
from lnst.Controller import HostReq, DeviceReq
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration
-from lnst.Devices import VlanDevice
from lnst.Devices import OvsBridgeDevice
from lnst.Common.LnstError import LnstError
class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
host1 = HostReq()
+ host1.eth0 = DeviceReq(label="to_switch")
host1.eth1 = DeviceReq(label="to_switch")
- host1.eth2 = DeviceReq(label="to_switch")
host1.tap0 = DeviceReq(label="to_guest1")
host1.tap1 = DeviceReq(label="to_guest2")
host2 = HostReq()
+ host2.eth0 = DeviceReq(label="to_switch")
host2.eth1 = DeviceReq(label="to_switch")
- host2.eth2 = DeviceReq(label="to_switch")
host2.tap0 = DeviceReq(label="to_guest3")
host2.tap1 = DeviceReq(label="to_guest4")
@@ -49,28 +48,28 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
def test_wide_configuration(self):
host1, host2, guest1, guest2, guest3, guest4 = self.matched.host1,
self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3,
self.matched.guest4
+ host1.eth0.down()
host1.eth1.down()
- host1.eth2.down()
host1.tap0.down()
host1.tap1.down()
host1.br0 = OvsBridgeDevice()
- for d, tag in [(host1.tap0, "10"), (host1.tap1, "20")]:
- host1.br0.port_add(d, tag=tag)
+ for dev, tag in [(host1.tap0, "10"), (host1.tap1, "20")]:
+ host1.br0.port_add(dev, tag=tag)
#miimon cannot be set due to colon in argument name -->
other_config:bond-miimon-interval
#https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/12/html/advanced_overcloud_customization/appe-bonding_options
- host1.br0.bond_add("bond_host1", (host1.eth1, host1.eth2),
bond_mode=self.params.bonding_mode)
+ host1.br0.bond_add("bond_host1", (host1.eth0, host1.eth1),
bond_mode=self.params.bonding_mode)
+ host2.eth0.down()
host2.eth1.down()
- host2.eth2.down()
host2.tap0.down()
host2.tap1.down()
host2.br0 = OvsBridgeDevice()
- for d, tag in [(host2.tap0, "10"), (host2.tap1, "20")]:
- host2.br0.port_add(d, tag=tag)
+ for dev, tag in [(host2.tap0, "10"), (host2.tap1, "20")]:
+ host2.br0.port_add(dev, tag=tag)
- host2.br0.bond_add("bond_host2", (host2.eth1, host2.eth2),
bond_mode=self.params.bonding_mode)
+ host2.br0.bond_add("bond_host2", (host2.eth0, host2.eth1),
bond_mode=self.params.bonding_mode)
guest1.eth0.down()
@@ -87,13 +86,13 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
configuration.endpoint2 = guest3.eth0
if "mtu" in self.params:
+ host1.eth0.mtu = self.params.mtu
host1.eth1.mtu = self.params.mtu
- host1.eth2.mtu = self.params.mtu
host1.tap0.mtu = self.params.mtu
host1.tap1.mtu = self.params.mtu
host1.br0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
host2.eth1.mtu = self.params.mtu
- host2.eth2.mtu = self.params.mtu
host2.tap0.mtu = self.params.mtu
host2.tap1.mtu = self.params.mtu
host2.br0.mtu = self.params.mtu
@@ -107,21 +106,21 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
net_addr_2 = "192.168.20"
net_addr6_2 = "fc00:0:0:2"
- for i, m in enumerate([guest1, guest3]):
- m.eth0.ip_add(ipaddress(net_addr_1 + "." + str (i+1) +
"/24"))
- m.eth0.ip_add(ipaddress(net_addr6_1 + "::" + str (i+1) +
"/64"))
+ for i, guest in enumerate([guest1, guest3]):
+ guest.eth0.ip_add(ipaddress(net_addr_1 + "." + str (i+1) +
"/24"))
+ guest.eth0.ip_add(ipaddress(net_addr6_1 + "::" + str (i+1) +
"/64"))
- for i, m in enumerate([guest2, guest4]):
- m.eth0.ip_add(ipaddress(net_addr_2 + "." + str (i+1) +
"/24"))
- m.eth0.ip_add(ipaddress(net_addr6_2 + "::" + str (i+1) +
"/64"))
+ for i, guest in enumerate([guest2, guest4]):
+ guest.eth0.ip_add(ipaddress(net_addr_2 + "." + str (i+1) +
"/24"))
+ guest.eth0.ip_add(ipaddress(net_addr6_2 + "::" + str (i+1) +
"/64"))
+ host1.eth0.up()
host1.eth1.up()
- host1.eth2.up()
host1.tap0.up()
host1.tap1.up()
host1.br0.up()
+ host2.eth0.up()
host2.eth1.up()
- host2.eth2.up()
host2.tap0.up()
host2.tap1.up()
host2.br0.up()
@@ -135,15 +134,15 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
raise LnstError("'perf_tool_cpu' (%d) should not be set for this
test" % self.params.perf_tool_cpu)
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance stop")
- for dev in [m.eth1, m.eth2]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host.eth0, host.eth1]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [host1, host2]:
- for dev in [m.eth1, m.eth2]:
- m.run("tc qdisc replace dev %s root mq" % dev.name)
+ for host in [host1, host2]:
+ for dev in [host.eth0, host.eth1]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
@@ -152,5 +151,5 @@ class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe):
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [host1, host2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 38eb328..e8bb99f 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -11,12 +11,12 @@ from lnst.Devices import VlanDevice
from lnst.Devices import BondDevice
class VlansOverBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="net1")
+ host1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="net1")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -28,77 +28,77 @@ class VlansOverBondRecipe(BaseEnrtRecipe):
miimon_value = IntParam(mandatory=True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.bond = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
- m1.eth0.down()
- m1.eth1.down()
- m1.bond.slave_add(m1.eth0)
- m1.bond.slave_add(m1.eth1)
- m1.vlan1 = VlanDevice(realdev=m1.bond, vlan_id=10)
- m1.vlan2 = VlanDevice(realdev=m1.bond, vlan_id=20)
+ host1.bond = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
+ host1.eth0.down()
+ host1.eth1.down()
+ host1.bond.slave_add(host1.eth0)
+ host1.bond.slave_add(host1.eth1)
+ host1.vlan0 = VlanDevice(realdev=host1.bond, vlan_id=10)
+ host1.vlan1 = VlanDevice(realdev=host1.bond, vlan_id=20)
- m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10)
- m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20)
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=20)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.vlan1
- configuration.endpoint2 = m2.vlan1
+ configuration.endpoint1 = host1.vlan0
+ configuration.endpoint2 = host2.vlan0
if "mtu" in self.params:
- m1.bond.mtu = self.params.mtu
- m2.eth0.mtu = self.params.mtu
- m1.vlan1.mtu = self.params.mtu
- m1.vlan2.mtu = self.params.mtu
- m2.vlan1.mtu = self.params.mtu
- m2.vlan2.mtu = self.params.mtu
+ host1.bond.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
+ host1.vlan0.mtu = self.params.mtu
+ host1.vlan1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
+ host2.vlan1.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
- for i, m in enumerate([m1, m2]):
- m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i+1) +
"/24"))
- m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i+1) +
"/64"))
- m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i+1) +
"/24"))
- m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i+1) +
"/64"))
-
- m1.eth0.up()
- m1.eth1.up()
- m1.bond.up()
- m1.vlan1.up()
- m1.vlan2.up()
- m2.eth0.up()
- m2.vlan1.up()
- m2.vlan2.up()
+ for i, host in enumerate([host1, host2]):
+ host.vlan0.ip_add(ipaddress(net_addr_1 + "." + str(i+1) +
"/24"))
+ host.vlan0.ip_add(ipaddress(net_addr6_1 + "::" + str(i+1) +
"/64"))
+ host.vlan1.ip_add(ipaddress(net_addr_2 + "." + str(i+1) +
"/24"))
+ host.vlan1.ip_add(ipaddress(net_addr6_2 + "::" + str(i+1) +
"/64"))
+
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.bond.up()
+ host1.vlan0.up()
+ host1.vlan1.up()
+ host2.eth0.up()
+ host2.vlan0.up()
+ host2.vlan1.up()
if "adaptive_rx_coalescing" in self.params:
- for dev in [m1.eth0, m1.eth1, m2.eth0]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for dev in [m1.eth0, m1.eth1, m2.eth0]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m1.eth0, m1.eth1, m2.eth0]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m, d in [(m1, m1.eth0), (m1, m1.eth1), (m2, m2.eth0)]:
- m.run("tc qdisc replace dev %s root mq" % d.name)
+ for host, dev in [(host1, host1.eth0), (host1, host1.eth1), (host2,
host2.eth0)]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m1.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
index 438fe20..e1ce6f9 100644
--- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
@@ -10,12 +10,12 @@ from lnst.Devices import VlanDevice
from lnst.Devices import TeamDevice
class VlansOverTeamRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth1 = DeviceReq(label="tnet")
- m1.eth2 = DeviceReq(label="tnet")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="tnet")
+ host1.eth1 = DeviceReq(label="tnet")
- m2 = HostReq()
- m2.eth1 = DeviceReq(label="tnet")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="tnet")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on"),
@@ -26,79 +26,79 @@ class VlansOverTeamRecipe(BaseEnrtRecipe):
runner_name = StrParam(mandatory = True)
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.eth1.down()
- m1.eth2.down()
+ host1.eth0.down()
+ host1.eth1.down()
#The config argument needs to be used with a team device normally (e.g to
specify
#the runner mode), but it is not used here due to a bug in the TeamDevice module
- m1.team = TeamDevice()
- m1.team.slave_add(m1.eth1)
- m1.team.slave_add(m1.eth2)
- m1.vlan1 = VlanDevice(realdev=m1.team, vlan_id=10)
- m1.vlan2 = VlanDevice(realdev=m1.team, vlan_id=20)
+ host1.team0 = TeamDevice()
+ host1.team0.slave_add(host1.eth0)
+ host1.team0.slave_add(host1.eth1)
+ host1.vlan0 = VlanDevice(realdev=host1.team0, vlan_id=10)
+ host1.vlan1 = VlanDevice(realdev=host1.team0, vlan_id=20)
- m2.vlan1 = VlanDevice(realdev=m2.eth1, vlan_id=10)
- m2.vlan2 = VlanDevice(realdev=m2.eth1, vlan_id=20)
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=20)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.vlan1
- configuration.endpoint2 = m2.vlan1
+ configuration.endpoint1 = host1.vlan0
+ configuration.endpoint2 = host2.vlan0
if "mtu" in self.params:
- for m in (m1, m2):
- m.vlan1.mtu = self.params.mtu
- m.vlan2.mtu = self.params.mtu
- m1.team.mtu = self.params.mtu
- m2.eth1.mtu = self.params.mtu
+ for host in (host1, host2):
+ host.vlan0.mtu = self.params.mtu
+ host.vlan1.mtu = self.params.mtu
+ host1.team0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
- m1.team.ip_add(ipaddress("1.2.3.4/24"))
- for i, m in enumerate([m1, m2]):
- m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i+1) +
"/24"))
- m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i+1) +
"/64"))
- m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i+1) +
"/24"))
- m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i+1) +
"/64"))
-
- m1.eth1.up()
- m1.eth2.up()
- m1.team.up()
- m1.vlan1.up()
- m1.vlan2.up()
- m2.eth1.up()
- m2.vlan1.up()
- m2.vlan2.up()
+ host1.team0.ip_add(ipaddress("1.2.3.4/24"))
+ for i, host in enumerate([host1, host2]):
+ host.vlan0.ip_add(ipaddress(net_addr_1 + "." + str(i+1) +
"/24"))
+ host.vlan0.ip_add(ipaddress(net_addr6_1 + "::" + str(i+1) +
"/64"))
+ host.vlan1.ip_add(ipaddress(net_addr_2 + "." + str(i+1) +
"/24"))
+ host.vlan1.ip_add(ipaddress(net_addr6_2 + "::" + str(i+1) +
"/64"))
+
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.team0.up()
+ host1.vlan0.up()
+ host1.vlan1.up()
+ host2.eth0.up()
+ host2.vlan0.up()
+ host2.vlan1.up()
if "adaptive_rx_coalescing" in self.params:
- for dev in [m1.eth1, m1.eth2, m2.eth1]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for dev in [m1.eth1, m1.eth2, m2.eth1]:
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
dev.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- for dev in [m1.eth1, m1.eth2, m2.eth1]:
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ for dev in [host1.eth0, host1.eth1, host2.eth0]:
self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m, d in [(m1, m1.eth1), (m1, m1.eth2), (m2, m2.eth1)]:
- m.run("tc qdisc replace dev %s root mq" % d.name)
+ for host, dev in [(host1, host1.eth0), (host1, host1.eth1), (host2,
host2.eth0)]:
+ host.run("tc qdisc replace dev %s root mq" % dev.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index fa11015..f025dba 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -9,11 +9,11 @@ from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe,
EnrtConfiguration
from lnst.Devices import VlanDevice
class VlansRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="net1")
offload_combinations = Param(default=(
dict(gro="on", gso="on", tso="on",
tx="on", rx="on"),
@@ -23,71 +23,71 @@ class VlansRecipe(BaseEnrtRecipe):
dict(gro="on", gso="on", tso="on",
tx="on", rx="off")))
def test_wide_configuration(self):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
- m1.eth0.down()
- m1.vlan1 = VlanDevice(realdev=m1.eth0, vlan_id=10)
- m1.vlan2 = VlanDevice(realdev=m1.eth0, vlan_id=20)
+ host1.eth0.down()
+ host1.vlan0 = VlanDevice(realdev=host1.eth0, vlan_id=10)
+ host1.vlan1 = VlanDevice(realdev=host1.eth0, vlan_id=20)
- m2.eth0.down()
- m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10)
- m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20)
+ host2.eth0.down()
+ host2.vlan0 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=20)
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
- configuration.endpoint1 = m1.vlan1
- configuration.endpoint2 = m2.vlan1
+ configuration.endpoint1 = host1.vlan0
+ configuration.endpoint2 = host2.vlan0
if "mtu" in self.params:
- m1.eth0.mtu = self.params.mtu
- m2.eth0.mtu = self.params.mtu
- m1.vlan1.mtu = self.params.mtu
- m1.vlan2.mtu = self.params.mtu
- m2.vlan1.mtu = self.params.mtu
- m2.vlan2.mtu = self.params.mtu
+ host1.eth0.mtu = self.params.mtu
+ host2.eth0.mtu = self.params.mtu
+ host1.vlan0.mtu = self.params.mtu
+ host1.vlan1.mtu = self.params.mtu
+ host2.vlan0.mtu = self.params.mtu
+ host2.vlan1.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
- for i, m in enumerate([m1, m2]):
- m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i+1) +
"/24"))
- m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i+1) +
"/64"))
- m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i+1) +
"/24"))
- m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i+1) +
"/64"))
+ for i, host in enumerate([host1, host2]):
+ host.vlan0.ip_add(ipaddress(net_addr_1 + "." + str(i+1) +
"/24"))
+ host.vlan0.ip_add(ipaddress(net_addr6_1 + "::" + str(i+1) +
"/64"))
+ host.vlan1.ip_add(ipaddress(net_addr_2 + "." + str(i+1) +
"/24"))
+ host.vlan1.ip_add(ipaddress(net_addr6_2 + "::" + str(i+1) +
"/64"))
- m1.eth0.up()
- m1.vlan1.up()
- m1.vlan2.up()
- m2.eth0.up()
- m2.vlan1.up()
- m2.vlan2.up()
+ host1.eth0.up()
+ host1.vlan0.up()
+ host1.vlan1.up()
+ host2.eth0.up()
+ host2.vlan0.up()
+ host2.vlan1.up()
if "adaptive_rx_coalescing" in self.params:
- for m in [m1, m2]:
- m.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
+ for host in [host1, host2]:
+ host.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
if "adaptive_tx_coalescing" in self.params:
- for m in [m1, m2]:
- m.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
+ for host in [host1, host2]:
+ host.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance stop")
- self._pin_dev_interrupts(m.eth0, self.params.dev_intr_cpu)
+ for host in [host1, host2]:
+ host.run("service irqbalance stop")
+ self._pin_dev_interrupts(host.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
- for m in [m1, m2]:
- m.run("tc qdisc replace dev %s root mq" % m.eth0.name)
+ for host in [host1, host2]:
+ host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
def test_wide_deconfiguration(self, config):
- m1, m2 = self.matched.m1, self.matched.m2
+ host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
- for m in [m1, m2]:
- m.run("service irqbalance start")
+ for host in [host1, host2]:
+ host.run("service irqbalance start")
--
2.17.1