From: Christos Sfakianakis csfakian@redhat.com
Patch 1 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 | 6 +- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 83 +++++++++ lnst/Recipes/ENRT/TeamRecipe.py | 74 ++++++++ lnst/Recipes/ENRT/TeamVsBondRecipe.py | 87 +++++++++ ...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 118 ++++++++++++ .../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 97 ++++++++++ ...irtualOvsBridgeVlanInHostMirroredRecipe.py | 126 +++++++++++++ .../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 100 +++++++++++ .../VirtualOvsBridgeVlansOverBondRecipe.py | 168 ++++++++++++++++++ lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 91 ++++++++++ 10 files changed, 948 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 | 97 +++++++++++++++++++ 1 file changed, 97 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..ed5c19e --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -0,0 +1,97 @@ +""" +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() + #Add this check to avoid non-zero return code of ovs-vsctl 'add-port' + #command in case the interface has already been enslaved in the bridge + #by either NetworkManager or OpenVSwitch behavior. + #E.g https://github.com/ansible/ansible-modules-extras/issues/3410 + for m, d in [(host1, host1.eth0), (host1, host1.eth1)]: + if d.master != None: + if "ovs" not in d.master.name: + m.br0.port_add(d) + else: + m.br0.port_add(d) + + 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")
On Wed, Sep 12, 2018 at 05:50:11PM +0200, 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 | 97 +++++++++++++++++++ 1 file changed, 97 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..ed5c19e --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -0,0 +1,97 @@ +""" +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.guest1host1.eth0.down()host1.eth1.down()host1.br0 = OvsBridgeDevice()#Add this check to avoid non-zero return code of ovs-vsctl 'add-port'#command in case the interface has already been enslaved in the bridge#by either NetworkManager or OpenVSwitch behavior.#E.g https://github.com/ansible/ansible-modules-extras/issues/3410for m, d in [(host1, host1.eth0), (host1, host1.eth1)]:if d.master != None:if "ovs" not in d.master.name:m.br0.port_add(d)else:m.br0.port_add(d)
I really don't think this should be here... The OvS bridge is freshly created, it shouldn't have any ports. If it does it's a bug we need to fix elsewhere...
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...
On Tue, Sep 18, 2018 at 10:48:12AM +0200, Ondrej Lichtner wrote:
On Wed, Sep 12, 2018 at 05:50:11PM +0200, 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 | 97 +++++++++++++++++++ 1 file changed, 97 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..ed5c19e --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestRecipe.py @@ -0,0 +1,97 @@ +""" +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.guest1host1.eth0.down()host1.eth1.down()host1.br0 = OvsBridgeDevice()#Add this check to avoid non-zero return code of ovs-vsctl 'add-port'#command in case the interface has already been enslaved in the bridge#by either NetworkManager or OpenVSwitch behavior.#E.g https://github.com/ansible/ansible-modules-extras/issues/3410for m, d in [(host1, host1.eth0), (host1, host1.eth1)]:if d.master != None:if "ovs" not in d.master.name:m.br0.port_add(d)else:m.br0.port_add(d)I really don't think this should be here... The OvS bridge is freshly created, it shouldn't have any ports. If it does it's a bug we need to fix elsewhere...
Same thing applies to all the following OvS related tests that also have this bit of code...
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 | 100 ++++++++++++++++++ 1 file changed, 100 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..70c03bd --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostRecipe.py @@ -0,0 +1,100 @@ +""" +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() + #Add this check to avoid non-zero return code of ovs-vsctl 'add-port' + #command in case the interface has already been enslaved in the bridge + #by either NetworkManager or OpenVSwitch behavior. + #E.g https://github.com/ansible/ansible-modules-extras/issues/3410 + if host1.eth0.master != None: + if "ovs" not in host1.eth0.master.name: + host1.br0.port_add(host1.eth0) + else: + host1.br0.port_add(host1.eth0) + + if host1.eth1.master != None: + if "ovs" not in host1.eth1.master.name: + host1.br0.port_add(host1.eth1, tag="10") + else: + 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 | 118 ++++++++++++++++++ 1 file changed, 118 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..3504061 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInGuestMirroredRecipe.py @@ -0,0 +1,118 @@ +""" +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() + #Add this check to avoid non-zero return code of ovs-vsctl 'add-port' + #command in case the interface has already been enslaved in the bridge + #by either NetworkManager or OpenVSwitch behavior. + #E.g https://github.com/ansible/ansible-modules-extras/issues/3410 + for m, d in [(host1, host1.eth1), (host1, host1.eth2)]: + if d.master != None: + if "ovs" not in d.master.name: + m.br0.port_add(d) + else: + 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 | 126 ++++++++++++++++++ 1 file changed, 126 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..08f0fe7 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlanInHostMirroredRecipe.py @@ -0,0 +1,126 @@ +""" +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() + #Add this check to avoid non-zero return code of ovs-vsctl 'add-port' + #command in case the interface has already been enslaved in the bridge + #by either NetworkManager or OpenVSwitch behavior. + #E.g https://github.com/ansible/ansible-modules-extras/issues/3410 + if host1.eth1.master != None: + if "ovs" not in host1.eth1.master.name: + host1.br0.port_add(host1.eth1) + else: + host1.br0.port_add(host1.eth1) + + if host1.eth2.master != None: + if "ovs" not in host1.eth2.master.name: + host1.br0.port_add(host1.eth2, tag="10") + else: + host1.br0.port_add(host1.eth2, tag="10") + + + host2.eth1.down() + host2.eth2.down() + host2.br0 = OvsBridgeDevice() + if host2.eth1.master != None: + if "ovs" not in host2.eth1.master.name: + host2.br0.port_add(host2.eth1) + else: + host2.br0.port_add(host2.eth1) + + if host2.eth2.master != None: + if "ovs" not in host2.eth2.master.name: + host2.br0.port_add(host2.eth2, tag="10") + else: + 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 | 168 ++++++++++++++++++ 1 file changed, 168 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..1293c4b --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py @@ -0,0 +1,168 @@ +""" +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() + #Add this check to avoid non-zero return code of ovs-vsctl 'add-port' + #command in case the interface has already been enslaved in the bridge + #by either NetworkManager or OpenVSwitch behavior. + #E.g https://github.com/ansible/ansible-modules-extras/issues/3410 + for d, tag in [(host1.eth3, "10"), (host1.eth4, "20")]: + if d.master != None: + if "ovs" not in d.master.name: + host1.br0.port_add(d, tag=tag) + else: + 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")]: + if d.master != None: + if "ovs" not in d.master.name: + host2.br0.port_add(d, tag=tag) + else: + 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")) + + #guest1.eth0.ip_add(ipaddress(net_addr_1 + ".1/24")) + #guest1.eth0.ip_add(ipaddress(net_addr6_1 + "::1/64")) + #guest2.eth0.ip_add(ipaddress(net_addr_2 + ".1/24")) + #guest2.eth0.ip_add(ipaddress(net_addr6_2 + "::1/64")) + #guest3.eth0.ip_add(ipaddress(net_addr_1 + ".2/24")) + #guest3.eth0.ip_add(ipaddress(net_addr6_1 + "::2/64")) + #guest4.eth0.ip_add(ipaddress(net_addr_2 + ".2/24")) + #guest4.eth0.ip_add(ipaddress(net_addr6_2 + "::2/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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lnst/Devices/OvsBridgeDevice.py b/lnst/Devices/OvsBridgeDevice.py index d54cf94..e4d843b 100644 --- a/lnst/Devices/OvsBridgeDevice.py +++ b/lnst/Devices/OvsBridgeDevice.py @@ -25,8 +25,10 @@ class OvsBridgeDevice(SoftDevice):
@classmethod def _type_init(cls): - if not cls._type_initialized: - exec_cmd("modprobe %s %s" % ("openvswitch", cls._moduleparams)) + #if not cls._type_initialized: + if not "_type_initialized" in dir(cls): + exec_cmd("modprobe %s %s" % ("openvswitch", getattr(cls, "_moduleparams", ""))) + #exec_cmd("modprobe %s %s" % ("openvswitch", cls._moduleparams))
if not check_process_running("ovsdb-server"): exec_cmd("mkdir -p /var/run/openvswitch/")
Wed, Sep 12, 2018 at 05:50:16PM CEST, csfakian@redhat.com wrote:
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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lnst/Devices/OvsBridgeDevice.py b/lnst/Devices/OvsBridgeDevice.py index d54cf94..e4d843b 100644 --- a/lnst/Devices/OvsBridgeDevice.py +++ b/lnst/Devices/OvsBridgeDevice.py @@ -25,8 +25,10 @@ class OvsBridgeDevice(SoftDevice):
@classmethod def _type_init(cls):
if not cls._type_initialized:exec_cmd("modprobe %s %s" % ("openvswitch", cls._moduleparams))
#if not cls._type_initialized:
Please remove the commented out bits.
if not "_type_initialized" in dir(cls):exec_cmd("modprobe %s %s" % ("openvswitch", getattr(cls, "_moduleparams", "")))#exec_cmd("modprobe %s %s" % ("openvswitch", cls._moduleparams))
Same here.
if not check_process_running("ovsdb-server"): exec_cmd("mkdir -p /var/run/openvswitch/")-- 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@lists.fedorahosted.org