From: Christos Sfakianakis csfakian@redhat.com
All devices that have "to_guest" label are actually tap devices. They are renamed to 'tap' instead of 'eth' to avoid confusion. Affected recipes are (rest are included for completeness): - VirtualOvsBridgeVlansOverBondRecipe - VirtualOvsBridgeVlanInHostMirroredRecipe - VirtualOvsBridgeVlanInGuestMirroredRecipe - VirtualOvsBridgeVlanInHostRecipe - VirtualOvsBridgeVlanInGuestRecipe
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..54b38de --- /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.
v2: Rename devices that have "to_guest" label. Use 'tap' instead of 'eth'.
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..041276e --- /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.tap0 = DeviceReq(label="to_guest") + + host2 = HostReq() + host2.eth0 = DeviceReq(label="to_switch") + + guest1 = HostReq() + guest1.tap0 = 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.tap0.down() + host1.br0 = OvsBridgeDevice() + host1.br0.port_add(host1.eth0) + host1.br0.port_add(host1.tap0) + + host2.eth0.down() + host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id=10) + + guest1.tap0.down() + guest1.vlan1 = VlanDevice(realdev=guest1.tap0, 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.tap0.up() + host1.br0.up() + host2.eth0.up() + host2.vlan1.up() + guest1.tap0.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")
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.
v2: Rename devices that have "to_guest" label. Use 'tap' instead of 'eth'.
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..aadd304 --- /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.tap0 = DeviceReq(label="to_guest") + + host2 = HostReq() + host2.eth0 = DeviceReq(label="to_switch") + + guest1 = HostReq() + guest1.tap0 = 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.tap0.down() + host1.br0 = OvsBridgeDevice() + host1.br0.port_add(host1.eth0) + host1.br0.port_add(host1.tap0, tag="10") + + host2.eth0.down() + host2.vlan1 = VlanDevice(realdev=host2.eth0, vlan_id="10") + + guest1.tap0.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.tap0 + + if "mtu" in self.params: + host1.br0.mtu = self.params.mtu + host2.vlan1.mtu = self.params.mtu + guest1.tap0.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.tap0.ip_add(ipaddress(net_addr_1 + ".3/24")) + guest1.tap0.ip_add(ipaddress(net_addr6_1 + "::3/64")) + + host1.eth0.up() + host1.tap0.up() + host1.br0.up() + host2.eth0.up() + host2.vlan1.up() + guest1.tap0.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.
v2: Rename devices that have "to_guest" label. Use 'tap' instead of 'eth'.
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..acb5922 --- /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.tap0 = DeviceReq(label="to_guest1") + + host2 = HostReq() + host2.eth1 = DeviceReq(label="to_switch") + host2.tap0 = DeviceReq(label="to_guest2") + + guest1 = HostReq() + guest1.tap0 = DeviceReq(label="to_guest1") + + guest2 = HostReq() + guest2.tap0 = 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.tap0.down() + host1.br0 = OvsBridgeDevice() + for m, d in [(host1, host1.eth1), (host1, host1.tap0)]: + m.br0.port_add(d) + + host2.eth1.down() + host2.tap0.down() + host2.br0 = OvsBridgeDevice() + for m, d in [(host2, host2.eth1), (host2, host2.tap0)]: + if d.master != None: + if "ovs" not in d.master.name: + m.br0.port_add(d) + else: + m.br0.port_add(d) + + guest1.tap0.down() + guest1.vlan1 = VlanDevice(realdev=guest1.tap0, vlan_id=10) + + guest2.tap0.down() + guest2.vlan1 = VlanDevice(realdev=guest2.tap0, 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.tap0.up() + host1.br0.up() + host2.eth1.up() + host2.tap0.up() + host2.br0.up() + guest1.tap0.up() + guest1.vlan1.up() + guest2.tap0.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.
v2: Rename devices that have "to_guest" label. Use 'tap' instead of 'eth'.
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..e5f90ad --- /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.tap0 = DeviceReq(label="to_guest1") + + host2 = HostReq() + host2.eth1 = DeviceReq(label="to_switch") + host2.tap0 = DeviceReq(label="to_guest2") + + guest1 = HostReq() + guest1.tap0 = DeviceReq(label="to_guest1") + + guest2 = HostReq() + guest2.tap0 = 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.tap0.down() + host1.br0 = OvsBridgeDevice() + host1.br0.port_add(host1.eth1) + host1.br0.port_add(host1.tap0, tag="10") + + host2.eth1.down() + host2.tap0.down() + host2.br0 = OvsBridgeDevice() + host2.br0.port_add(host2.eth1) + host2.br0.port_add(host2.tap0, tag="10") + + guest1.tap0.down() + + guest2.tap0.down() + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + configuration = EnrtConfiguration() + configuration.endpoint1 = guest1.tap0 + configuration.endpoint2 = guest2.tap0 + + if "mtu" in self.params: + host1.br0.mtu = self.params.mtu + host2.br0.mtu = self.params.mtu + guest1.tap0.mtu = self.params.mtu + guest2.tap0.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr6_1 = "fc00:0:0:1" + + guest1.tap0.ip_add(ipaddress(net_addr_1 + ".3/24")) + guest1.tap0.ip_add(ipaddress(net_addr6_1 + "::3/64")) + guest2.tap0.ip_add(ipaddress(net_addr_1 + ".4/24")) + guest2.tap0.ip_add(ipaddress(net_addr6_1 + "::4/64")) + + host1.eth1.up() + host1.tap0.up() + host1.br0.up() + host2.eth1.up() + host2.tap0.up() + host2.br0.up() + guest1.tap0.up() + guest2.tap0.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.
v2: Rename devices that have "to_guest" label. Use 'tap' instead of 'eth'.
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..1719161 --- /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.tap0 = DeviceReq(label="to_guest1") + host1.tap1 = DeviceReq(label="to_guest2") + + host2 = HostReq() + host2.eth1 = DeviceReq(label="to_switch") + host2.eth2 = DeviceReq(label="to_switch") + host2.tap0 = DeviceReq(label="to_guest3") + host2.tap1 = DeviceReq(label="to_guest4") + + guest1 = HostReq() + guest1.tap0 = DeviceReq(label="to_guest1") + + guest2 = HostReq() + guest2.tap0 = DeviceReq(label="to_guest2") + + guest3 = HostReq() + guest3.tap0 = DeviceReq(label="to_guest3") + + guest4 = HostReq() + guest4.tap0 = 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.tap0.down() + host1.tap1.down() + host1.br0 = OvsBridgeDevice() + for d, tag in [(host1.tap0, "10"), (host1.tap1, "20")]: + host1.br0.port_add(d, tag=tag) + + #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.tap0.down() + host2.tap1.down() + host2.br0 = OvsBridgeDevice() + + for d, tag in [(host2.tap0, "10"), (host2.tap1, "20")]: + host2.br0.port_add(d, tag=tag) + + host2.br0.bond_add("bond_host2", (host2.eth1, host2.eth2), bond_mode=self.params.bonding_mode) + + guest1.tap0.down() + + guest2.tap0.down() + + guest3.tap0.down() + + guest4.tap0.down() + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + configuration = EnrtConfiguration() + configuration.endpoint1 = guest1.tap0 + configuration.endpoint2 = guest3.tap0 + + if "mtu" in self.params: + host1.br0.mtu = self.params.mtu + host2.br0.mtu = self.params.mtu + guest1.tap0.mtu = self.params.mtu + guest2.tap0.mtu = self.params.mtu + guest3.tap0.mtu = self.params.mtu + guest4.tap0.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.tap0.up() + host1.tap1.up() + host1.br0.up() + host2.eth1.up() + host2.eth2.up() + host2.tap0.up() + host2.tap1.up() + host2.br0.up() + guest1.tap0.up() + guest2.tap0.up() + guest3.tap0.up() + guest4.tap0.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/")
Fri, Oct 26, 2018 at 10:41:16AM 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 | 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/")
Few comments on this one (sorry I did not on v1).
The commit's description should be something more verbose that "edit OvsBridgeDevice".
I checked the openvswitch module and it does not support any module parameters: modinfo openvswitch | grep -i parm
Is it ok to remove this "_moduleparams" thing completely?
Also wondering if the openvswitch module is loaded automagically when ovs-vsctl is called? Then we could probably remove _type_init() completely.
-Jan
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, October 26, 2018 12:03:26 PM Subject: Re: [PATCH-next 10/10] lnst.Devices: edit OvsBridgeDevice
Fri, Oct 26, 2018 at 10:41:16AM 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 | 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/")Few comments on this one (sorry I did not on v1).
The commit's description should be something more verbose that "edit OvsBridgeDevice".
Ok, will be more specific next time
I checked the openvswitch module and it does not support any module parameters: modinfo openvswitch | grep -i parm
Is it ok to remove this "_moduleparams" thing completely?
Your point here seems to be correct. I ran VirtualOvsBridgeVlanInGuestRecipe and "_moduleparams" is empty string at this point (which agrees with your comment). Since it is only used as parameter in the 'modprobe' command in the '_type_init()' method, it can be disregarded.
Also wondering if the openvswitch module is loaded automagically when ovs-vsctl is called? Then we could probably remove _type_init() completely.
It seems that 'ovs-vsctl' script does not suffice load the module or prepare the dependency files. When I ran the same recipe as above, with the module not loaded initially, the was failure as below:
lsmod | grep openvswitch # returned nothing before 'ovs-vsctl' command ... Executing: "ovs-vsctl add-br t_ovsbr0" # _create method entered, this is the first time 'ovs-vsctl' is called ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
So it seems this part of the _type_init() method is required for the module to work properly. Adding Ondrej in case I am missing something.
- Christos
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 Wed, Oct 31, 2018 at 07:07:55AM -0400, Christos Sfakianakis wrote:
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, October 26, 2018 12:03:26 PM Subject: Re: [PATCH-next 10/10] lnst.Devices: edit OvsBridgeDevice
Fri, Oct 26, 2018 at 10:41:16AM 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 | 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/")Few comments on this one (sorry I did not on v1).
The commit's description should be something more verbose that "edit OvsBridgeDevice".
Ok, will be more specific next time
I checked the openvswitch module and it does not support any module parameters: modinfo openvswitch | grep -i parm
Is it ok to remove this "_moduleparams" thing completely?
Your point here seems to be correct. I ran VirtualOvsBridgeVlanInGuestRecipe and "_moduleparams" is empty string at this point (which agrees with your comment). Since it is only used as parameter in the 'modprobe' command in the '_type_init()' method, it can be disregarded.
Also wondering if the openvswitch module is loaded automagically when ovs-vsctl is called? Then we could probably remove _type_init() completely.
It seems that 'ovs-vsctl' script does not suffice load the module or prepare the dependency files. When I ran the same recipe as above, with the module not loaded initially, the was failure as below:
lsmod | grep openvswitch # returned nothing before 'ovs-vsctl' command ... Executing: "ovs-vsctl add-br t_ovsbr0" # _create method entered, this is the first time 'ovs-vsctl' is called ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
So it seems this part of the _type_init() method is required for the module to work properly. Adding Ondrej in case I am missing something.
- Christos
ovs related modules are loaded automagically when the openvswitch system service is started. When support for ovs was first introduced this didn't exist so we had to launch ovs manually - create the db, load the modules and run the ovsdb-server and ovs-vswitchd. Now however this is all handled by the systemd service.
As to what to do, OvsBridgeDevice class is the only device class left that still uses a type_init method, it's been removed from all the other types. I'm thinking that when I get to actually reimplement it, it might end up also being removed.
On the other hand IF it stays, it should probably just attempt to start the openvswitch service and ignore any modules etc... This can be done now and maybe removed later if we decide that...
@Christos, if this makes sense and Jan agrees you can probably do this option.
-Ondrej
Wed, Oct 31, 2018 at 12:43:09PM CET, olichtne@redhat.com wrote:
On Wed, Oct 31, 2018 at 07:07:55AM -0400, Christos Sfakianakis wrote:
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, October 26, 2018 12:03:26 PM Subject: Re: [PATCH-next 10/10] lnst.Devices: edit OvsBridgeDevice
Fri, Oct 26, 2018 at 10:41:16AM 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 | 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/")Few comments on this one (sorry I did not on v1).
The commit's description should be something more verbose that "edit OvsBridgeDevice".
Ok, will be more specific next time
I checked the openvswitch module and it does not support any module parameters: modinfo openvswitch | grep -i parm
Is it ok to remove this "_moduleparams" thing completely?
Your point here seems to be correct. I ran VirtualOvsBridgeVlanInGuestRecipe and "_moduleparams" is empty string at this point (which agrees with your comment). Since it is only used as parameter in the 'modprobe' command in the '_type_init()' method, it can be disregarded.
Also wondering if the openvswitch module is loaded automagically when ovs-vsctl is called? Then we could probably remove _type_init() completely.
It seems that 'ovs-vsctl' script does not suffice load the module or prepare the dependency files. When I ran the same recipe as above, with the module not loaded initially, the was failure as below:
lsmod | grep openvswitch # returned nothing before 'ovs-vsctl' command ... Executing: "ovs-vsctl add-br t_ovsbr0" # _create method entered, this is the first time 'ovs-vsctl' is called ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
So it seems this part of the _type_init() method is required for the module to work properly. Adding Ondrej in case I am missing something.
- Christos
ovs related modules are loaded automagically when the openvswitch system service is started. When support for ovs was first introduced this didn't exist so we had to launch ovs manually - create the db, load the modules and run the ovsdb-server and ovs-vswitchd. Now however this is all handled by the systemd service.
As to what to do, OvsBridgeDevice class is the only device class left that still uses a type_init method, it's been removed from all the other types. I'm thinking that when I get to actually reimplement it, it might end up also being removed.
On the other hand IF it stays, it should probably just attempt to start the openvswitch service and ignore any modules etc... This can be done now and maybe removed later if we decide that...
@Christos, if this makes sense and Jan agrees you can probably do this option.
ACK.
-Jan
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: "Ondrej Lichtner" olichtne@redhat.com Cc: "Christos Sfakianakis" csfakian@redhat.com, lnst-developers@lists.fedorahosted.org Sent: Wednesday, October 31, 2018 2:21:21 PM Subject: Re: [PATCH-next 10/10] lnst.Devices: edit OvsBridgeDevice
Wed, Oct 31, 2018 at 12:43:09PM CET, olichtne@redhat.com wrote:
On Wed, Oct 31, 2018 at 07:07:55AM -0400, Christos Sfakianakis wrote:
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Friday, October 26, 2018 12:03:26 PM Subject: Re: [PATCH-next 10/10] lnst.Devices: edit OvsBridgeDevice
Fri, Oct 26, 2018 at 10:41:16AM 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 | 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/")Few comments on this one (sorry I did not on v1).
The commit's description should be something more verbose that "edit OvsBridgeDevice".
Ok, will be more specific next time
I checked the openvswitch module and it does not support any module parameters: modinfo openvswitch | grep -i parm
Is it ok to remove this "_moduleparams" thing completely?
Your point here seems to be correct. I ran VirtualOvsBridgeVlanInGuestRecipe and "_moduleparams" is empty string at this point (which agrees with your comment). Since it is only used as parameter in the 'modprobe' command in the '_type_init()' method, it can be disregarded.
Also wondering if the openvswitch module is loaded automagically when ovs-vsctl is called? Then we could probably remove _type_init() completely.
It seems that 'ovs-vsctl' script does not suffice load the module or prepare the dependency files. When I ran the same recipe as above, with the module not loaded initially, the was failure as below:
lsmod | grep openvswitch # returned nothing before 'ovs-vsctl' command ... Executing: "ovs-vsctl add-br t_ovsbr0" # _create method entered, this is the first time 'ovs-vsctl' is called ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
So it seems this part of the _type_init() method is required for the module to work properly. Adding Ondrej in case I am missing something.
- Christos
ovs related modules are loaded automagically when the openvswitch system service is started. When support for ovs was first introduced this didn't exist so we had to launch ovs manually - create the db, load the modules and run the ovsdb-server and ovs-vswitchd. Now however this is all handled by the systemd service.
As to what to do, OvsBridgeDevice class is the only device class left that still uses a type_init method, it's been removed from all the other types. I'm thinking that when I get to actually reimplement it, it might end up also being removed.
On the other hand IF it stays, it should probably just attempt to start the openvswitch service and ignore any modules etc... This can be done now and maybe removed later if we decide that...
@Christos, if this makes sense and Jan agrees you can probably do this option.
ACK.
-Jan
Hello, I just sent the change. I didn't include a command to stop openvswitch in the "destroy()" method (to deactivate the module and return to the system state at the beginning of the recipe) because, under the current design, this method is never called for an OvsBridgeDevice instance. So I only added a single systemd command.
-Christos
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