From: Christos Sfakianakis <csfakian(a)redhat.com>
Add ported recipe VirtualBridgeVlanIn{Host,Guest}{,Mirrored}Recipe,
implementing old regression_tests/phase1/virtual_bridge_vlan_in_{
host,guest}_{,mirrored}.xml. Its structure is based on previously
ported SimplePerfRecipe. Due to limitations in the current
EnrtConfiguration class, a single vlan test pair is chosen.
v2: Use easier-to-follow names for the hosts and interfaces.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 107 ++++++++++++++++++
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 90 +++++++++++++++
.../VirtualBridgeVlanInHostMirroredRecipe.py | 105 +++++++++++++++++
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 88 ++++++++++++++
4 files changed, 390 insertions(+)
create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
new file mode 100644
index 0000000..d349d5b
--- /dev/null
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
@@ -0,0 +1,107 @@
+"""
+Implements scenario similar to regression_tests/phase1/
+(virtual_bridge_vlan_in_guest_mirrored.xml + virtual_bridge_vlan_in_guest_mirrored.py)
+"""
+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 BridgeDevice
+
+class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe):
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="to_switch")
+ host1.eth1 = DeviceReq(label="to_guest1")
+
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="to_switch")
+ host2.eth1 = DeviceReq(label="to_guest2")
+
+ guest1 = HostReq()
+ guest1.eth0 = DeviceReq(label="to_guest1")
+
+ guest2 = HostReq()
+ guest2.eth0 = DeviceReq(label="to_guest2")
+
+ offload_combinations = Param(default=(
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="off", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="on", gso="off", tso="off",
tx="on", rx="on"),
+ dict(gro="on", gso="on", tso="off",
tx="off", rx="on"),
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="off")))
+
+ def test_wide_configuration(self):
+ host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
+
+ host1.eth0.down()
+ host1.eth1.down()
+ host1.br0 = BridgeDevice()
+ host1.br0.slave_add(host1.eth0)
+ host1.br0.slave_add(host1.eth1)
+
+ host2.eth0.down()
+ host2.eth1.down()
+ host2.br0 = BridgeDevice()
+ host2.br0.slave_add(host2.eth0)
+ host2.br0.slave_add(host2.eth1)
+
+ guest1.eth0.down()
+ guest1.vlan1 = VlanDevice(realdev=guest1.eth0, vlan_id=10)
+
+ guest2.eth0.down()
+ guest2.vlan1 = 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
+
+ if "mtu" in self.params:
+ host1.br0.mtu = self.params.mtu
+ host2.br0.mtu = self.params.mtu
+ guest1.vlan1.mtu = self.params.mtu
+ guest2.vlan1.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"))
+
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.br0.up()
+ host2.eth0.up()
+ host2.eth1.up()
+ host2.br0.up()
+ guest1.eth0.up()
+ guest1.vlan1.up()
+ guest2.eth0.up()
+ guest2.vlan1.up()
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance stop")
+ host2.run("service irqbalance stop")
+ guest1.run("service irqbalance stop")
+ guest2.run("service irqbalance stop")
+
+ for m in self.matched:
+ for dev in m.devices:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+
+ return configuration
+
+ def test_wide_deconfiguration(self, config):
+ host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance start")
+ host2.run("service irqbalance start")
+ guest1.run("service irqbalance start")
+ guest2.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
new file mode 100644
index 0000000..4a90a1b
--- /dev/null
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
@@ -0,0 +1,90 @@
+"""
+Implements scenario similar to regression_tests/phase1/
+(virtual_bridge_vlan_in_guest.xml + virtual_bridge_vlan_in_guest.py)
+"""
+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 BridgeDevice
+
+class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe):
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="to_switch")
+ host1.eth1 = DeviceReq(label="to_guest")
+
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="to_switch")
+
+ guest1 = HostReq()
+ guest1.eth0 = DeviceReq(label="to_guest")
+
+ offload_combinations = Param(default=(
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="off", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="on", gso="off", tso="off",
tx="on", rx="on"),
+ dict(gro="on", gso="on", tso="off",
tx="off", rx="on"),
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="off")))
+
+ def test_wide_configuration(self):
+ host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
+
+ host1.eth0.down()
+ host1.eth1.down()
+ host1.br0 = BridgeDevice()
+ host1.br0.slave_add(host1.eth0)
+ host1.br0.slave_add(host1.eth1)
+
+ host2.eth0.down()
+ host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+
+ guest1.eth0.down()
+ guest1.vlan1 = 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
+
+ if "mtu" in self.params:
+ host1.br0.mtu = self.params.mtu
+ host2.vlan1.mtu = self.params.mtu
+ guest1.vlan1.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"))
+
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.br0.up()
+ host2.eth0.up()
+ host2.vlan1.up()
+ guest1.eth0.up()
+ guest1.vlan1.up()
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance stop")
+ host2.run("service irqbalance stop")
+ guest1.run("service irqbalance stop")
+
+ for m in self.matched:
+ for dev in m.devices:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+
+ return configuration
+
+ def test_wide_deconfiguration(self, config):
+ host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance start")
+ host2.run("service irqbalance start")
+ guest1.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
new file mode 100644
index 0000000..e85b54c
--- /dev/null
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
@@ -0,0 +1,105 @@
+"""
+Implements scenario similar to regression_tests/phase1/
+(virtual_bridge_vlan_in_host_mirrored.xml + virtual_bridge_vlan_in_host_mirrored.py)
+"""
+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 BridgeDevice
+
+class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe):
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="to_switch")
+ host1.eth1 = DeviceReq(label="to_guest1")
+
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="to_switch")
+ host2.eth1 = DeviceReq(label="to_guest2")
+
+ guest1 = HostReq()
+ guest1.eth0 = DeviceReq(label="to_guest1")
+
+ guest2 = HostReq()
+ guest2.eth0 = DeviceReq(label="to_guest2")
+
+ offload_combinations = Param(default=(
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="off", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="on", gso="off", tso="off",
tx="on", rx="on"),
+ dict(gro="on", gso="on", tso="off",
tx="off", rx="on"),
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="off")))
+
+ def test_wide_configuration(self):
+ host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
+
+ host1.eth0.down()
+ host1.eth1.down()
+ host1.vlan1 = VlanDevice(realdev=host1.eth0, vlan_id=10)
+ host1.br0 = BridgeDevice()
+ host1.br0.slave_add(host1.vlan1)
+ host1.br0.slave_add(host1.eth1)
+
+ host2.eth0.down()
+ host2.eth1.down()
+ host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+ host2.br0 = BridgeDevice()
+ host2.br0.slave_add(host2.vlan1)
+ host2.br0.slave_add(host2.eth1)
+
+ guest1.eth0.down()
+
+ guest2.eth0.down()
+
+ configuration = EnrtConfiguration()
+ configuration.endpoint1 = guest1.eth0
+ configuration.endpoint2 = guest2.eth0
+
+ if "mtu" in self.params:
+ host1.br0.mtu = self.params.mtu
+ host2.br0.mtu = self.params.mtu
+ guest1.eth0.mtu = self.params.mtu
+ guest2.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.br0.ip_add(ipaddress(net_addr_1 + ".2/24"))
+ guest1.eth0.ip_add(ipaddress(net_addr_1 + ".3/24"))
+ guest1.eth0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
+ guest2.eth0.ip_add(ipaddress(net_addr_1 + ".4/24"))
+ guest2.eth0.ip_add(ipaddress(net_addr6_1 + "::4/64"))
+
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.vlan1.up()
+ host1.br0.up()
+ host2.eth0.up()
+ host2.eth1.up()
+ host2.vlan1.up()
+ host2.br0.up()
+ guest1.eth0.up()
+ guest2.eth0.up()
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance stop")
+ host2.run("service irqbalance stop")
+ guest1.run("service irqbalance stop")
+ guest2.run("service irqbalance stop")
+
+ for m in self.matched:
+ for dev in m.devices:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+
+ return configuration
+
+ def test_wide_deconfiguration(self, config):
+ host1, host2, guest1, guest2 = self.matched.host1, self.matched.host2,
self.matched.guest1, self.matched.guest2
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance start")
+ host2.run("service irqbalance start")
+ guest1.run("service irqbalance start")
+ guest2.run("service irqbalance start")
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
new file mode 100644
index 0000000..1382b2b
--- /dev/null
+++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
@@ -0,0 +1,88 @@
+"""
+Implements scenario similar to regression_tests/phase1/
+(virtual_bridge_vlan_in_host.xml + virtual_bridge_vlan_in_host.py)
+"""
+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 BridgeDevice
+
+class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
+ host1 = HostReq()
+ host1.eth0 = DeviceReq(label="to_switch")
+ host1.eth1 = DeviceReq(label="to_guest")
+
+ host2 = HostReq()
+ host2.eth0 = DeviceReq(label="to_switch")
+
+ guest1 = HostReq()
+ guest1.eth0 = DeviceReq(label="to_guest")
+
+ offload_combinations = Param(default=(
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="off", gso="on", tso="on",
tx="on", rx="on"),
+ dict(gro="on", gso="off", tso="off",
tx="on", rx="on"),
+ dict(gro="on", gso="on", tso="off",
tx="off", rx="on"),
+ dict(gro="on", gso="on", tso="on",
tx="on", rx="off")))
+
+ def test_wide_configuration(self):
+ host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
+
+ host1.eth0.down()
+ host1.eth1.down()
+ host1.vlan1 = VlanDevice(realdev=host1.eth0, vlan_id=10)
+ host1.br0 = BridgeDevice()
+ host1.br0.slave_add(host1.vlan1)
+ host1.br0.slave_add(host1.eth1)
+
+ host2.eth0.down()
+ host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10)
+
+ guest1.eth0.down()
+
+ configuration = EnrtConfiguration()
+ configuration.endpoint1 = guest1.eth0
+ configuration.endpoint2 = host2.vlan1
+
+ if "mtu" in self.params:
+ host1.br0.mtu = self.params.mtu
+ host2.vlan1.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"))
+ guest1.eth0.ip_add(ipaddress(net_addr_1 + ".3/24"))
+ guest1.eth0.ip_add(ipaddress(net_addr6_1 + "::3/64"))
+
+ host1.eth0.up()
+ host1.eth1.up()
+ host1.vlan1.up()
+ host1.br0.up()
+ host2.eth0.up()
+ host2.vlan1.up()
+ guest1.eth0.up()
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance stop")
+ host2.run("service irqbalance stop")
+ guest1.run("service irqbalance stop")
+
+ for m in self.matched:
+ for dev in m.devices:
+ self._pin_dev_interrupts(dev, self.params.dev_intr_cpu)
+
+ return configuration
+
+ def test_wide_deconfiguration(self, config):
+ host1, host2, guest1 = self.matched.host1, self.matched.host2,
self.matched.guest1
+
+ #TODO better service handling through HostAPI
+ host1.run("service irqbalance start")
+ host2.run("service irqbalance start")
+ guest1.run("service irqbalance start")
--
2.17.1