From: Christos Sfakianakis csfakian@redhat.com
Patch for ported phase2 xml recipes.
Christos Sfakianakis (10): lnst.Recipes.ENRT: add TeamRecipe lnst.Recipes.ENRT: add DoubleTeamRecipe lnst.Recipes.ENRT: add TeamVsBondRecipe lnst.Recipes.ENRT: add VlansOverTeamRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInGuestRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInHostRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInGuestMirroredRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInHostMirroredRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlansOverBondRecipe lnst.Devices: edit OvsBridgeDevice
lnst/Devices/OvsBridgeDevice.py | 4 +- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 83 ++++++++++ lnst/Recipes/ENRT/TeamRecipe.py | 74 +++++++++ lnst/Recipes/ENRT/TeamVsBondRecipe.py | 87 +++++++++++ ...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 110 +++++++++++++ .../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 89 +++++++++++ ...irtualOvsBridgeVlanInHostMirroredRecipe.py | 102 ++++++++++++ .../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 87 +++++++++++ .../VirtualOvsBridgeVlansOverBondRecipe.py | 147 ++++++++++++++++++ lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 91 +++++++++++ 10 files changed, 872 insertions(+), 2 deletions(-) create mode 100644 lnst/Recipes/ENRT/DoubleTeamRecipe.py create mode 100644 lnst/Recipes/ENRT/TeamRecipe.py create mode 100644 lnst/Recipes/ENRT/TeamVsBondRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py create mode 100644 lnst/Recipes/ENRT/VlansOverTeamRecipe.py
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe TeamRecipe, implementing old regression_tests/ phase2/{active_backup,round_robin}_team.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/TeamRecipe.py | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 lnst/Recipes/ENRT/TeamRecipe.py
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py new file mode 100644 index 0000000..6173ec6 --- /dev/null +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -0,0 +1,74 @@ +""" +Implements scenario similar to regression_tests/phase2/ +({active_backup,round_robin}_team.xml + team_test.py) +""" +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 TeamDevice + +class TeamRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth1 = DeviceReq(label="tnet") + m1.eth2 = DeviceReq(label="tnet") + + m2 = HostReq() + m2.eth1 = DeviceReq(label="tnet") + + offload_combinations = Param(default=( + dict(gro="on", gso="on", tso="on", tx="on"), + dict(gro="off", gso="on", tso="on", tx="on"), + dict(gro="on", gso="off", tso="off", tx="on"), + dict(gro="on", gso="on", tso="off", tx="off"))) + + runner_name = StrParam(mandatory=True) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.eth1.down() + m1.eth2.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) + + #EnrtConfiguration and both-side Netperf config need to be checked + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.team + configuration.endpoint2 = m2.eth1 + + if "mtu" in self.params: + m1.team.mtu = self.params.mtu + m2.eth1.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")) + + m1.eth1.up() + m1.eth2.up() + m1.team.up() + m2.eth1.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.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): + m1, m2 = self.matched.m1, self.matched.m2 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe DoubleTeamRecipe,implementing old regression_tests/ phase2/{active_backup,round_robin}_double_team.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 83 +++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 lnst/Recipes/ENRT/DoubleTeamRecipe.py
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py new file mode 100644 index 0000000..d2a233f --- /dev/null +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -0,0 +1,83 @@ +""" +Implements scenario similar to regression_tests/phase2/ +({active_backup,round_robin}_double_team.xml + team_test.py) +""" +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 TeamDevice + +class DoubleTeamRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth1 = DeviceReq(label="tnet") + m1.eth2 = DeviceReq(label="tnet") + + m2 = HostReq() + m2.eth1 = DeviceReq(label="tnet") + m2.eth2 = DeviceReq(label="tnet") + + offload_combinations = Param(default=( + dict(gro="on", gso="on", tso="on", tx="on"), + dict(gro="off", gso="on", tso="on", tx="on"), + dict(gro="on", gso="off", tso="off", tx="on"), + dict(gro="on", gso="on", tso="off", tx="off"))) + + runner_name = StrParam(mandatory=True) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.eth1.down() + m1.eth2.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) + + m2.eth1.down() + m2.eth2.down() + m2.team = TeamDevice() + m2.team.slave_add(m2.eth1) + m2.team.slave_add(m2.eth2) + + #EnrtConfiguration and both-side Netperf config need to be checked + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.team + configuration.endpoint2 = m2.team + + if "mtu" in self.params: + m1.team.mtu = self.params.mtu + m2.team.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")) + + m1.eth1.up() + m1.eth2.up() + m1.team.up() + m2.eth1.up() + m2.eth2.up() + m2.team.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.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): + m1, m2 = self.matched.m1, self.matched.m2 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe TeamVsBondRecipe,implementing old regression_tests/ phase2/{active_backup,round_robin}_team_vs_{active_backup,round_robin} _bond.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 87 +++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 lnst/Recipes/ENRT/TeamVsBondRecipe.py
diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py new file mode 100644 index 0000000..597579b --- /dev/null +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -0,0 +1,87 @@ +""" +Implements scenario similar to regression_tests/phase2/ +({active_backup,round_robin}_team_vs_{active_backup,round_robin} +_bond.xml + team_test.py) +""" +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 TeamDevice +from lnst.Devices import BondDevice + +class TeamVsBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth1 = DeviceReq(label="tnet") + m1.eth2 = DeviceReq(label="tnet") + + m2 = HostReq() + m2.eth1 = DeviceReq(label="tnet") + m2.eth2 = DeviceReq(label="tnet") + + offload_combinations = Param(default=( + dict(gro="on", gso="on", tso="on", tx="on"), + dict(gro="off", gso="on", tso="on", tx="on"), + dict(gro="on", gso="off", tso="off", tx="on"), + dict(gro="on", gso="on", tso="off", tx="off"))) + + runner_name = StrParam(mandatory = True) + bonding_mode = StrParam(mandatory = True) + miimon_value = IntParam(mandatory = True) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.eth1.down() + m1.eth2.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) + + 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) + + #EnrtConfiguration and both-side Netperf config need to be checked + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.team + configuration.endpoint2 = m2.bond + + if "mtu" in self.params: + m1.team.mtu = self.params.mtu + m2.team.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")) + + m1.eth1.up() + m1.eth2.up() + m1.team.up() + m2.eth1.up() + m2.eth2.up() + m2.bond.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.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): + m1, m2 = self.matched.m1, self.matched.m2 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VlansOverTeamRecipe,implementing old regression_tests/phase2/3_vlans_over_{active_backup,round_robin} _team.xml. Base it on previously ported SimplePerfRecipe. Use 2 vlans insted of 3.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 91 ++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 lnst/Recipes/ENRT/VlansOverTeamRecipe.py
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py new file mode 100644 index 0000000..2e929b8 --- /dev/null +++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py @@ -0,0 +1,91 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(3_vlans_over_{active_backup,round_robin}_team.xml + 3_vlans_over_team.py) +""" +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 TeamDevice + +class VlansOverTeamRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth1 = DeviceReq(label="tnet") + m1.eth2 = DeviceReq(label="tnet") + + m2 = HostReq() + m2.eth1 = DeviceReq(label="tnet") + + offload_combinations = Param(default=( + dict(gro="on", gso="on", tso="on", tx="on"), + dict(gro="off", gso="on", tso="on", tx="on"), + dict(gro="on", gso="off", tso="off", tx="on"), + dict(gro="on", gso="on", tso="off", tx="off"))) + + runner_name = StrParam(mandatory = True) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.eth1.down() + m1.eth2.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) + + m2.vlan1 = VlanDevice(realdev=m2.eth1, vlan_id=10) + m2.vlan2 = VlanDevice(realdev=m2.eth1, 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 + + 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 + + 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() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.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): + m1, m2 = self.matched.m1, self.matched.m2 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlanInGuestRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml. Base it on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py new file mode 100644 index 0000000..14f5331 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -0,0 +1,89 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_vlan_in_guest.xml + virtual_ovs_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 OvsBridgeDevice + +class VirtualOvsBridgeVlanInGuestRecipe(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 = OvsBridgeDevice() + host1.br0.port_add(host1.eth0) + host1.br0.port_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" + + 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")
Mon, Sep 24, 2018 at 07:27:54PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlanInGuestRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml. Base it on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py new file mode 100644 index 0000000..14f5331 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -0,0 +1,89 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_vlan_in_guest.xml + virtual_ovs_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 OvsBridgeDevice
+class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
- host1 = HostReq()
- host1.eth0 = DeviceReq(label="to_switch")
- host1.eth1 = DeviceReq(label="to_guest")
All devices that have "to_guest" label are actually tap devices. Could we rename these to tap[0-9] instead of eth[0-9]? It was a bit confusing for me.
This applies to all virt* recipes in the patchset. And also to migrated phase1 recipes.
What do you think?
- 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.guest1host1.eth0.down()host1.eth1.down()host1.br0 = OvsBridgeDevice()host1.br0.port_add(host1.eth0)host1.br0.port_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 chosenconfiguration = EnrtConfiguration()configuration.endpoint1 = guest1.vlan1configuration.endpoint2 = host2.vlan1if "mtu" in self.params:host1.br0.mtu = self.params.mtuhost2.vlan1.mtu = self.params.mtuguest1.vlan1.mtu = self.params.mtunet_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"))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 HostAPIhost1.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 HostAPIhost1.run("service irqbalance start")host2.run("service irqbalance start")guest1.run("service irqbalance start")-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Monday, October 1, 2018 9:14:08 AM Subject: Re: [PATCH-next 05/10] lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInGuestRecipe
Mon, Sep 24, 2018 at 07:27:54PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlanInGuestRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml. Base it on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py new file mode 100644 index 0000000..14f5331 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -0,0 +1,89 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_vlan_in_guest.xml + virtual_ovs_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 OvsBridgeDevice
+class VirtualOvsBridgeVlanInGuestRecipe(BaseEnrtRecipe):
- host1 = HostReq()
- host1.eth0 = DeviceReq(label="to_switch")
- host1.eth1 = DeviceReq(label="to_guest")
All devices that have "to_guest" label are actually tap devices. Could we rename these to tap[0-9] instead of eth[0-9]? It was a bit confusing for me.
This applies to all virt* recipes in the patchset. And also to migrated phase1 recipes.
What do you think?
Hi Jan, I can rename these as you suggested, thanks.
- 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 = OvsBridgeDevice()host1.br0.port_add(host1.eth0)host1.br0.port_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 chosenconfiguration = EnrtConfiguration()configuration.endpoint1 = guest1.vlan1configuration.endpoint2 = host2.vlan1if "mtu" in self.params:host1.br0.mtu = self.params.mtuhost2.vlan1.mtu = self.params.mtuguest1.vlan1.mtu = self.params.mtunet_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"))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 HostAPIhost1.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 HostAPIhost1.run("service irqbalance start")host2.run("service irqbalance start")guest1.run("service irqbalance start")-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlanInHostRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml. Base it on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py new file mode 100644 index 0000000..9e6b973 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py @@ -0,0 +1,87 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_vlan_in_host.xml + virtual_ovs_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 OvsBridgeDevice + +class VirtualOvsBridgeVlanInHostRecipe(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 = OvsBridgeDevice() + host1.br0.port_add(host1.eth0) + host1.br0.port_add(host1.eth1, tag="10") + + host2.eth0.down() + host2.vlan1 = 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.endpoint2 = guest1.eth0 + + 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" + + 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.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")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlanInGuestMirroredRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_vlan _in_guest_mirrored.xml. Base it on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- ...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py new file mode 100644 index 0000000..aa4bf13 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py @@ -0,0 +1,110 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_vlan_in_guest_mirrored.xml + virtual_ovs_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 OvsBridgeDevice + +class VirtualOvsBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): + host1 = HostReq() + host1.eth1 = DeviceReq(label="to_switch") + host1.eth2 = DeviceReq(label="to_guest1") + + host2 = HostReq() + host2.eth1 = DeviceReq(label="to_switch") + host2.eth2 = 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.eth1.down() + host1.eth2.down() + host1.br0 = OvsBridgeDevice() + for m, d in [(host1, host1.eth1), (host1, host1.eth2)]: + m.br0.port_add(d) + + host2.eth1.down() + host2.eth2.down() + host2.br0 = OvsBridgeDevice() + for m, d in [(host2, host2.eth1), (host2, host2.eth2)]: + if d.master != None: + if "ovs" not in d.master.name: + m.br0.port_add(d) + else: + m.br0.port_add(d) + + 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" + + 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.eth1.up() + host1.eth2.up() + host1.br0.up() + host2.eth1.up() + host2.eth2.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")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlanInHostMirroredRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_vlan _in_host_mirrored.xml. Base it on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- ...irtualOvsBridgeVlanInHostMirroredRecipe.py | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py new file mode 100644 index 0000000..931fb27 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py @@ -0,0 +1,102 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_vlan_in_host_mirrored.xml + virtual_ovs_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 OvsBridgeDevice + +class VirtualOvsBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): + host1 = HostReq() + host1.eth1 = DeviceReq(label="to_switch") + host1.eth2 = DeviceReq(label="to_guest1") + + host2 = HostReq() + host2.eth1 = DeviceReq(label="to_switch") + host2.eth2 = 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.eth1.down() + host1.eth2.down() + host1.br0 = OvsBridgeDevice() + host1.br0.port_add(host1.eth1) + host1.br0.port_add(host1.eth2, tag="10") + + host2.eth1.down() + host2.eth2.down() + host2.br0 = OvsBridgeDevice() + host2.br0.port_add(host2.eth1) + host2.br0.port_add(host2.eth2, tag="10") + + guest1.eth0.down() + + guest2.eth0.down() + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + 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" + + 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.eth1.up() + host1.eth2.up() + host1.br0.up() + host2.eth1.up() + host2.eth2.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")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualOvsBridgeVlansOverBondRecipe, implementing old regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_ backup_bond.xml. Base it on previously ported SimplePerfRecipe. Add bond mode as parameter.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../VirtualOvsBridgeVlansOverBondRecipe.py | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py new file mode 100644 index 0000000..3234ffd --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py @@ -0,0 +1,147 @@ +""" +Implements scenario similar to regression_tests/phase2/ +(virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml + +virtual_ovs_bridge_2_vlans_over_active_backup_bond.py +) +""" +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 + +class VirtualOvsBridgeVlansOverBondRecipe(BaseEnrtRecipe): + host1 = HostReq() + host1.eth1 = DeviceReq(label="to_switch") + host1.eth2 = DeviceReq(label="to_switch") + host1.eth3 = DeviceReq(label="to_guest1") + host1.eth4 = DeviceReq(label="to_guest2") + + host2 = HostReq() + host2.eth1 = DeviceReq(label="to_switch") + host2.eth2 = DeviceReq(label="to_switch") + host2.eth3 = DeviceReq(label="to_guest3") + host2.eth4 = DeviceReq(label="to_guest4") + + guest1 = HostReq() + guest1.eth0 = DeviceReq(label="to_guest1") + + guest2 = HostReq() + guest2.eth0 = DeviceReq(label="to_guest2") + + guest3 = HostReq() + guest3.eth0 = DeviceReq(label="to_guest3") + + guest4 = HostReq() + guest4.eth0 = DeviceReq(label="to_guest4") + + offload_combinations = Param(default=( + dict(gro="on", gso="on", tso="on", tx="on"), + dict(gro="off", gso="on", tso="on", tx="on"), + dict(gro="on", gso="off", tso="off", tx="on"), + dict(gro="on", gso="on", tso="off", tx="off"))) + + bonding_mode = StrParam(mandatory = True) + miimon_value = IntParam(mandatory = True) + + 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.eth1.down() + host1.eth2.down() + host1.eth3.down() + host1.eth4.down() + host1.br0 = OvsBridgeDevice() + for d, tag in [(host1.eth3, "10"), (host1.eth4, "20")]: + host1.br0.port_add(d, 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/... + host1.br0.bond_add("bond_host1", (host1.eth1, host1.eth2), bond_mode=self.params.bonding_mode) + + host2.eth1.down() + host2.eth2.down() + host2.eth3.down() + host2.eth4.down() + host2.br0 = OvsBridgeDevice() + + for d, tag in [(host2.eth3, "10"), (host2.eth4, "20")]: + host2.br0.port_add(d, tag=tag) + + host2.br0.bond_add("bond_host2", (host2.eth1, host2.eth2), bond_mode=self.params.bonding_mode) + + guest1.eth0.down() + + guest2.eth0.down() + + guest3.eth0.down() + + guest4.eth0.down() + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + configuration = EnrtConfiguration() + configuration.endpoint1 = guest1.eth0 + configuration.endpoint2 = guest3.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 + guest3.eth0.mtu = self.params.mtu + guest4.eth0.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr6_1 = "fc00:0:0:1" + 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, 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")) + + host1.eth1.up() + host1.eth2.up() + host1.eth3.up() + host1.eth4.up() + host1.br0.up() + host2.eth1.up() + host2.eth2.up() + host2.eth3.up() + host2.eth4.up() + host2.br0.up() + guest1.eth0.up() + guest2.eth0.up() + guest3.eth0.up() + guest4.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") + guest3.run("service irqbalance stop") + guest4.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, guest3, guest4 = self.matched.host1, self.matched.host2, self.matched.guest1, self.matched.guest2, self.matched.guest3, self.matched.guest4 + + #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") + guest3.run("service irqbalance start") + guest4.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Avoid termination in case cls._type_initialized or cls._moduleparams are undefined.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Devices/OvsBridgeDevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Devices/OvsBridgeDevice.py b/lnst/Devices/OvsBridgeDevice.py index d54cf94..57527d2 100644 --- a/lnst/Devices/OvsBridgeDevice.py +++ b/lnst/Devices/OvsBridgeDevice.py @@ -25,8 +25,8 @@ class OvsBridgeDevice(SoftDevice):
@classmethod def _type_init(cls): - if not cls._type_initialized: - exec_cmd("modprobe %s %s" % ("openvswitch", cls._moduleparams)) + if not "_type_initialized" in dir(cls): + exec_cmd("modprobe %s %s" % ("openvswitch", getattr(cls, "_moduleparams", "")))
if not check_process_running("ovsdb-server"): exec_cmd("mkdir -p /var/run/openvswitch/")
On Mon, Sep 24, 2018 at 07:27:49PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Patch for ported phase2 xml recipes.
Christos Sfakianakis (10): lnst.Recipes.ENRT: add TeamRecipe lnst.Recipes.ENRT: add DoubleTeamRecipe lnst.Recipes.ENRT: add TeamVsBondRecipe lnst.Recipes.ENRT: add VlansOverTeamRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInGuestRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInHostRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInGuestMirroredRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlanInHostMirroredRecipe lnst.Recipes.ENRT: add VirtualOvsBridgeVlansOverBondRecipe lnst.Devices: edit OvsBridgeDevice
lnst/Devices/OvsBridgeDevice.py | 4 +- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 83 ++++++++++ lnst/Recipes/ENRT/TeamRecipe.py | 74 +++++++++ lnst/Recipes/ENRT/TeamVsBondRecipe.py | 87 +++++++++++ ...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 110 +++++++++++++ .../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 89 +++++++++++ ...irtualOvsBridgeVlanInHostMirroredRecipe.py | 102 ++++++++++++ .../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 87 +++++++++++ .../VirtualOvsBridgeVlansOverBondRecipe.py | 147 ++++++++++++++++++ lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 91 +++++++++++ 10 files changed, 872 insertions(+), 2 deletions(-) create mode 100644 lnst/Recipes/ENRT/DoubleTeamRecipe.py create mode 100644 lnst/Recipes/ENRT/TeamRecipe.py create mode 100644 lnst/Recipes/ENRT/TeamVsBondRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py create mode 100644 lnst/Recipes/ENRT/VlansOverTeamRecipe.py
-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
No additional comments from me, we'll still need to work on these more once we finish the additional feature but for now this is probably ok...
When you post the patches with modifications suggested from Jan I'll apply them.
-Ondrej
lnst-developers@lists.fedorahosted.org