From: Christos Sfakianakis csfakian@redhat.com
There is 1-1 correspondence between these recipes and the old regression_tests/phase1/ xml files.
Christos Sfakianakis (13): lnst.Recipes.ENRT: add ActiveBackupBondRecipe lnst.Recipes.ENRT: add ActiveBackupDoubleBondRecipe lnst.Recipes.ENRT: add RoundRobinBondRecipe lnst.Recipes.ENRT: add RoundRobinDoubleBondRecipe lnst.Recipes.ENRT: add PingFloodRecipe lnst.Recipes.ENRT: add VirtualBridgeVlanInGuestRecipe lnst.Recipes.ENRT: add VirtualBridgeVlanInGuestMirroredRecipe lnst.Recipes.ENRT: add VirtualBridgeVlanInHostMirroredRecipe lnst.Recipes.ENRT: add VirtualBridgeVlanInHostRecipe lnst.Recipes.ENRT: add Vlans3OverActiveBackupBondRecipe lnst.Recipes.ENRT: add Vlans3OverRoundRobinBondRecipe lnst.Recipes.ENRT: add Vlans3Recipe lnst.Recipes.ENRT: add VirtualBridge2VlansOverBondRecipe
lnst/Recipes/ENRT/ActiveBackupBondRecipe.py | 68 ++++++++++ .../ENRT/ActiveBackupDoubleBondRecipe.py | 67 ++++++++++ lnst/Recipes/ENRT/PingFloodRecipe.py | 33 +++++ lnst/Recipes/ENRT/RoundRobinBondRecipe.py | 68 ++++++++++ .../ENRT/RoundRobinDoubleBondRecipe.py | 67 ++++++++++ .../ENRT/VirtualBridge2VlansOverBondRecipe.py | 125 ++++++++++++++++++ .../VirtualBridgeVlanInGuestMirroredRecipe.py | 107 +++++++++++++++ .../ENRT/VirtualBridgeVlanInGuestRecipe.py | 90 +++++++++++++ .../VirtualBridgeVlanInHostMirroredRecipe.py | 105 +++++++++++++++ .../ENRT/VirtualBridgeVlanInHostRecipe.py | 88 ++++++++++++ .../ENRT/Vlans3OverActiveBackupBondRecipe.py | 92 +++++++++++++ .../ENRT/Vlans3OverRoundRobinBondRecipe.py | 92 +++++++++++++ lnst/Recipes/ENRT/Vlans3Recipe.py | 85 ++++++++++++ 13 files changed, 1087 insertions(+) create mode 100644 lnst/Recipes/ENRT/ActiveBackupBondRecipe.py create mode 100644 lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py create mode 100644 lnst/Recipes/ENRT/PingFloodRecipe.py create mode 100644 lnst/Recipes/ENRT/RoundRobinBondRecipe.py create mode 100644 lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py create mode 100644 lnst/Recipes/ENRT/Vlans3OverActiveBackupBondRecipe.py create mode 100644 lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py create mode 100644 lnst/Recipes/ENRT/Vlans3Recipe.py
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe ActiveBackupBondRecipe, implementing old regression_tests/phase1/active_backup_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/ActiveBackupBondRecipe.py | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lnst/Recipes/ENRT/ActiveBackupBondRecipe.py
diff --git a/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py b/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py new file mode 100644 index 0000000..62556b4 --- /dev/null +++ b/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py @@ -0,0 +1,68 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(active_backup_bond.xml + bonding_test.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 BondDevice + +class ActiveBackupBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + m1.eth1 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + + 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"))) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.bond0 = BondDevice(mode="active-backup", name="my_bond0") + m1.eth0.down() + m1.eth1.down() + m1.bond0.slave_add(m1.eth0) + m1.bond0.slave_add(m1.eth1) + + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.bond0 + configuration.endpoint2 = m2.eth0 + + if "mtu" in self.params: + m1.bond0.mtu = self.params.mtu + m2.eth0.mtu = self.params.mtu + + net_addr = "192.168.101" + net_addr6 = "fc00:0:0:0" + m1.bond0.ip_add(ipaddress(net_addr + ".1/24")) + m1.bond0.ip_add(ipaddress(net_addr6 + "::1/64")) + m1.eth0.up() + m1.eth1.up() + m1.bond0.up() + + m2.eth0.ip_add(ipaddress(net_addr + ".2/24")) + m2.eth0.ip_add(ipaddress(net_addr6 + "::2/64")) + m2.eth0.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")
Tue, Aug 21, 2018 at 02:11:06PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe ActiveBackupBondRecipe, implementing old regression_tests/phase1/active_backup_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/ActiveBackupBondRecipe.py | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lnst/Recipes/ENRT/ActiveBackupBondRecipe.py
diff --git a/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py b/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py new file mode 100644 index 0000000..62556b4 --- /dev/null +++ b/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py @@ -0,0 +1,68 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(active_backup_bond.xml + bonding_test.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 BondDevice
+class ActiveBackupBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- 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")))
- def test_wide_configuration(self):
m1, m2 = self.matched.m1, self.matched.m2
m1.bond0 = BondDevice(mode="active-backup", name="my_bond0")
m1.eth0.down()
m1.eth1.down()
m1.bond0.slave_add(m1.eth0)
m1.bond0.slave_add(m1.eth1)
Could we enhance the abstraction here? Probably we could completely remove: m1.eth0.down() m1.eth1.down()
and move it into BondDevice class when calling m1.bond0.slave_add(m1.eth0)
configuration = EnrtConfiguration()
configuration.endpoint1 = m1.bond0
configuration.endpoint2 = m2.eth0
if "mtu" in self.params:
m1.bond0.mtu = self.params.mtu
m2.eth0.mtu = self.params.mtu
net_addr = "192.168.101"
net_addr6 = "fc00:0:0:0"
m1.bond0.ip_add(ipaddress(net_addr + ".1/24"))
m1.bond0.ip_add(ipaddress(net_addr6 + "::1/64"))
m1.eth0.up()
m1.eth1.up()
And same for the above? The line below can abstract this?
m1.bond0.up()
m2.eth0.ip_add(ipaddress(net_addr + ".2/24"))
m2.eth0.ip_add(ipaddress(net_addr6 + "::2/64"))
m2.eth0.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")
-- 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.fedoraproject.org/archives/list/lnst-developers@lists.fedoraho...
On Tue, Aug 21, 2018 at 03:00:01PM +0200, Jan Tluka wrote:
Tue, Aug 21, 2018 at 02:11:06PM CEST, csfakian@redhat.com wrote:
m1.bond0 = BondDevice(mode="active-backup", name="my_bond0")
m1.eth0.down()
m1.eth1.down()
m1.bond0.slave_add(m1.eth0)
m1.bond0.slave_add(m1.eth1)
Could we enhance the abstraction here? Probably we could completely remove: m1.eth0.down() m1.eth1.down()
and move it into BondDevice class when calling m1.bond0.slave_add(m1.eth0)
This is more of a generic "next" branch question... it's an interesting idea, but I'm not 100% convinced... the slave_{add, del} methods are shared by all devices inheriting from MasterDevice class. At the same time the rules to adding slaves can be slightly different based on the type of device, some types don't require first setting the slaves down, some do, some require the master to be down.
Hiding this inside the slave_{add, del} methods could become confusing and give testers false assumptions - e.g. adding a slave while some test is running will end up setting all other slaves and the master down, then add the slave and then set everything back up, whereas in the code it would just look like a slave was added.
So I think for now I prefer this to be explicit even if it leads to a couple more lines. But we can discuss this on an upstream meeting, see what others think...
-Ondrej
Wed, Aug 22, 2018 at 09:54:58AM CEST, olichtne@redhat.com wrote:
On Tue, Aug 21, 2018 at 03:00:01PM +0200, Jan Tluka wrote:
Tue, Aug 21, 2018 at 02:11:06PM CEST, csfakian@redhat.com wrote:
m1.bond0 = BondDevice(mode="active-backup", name="my_bond0")
m1.eth0.down()
m1.eth1.down()
m1.bond0.slave_add(m1.eth0)
m1.bond0.slave_add(m1.eth1)
Could we enhance the abstraction here? Probably we could completely remove: m1.eth0.down() m1.eth1.down()
and move it into BondDevice class when calling m1.bond0.slave_add(m1.eth0)
This is more of a generic "next" branch question... it's an interesting idea, but I'm not 100% convinced... the slave_{add, del} methods are shared by all devices inheriting from MasterDevice class. At the same time the rules to adding slaves can be slightly different based on the type of device, some types don't require first setting the slaves down, some do, some require the master to be down.
We could redefine the method of BondDevice,
dev.down() super(BondDevice, self).slave_add(dev)
Hiding this inside the slave_{add, del} methods could become confusing and give testers false assumptions - e.g. adding a slave while some test is running will end up setting all other slaves and the master down, then add the slave and then set everything back up, whereas in the code it would just look like a slave was added.
I understand your point but I think this goes against easy-to-use.
For bonding there's no other way to enslave a device unless it's down. You just have to do it otherwise the code throws exception.
And what's the difference of completely avoiding LNST and simply run:
ip l set eth0 down ip l set eth1 down echo "+eth0" > /sys/class/net/bond0/bonding/slaves echo "+eth1" > /sys/class/net/bond0/bonding/slaves
Of course, there's matching algorithm that makes it much more easy. I just don't see an advantage here.
Let's discuss this upstream on one of our Monday calls.
-Jan
So I think for now I prefer this to be explicit even if it leads to a couple more lines. But we can discuss this on an upstream meeting, see what others think...
-Ondrej
On Wed, Aug 22, 2018 at 09:54:58AM +0200, Ondrej Lichtner wrote:
On Tue, Aug 21, 2018 at 03:00:01PM +0200, Jan Tluka wrote:
Tue, Aug 21, 2018 at 02:11:06PM CEST, csfakian@redhat.com wrote:
m1.bond0 = BondDevice(mode="active-backup", name="my_bond0")
m1.eth0.down()
m1.eth1.down()
m1.bond0.slave_add(m1.eth0)
m1.bond0.slave_add(m1.eth1)
Could we enhance the abstraction here? Probably we could completely remove: m1.eth0.down() m1.eth1.down()
and move it into BondDevice class when calling m1.bond0.slave_add(m1.eth0)
This is more of a generic "next" branch question... it's an interesting idea, but I'm not 100% convinced... the slave_{add, del} methods are shared by all devices inheriting from MasterDevice class. At the same time the rules to adding slaves can be slightly different based on the type of device, some types don't require first setting the slaves down, some do, some require the master to be down.
Hiding this inside the slave_{add, del} methods could become confusing and give testers false assumptions - e.g. adding a slave while some test is running will end up setting all other slaves and the master down, then add the slave and then set everything back up, whereas in the code it would just look like a slave was added.
So I think for now I prefer this to be explicit even if it leads to a couple more lines. But we can discuss this on an upstream meeting, see what others think...
-Ondrej
I've thought about this a little bit more and I want to record my thoughts somewhere so we don't forget to talk about this on an upstream meeting.
I definitely think that LNST should be able to provide the "smallest step possible" APIs in case they're needed for some test scenario. And at same time provide some nice abstractions that makes writing normal (no special scenarios) tests easy. And finally we want to have future version API stability at some point... This kind of leads to us supporting multiple APIs - some that do the smallest step and then some that combine multiple steps that are commonly used.
The question then is if we want to mix these in the same place (e.g. Device class and derivatives APIs) or if we want to separate them somewhere else and expose them to the tester in different ways.
In case of these slave_* methods, I think I changed my mind. I think I agree that they should take care of the up/down actions and abstract them for the tester. The reason for that is because the most important "smallest step possible" is really just setting device master (not adding a slave, that's an operation in the other direction). So in this case we already have "2" APIs that do the "same thing" - set master is the smallest step operation and slave_add is the abstracted operation for the tester.
In the slave_* case it's obvious that the higher abstraction is comfortable in the place that it's currently at, however I don't know if that's true for all the cases where we want to provide some level of abstraction... we should talk about that.
Thanks, -Ondrej
On Tue, Aug 21, 2018 at 02:11:06PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe ActiveBackupBondRecipe, implementing old regression_tests/phase1/active_backup_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/ActiveBackupBondRecipe.py | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lnst/Recipes/ENRT/ActiveBackupBondRecipe.py
diff --git a/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py b/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py new file mode 100644 index 0000000..62556b4 --- /dev/null +++ b/lnst/Recipes/ENRT/ActiveBackupBondRecipe.py @@ -0,0 +1,68 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(active_backup_bond.xml + bonding_test.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 BondDevice
+class ActiveBackupBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- 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")))
There should also be a miimon bond parameter added to keep feature parity with the old phase1 recipe. Default value we've been using is '100'. This is valid for both the active backup and the round robin cases as well as the double bond scenarios.
-Ondrej
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe ActiveBackupDoubleBondRecipe, implementing old regression_tests/phase1/active_backup_double_bond.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/ActiveBackupDoubleBondRecipe.py | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py
diff --git a/lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py b/lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py new file mode 100644 index 0000000..172b800 --- /dev/null +++ b/lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py @@ -0,0 +1,67 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(active_backup_double_bond.xml + bonding_test.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 BondDevice + +class ActiveBackupDoubleBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + m1.eth1 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + m2.eth1 = DeviceReq(label="net1") + + 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"))) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + for i, m in [(1, m1),(2, m2)]: + m.bond = BondDevice(mode="active-backup", name="bond_m"+str(i)) + m.eth0.down() + m.eth1.down() + m.bond.slave_add(m.eth0) + m.bond.slave_add(m.eth1) + + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.bond + configuration.endpoint2 = m2.bond + + if "mtu" in self.params: + m1.bond.mtu = self.params.mtu + m2.bond.mtu = self.params.mtu + + net_addr = "192.168.101" + net_addr6 = "fc00:0:0:0" + for i, m in [(1, m1),(2, m2)]: + m.bond.ip_add(ipaddress(net_addr + "." + str(i) + "/24")) + m.bond.ip_add(ipaddress(net_addr6 + "::" + str(i) + "/64")) + m.eth0.up() + m.eth1.up() + m.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")
On Tue, Aug 21, 2018 at 02:11:07PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe ActiveBackupDoubleBondRecipe, implementing old regression_tests/phase1/active_backup_double_bond.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/ActiveBackupDoubleBondRecipe.py | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py
diff --git a/lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py b/lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py new file mode 100644 index 0000000..172b800 --- /dev/null +++ b/lnst/Recipes/ENRT/ActiveBackupDoubleBondRecipe.py @@ -0,0 +1,67 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(active_backup_double_bond.xml + bonding_test.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 BondDevice
+class ActiveBackupDoubleBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- m2.eth1 = DeviceReq(label="net1")
- 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")))
- def test_wide_configuration(self):
m1, m2 = self.matched.m1, self.matched.m2
for i, m in [(1, m1),(2, m2)]:
^^^^ you can just use enumerate(self.matched) or enumarate([m1, m2]) for this.
m.bond = BondDevice(mode="active-backup", name="bond_m"+str(i))
is the name="bond" necessary? doesn't it get autogenerated?
m.eth0.down()
m.eth1.down()
m.bond.slave_add(m.eth0)
m.bond.slave_add(m.eth1)
configuration = EnrtConfiguration()
configuration.endpoint1 = m1.bond
configuration.endpoint2 = m2.bond
if "mtu" in self.params:
m1.bond.mtu = self.params.mtu
m2.bond.mtu = self.params.mtu
net_addr = "192.168.101"
net_addr6 = "fc00:0:0:0"
for i, m in [(1, m1),(2, m2)]:
m.bond.ip_add(ipaddress(net_addr + "." + str(i) + "/24"))
m.bond.ip_add(ipaddress(net_addr6 + "::" + str(i) + "/64"))
m.eth0.up()
m.eth1.up()
m.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")
-- 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.fedoraproject.org/archives/list/lnst-developers@lists.fedoraho...
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe RoundRobinBondRecipe, implementing old regression_tests/phase1/round_robin_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/RoundRobinBondRecipe.py | 68 +++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lnst/Recipes/ENRT/RoundRobinBondRecipe.py
diff --git a/lnst/Recipes/ENRT/RoundRobinBondRecipe.py b/lnst/Recipes/ENRT/RoundRobinBondRecipe.py new file mode 100644 index 0000000..fe2a7b6 --- /dev/null +++ b/lnst/Recipes/ENRT/RoundRobinBondRecipe.py @@ -0,0 +1,68 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(round_robin_bond.xml + bonding_test.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 BondDevice + +class RoundRobinBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + m1.eth1 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + + 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"))) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.bond0 = BondDevice(mode="balance-rr", name="my_bond0") + m1.eth0.down() + m1.eth1.down() + m1.bond0.slave_add(m1.eth0) + m1.bond0.slave_add(m1.eth1) + + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.bond0 + configuration.endpoint2 = m2.eth0 + + if "mtu" in self.params: + m1.bond0.mtu = self.params.mtu + m2.eth0.mtu = self.params.mtu + + net_addr = "192.168.101" + net_addr6 = "fc00:0:0:0" + m1.bond0.ip_add(ipaddress(net_addr + ".1/24")) + m1.bond0.ip_add(ipaddress(net_addr6 + "::1/64")) + m1.eth0.up() + m1.eth1.up() + m1.bond0.up() + + m2.eth0.ip_add(ipaddress(net_addr + ".2/24")) + m2.eth0.ip_add(ipaddress(net_addr6 + "::2/64")) + m2.eth0.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")
Tue, Aug 21, 2018 at 02:11:08PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe RoundRobinBondRecipe, implementing old regression_tests/phase1/round_robin_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Do we want to keep the round-robin recipes?
J.
On Tue, Aug 21, 2018 at 03:01:07PM +0200, Jan Tluka wrote:
Tue, Aug 21, 2018 at 02:11:08PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe RoundRobinBondRecipe, implementing old regression_tests/phase1/round_robin_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Do we want to keep the round-robin recipes?
J.
I think we might as well port it, I think I remember someone on internal irc talking about trying to run the recipe... Whether or not we decide to run it is a decision we can make outside of lnst upstream.
But on a different note, I think the ActiveBackup and RoundRobin Bond/DoubleBond recipes can probably just be merged into a single Bond and DoubleBond recipes, where the mode is just a parameter... I'll have to oduble check but at first glance there's no other difference in their configuration.
-Ondrej
On Wed, Aug 22, 2018 at 09:40:40AM +0200, Ondrej Lichtner wrote:
On Tue, Aug 21, 2018 at 03:01:07PM +0200, Jan Tluka wrote:
Tue, Aug 21, 2018 at 02:11:08PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe RoundRobinBondRecipe, implementing old regression_tests/phase1/round_robin_bond.xml.Its structure is based on previously ported SimplePerfRecipe.
Do we want to keep the round-robin recipes?
J.
I think we might as well port it, I think I remember someone on internal irc talking about trying to run the recipe... Whether or not we decide to run it is a decision we can make outside of lnst upstream.
But on a different note, I think the ActiveBackup and RoundRobin Bond/DoubleBond recipes can probably just be merged into a single Bond and DoubleBond recipes, where the mode is just a parameter... I'll have to oduble check but at first glance there's no other difference in their configuration.
Yes... that's the only difference so we should actually merge them to reduce code duplication.
-Ondrej _______________________________________________ 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.fedoraproject.org/archives/list/lnst-developers@lists.fedoraho...
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe RoundRobinDoubleBondRecipe, implementing old regression_tests/phase1/round_robin_double_bond.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/RoundRobinDoubleBondRecipe.py | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py
diff --git a/lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py b/lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py new file mode 100644 index 0000000..25ef52f --- /dev/null +++ b/lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py @@ -0,0 +1,67 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(round_robin_double_bond.xml + bonding_test.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 BondDevice + +class RoundRobinDoubleBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + m1.eth1 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + m2.eth1 = DeviceReq(label="net1") + + 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"))) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + for i, m in [(1, m1),(2, m2)]: + m.bond = BondDevice(mode="active-backup", name="bond_m"+str(i)) + m.eth0.down() + m.eth1.down() + m.bond.slave_add(m.eth0) + m.bond.slave_add(m.eth1) + + configuration = EnrtConfiguration() + configuration.endpoint1 = m1.bond + configuration.endpoint2 = m2.bond + + if "mtu" in self.params: + m1.bond.mtu = self.params.mtu + m2.bond.mtu = self.params.mtu + + net_addr = "192.168.101" + net_addr6 = "fc00:0:0:0" + for i, m in [(1, m1),(2, m2)]: + m.bond.ip_add(ipaddress(net_addr + "." + str(i) + "/24")) + m.bond.ip_add(ipaddress(net_addr6 + "::" + str(i) + "/64")) + m.eth0.up() + m.eth1.up() + m.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")
Tue, Aug 21, 2018 at 02:11:09PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe RoundRobinDoubleBondRecipe, implementing old regression_tests/phase1/round_robin_double_bond.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/RoundRobinDoubleBondRecipe.py | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py
diff --git a/lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py b/lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py new file mode 100644 index 0000000..25ef52f --- /dev/null +++ b/lnst/Recipes/ENRT/RoundRobinDoubleBondRecipe.py @@ -0,0 +1,67 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(round_robin_double_bond.xml + bonding_test.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 BondDevice
+class RoundRobinDoubleBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- m2.eth1 = DeviceReq(label="net1")
- 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")))
- def test_wide_configuration(self):
m1, m2 = self.matched.m1, self.matched.m2
for i, m in [(1, m1),(2, m2)]:
m.bond = BondDevice(mode="active-backup", name="bond_m"+str(i))
So, there's a bug here. mode should be "balance-rr".
m.eth0.down()
m.eth1.down()
m.bond.slave_add(m.eth0)
m.bond.slave_add(m.eth1)
configuration = EnrtConfiguration()
configuration.endpoint1 = m1.bond
configuration.endpoint2 = m2.bond
if "mtu" in self.params:
m1.bond.mtu = self.params.mtu
m2.bond.mtu = self.params.mtu
net_addr = "192.168.101"
net_addr6 = "fc00:0:0:0"
for i, m in [(1, m1),(2, m2)]:
m.bond.ip_add(ipaddress(net_addr + "." + str(i) + "/24"))
m.bond.ip_add(ipaddress(net_addr6 + "::" + str(i) + "/64"))
m.eth0.up()
m.eth1.up()
m.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")
-- 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.fedoraproject.org/archives/list/lnst-developers@lists.fedoraho...
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe PingFloodRecipe, implementing old regression_tests/phase1/ping_flood.xml. Its PingFloodRecipe class is an immediate subclass of BaseRecipe. It is almost identical to examples/python_recipe.py.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/PingFloodRecipe.py | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lnst/Recipes/ENRT/PingFloodRecipe.py
diff --git a/lnst/Recipes/ENRT/PingFloodRecipe.py b/lnst/Recipes/ENRT/PingFloodRecipe.py new file mode 100644 index 0000000..05be74d --- /dev/null +++ b/lnst/Recipes/ENRT/PingFloodRecipe.py @@ -0,0 +1,33 @@ +#!/bin/python2 +""" +Implements scenario similar to regression_tests/phase1/ +(ping_flood.xml + simple_ping.py) +""" + +from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq, BaseRecipe +from lnst.Tests import Ping + +class PingFloodRecipe(BaseRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + + def test(self): + #m1, m2 = self.matched.m1, self.matched.m2 + + self.matched.m1.eth0.ip_add(ipaddress("192.168.1.1/24")) + self.matched.m2.eth0.ip_add(ipaddress("192.168.1.2/24")) + + if "mtu" in self.params: + self.matched.m1.eth0.mtu = self.params.mtu + self.matched.m2.eth0.mtu = self.params.mtu + + self.matched.m1.eth0.up() + self.matched.m2.eth0.up() + + ping_job = self.matched.m1.run(Ping(dst=self.matched.m2.eth0.ips[0], interval=0, + interface=self.matched.m1.eth0))
Tue, Aug 21, 2018 at 02:11:10PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe PingFloodRecipe, implementing old regression_tests/phase1/ping_flood.xml. Its PingFloodRecipe class is an immediate subclass of BaseRecipe. It is almost identical to examples/python_recipe.py.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/PingFloodRecipe.py | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lnst/Recipes/ENRT/PingFloodRecipe.py
diff --git a/lnst/Recipes/ENRT/PingFloodRecipe.py b/lnst/Recipes/ENRT/PingFloodRecipe.py new file mode 100644 index 0000000..05be74d --- /dev/null +++ b/lnst/Recipes/ENRT/PingFloodRecipe.py @@ -0,0 +1,33 @@ +#!/bin/python2 +""" +Implements scenario similar to regression_tests/phase1/ +(ping_flood.xml + simple_ping.py) +"""
+from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq, BaseRecipe +from lnst.Tests import Ping
+class PingFloodRecipe(BaseRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- def test(self):
#m1, m2 = self.matched.m1, self.matched.m2
^^^^ this should not be commented out, right?
self.matched.m1.eth0.ip_add(ipaddress("192.168.1.1/24"))
self.matched.m2.eth0.ip_add(ipaddress("192.168.1.2/24"))
if "mtu" in self.params:
self.matched.m1.eth0.mtu = self.params.mtu
self.matched.m2.eth0.mtu = self.params.mtu
self.matched.m1.eth0.up()
self.matched.m2.eth0.up()
ping_job = self.matched.m1.run(Ping(dst=self.matched.m2.eth0.ips[0], interval=0,
interface=self.matched.m1.eth0))
I think we want interval=0.2 as the original test. Also the original test used count=100 and with the above we would do only count defined by default value of 10.
-Jan
On Wed, Aug 22, 2018 at 01:38:05PM +0200, Jan Tluka wrote:
Tue, Aug 21, 2018 at 02:11:10PM CEST, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe PingFloodRecipe, implementing old regression_tests/phase1/ping_flood.xml. Its PingFloodRecipe class is an immediate subclass of BaseRecipe. It is almost identical to examples/python_recipe.py.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/PingFloodRecipe.py | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lnst/Recipes/ENRT/PingFloodRecipe.py
diff --git a/lnst/Recipes/ENRT/PingFloodRecipe.py b/lnst/Recipes/ENRT/PingFloodRecipe.py new file mode 100644 index 0000000..05be74d --- /dev/null +++ b/lnst/Recipes/ENRT/PingFloodRecipe.py @@ -0,0 +1,33 @@ +#!/bin/python2 +""" +Implements scenario similar to regression_tests/phase1/ +(ping_flood.xml + simple_ping.py) +"""
+from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq, BaseRecipe +from lnst.Tests import Ping
+class PingFloodRecipe(BaseRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- def test(self):
#m1, m2 = self.matched.m1, self.matched.m2
^^^^ this should not be commented out, right?
self.matched.m1.eth0.ip_add(ipaddress("192.168.1.1/24"))
self.matched.m2.eth0.ip_add(ipaddress("192.168.1.2/24"))
if "mtu" in self.params:
self.matched.m1.eth0.mtu = self.params.mtu
self.matched.m2.eth0.mtu = self.params.mtu
self.matched.m1.eth0.up()
self.matched.m2.eth0.up()
ping_job = self.matched.m1.run(Ping(dst=self.matched.m2.eth0.ips[0], interval=0,
interface=self.matched.m1.eth0))
I think we want interval=0.2 as the original test. Also the original test used count=100 and with the above we would do only count defined by default value of 10.
Agreed, this recipe should also probably just inherit from the PingTestAndEvaluate "common recipe template" that BaseEnrtRecipe inherits from so that we can at least have consistent result reporting. I want to view Test modules as just "execute and return data about what was executed" and the PASS/FAIL should be an evaluation done outside of the Test module - currently in the *TestAndEvaluate classes...
The PingConf class that the PingTestAndEvaluate class uses doesn't define the count and interval properties yet, but that's also a part of my own patch set so if this patch set gets applied on top of that then we can work that in.
-Ondrej
From: Christos Sfakianakis csfakian@redhat.com
Adding ported recipe VirtualBridgeVlanInGuestRecipe, implementing old regression_tests/phase1/virtual_bridge_vlan_in_guest.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/VirtualBridgeVlanInGuestRecipe.py | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py new file mode 100644 index 0000000..0403d50 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestRecipe.py @@ -0,0 +1,90 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_vlan_in_guest.xml + virtual_bridge_vlan_in_guest.py) +""" +from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration +from lnst.Devices import VlanDevice +from lnst.Devices import BridgeDevice + +class VirtualBridgeVlanInGuestRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.nic = DeviceReq(label="to_switch") + m1.tap = DeviceReq(label="to_guest") + + m2 = HostReq() + m2.nic = DeviceReq(label="to_switch") + + m3 = HostReq() + m3.guestnic = 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): + m1, m2, m3 = self.matched.m1, self.matched.m2, self.matched.m3 + + m1.nic.down() + m1.tap.down() + m1.br0 = BridgeDevice() + m1.br0.slave_add(m1.nic) + m1.br0.slave_add(m1.tap) + + m2.nic.down() + m2.vlan1 = VlanDevice(realdev=m2.nic, vlan_id=10) + + m3.guestnic.down() + m3.vlan1 = VlanDevice(realdev=m3.guestnic, vlan_id=10) + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + configuration = EnrtConfiguration() + configuration.endpoint1 = m3.vlan1 + configuration.endpoint2 = m2.vlan1 + + if "mtu" in self.params: + m1.br0.mtu = self.params.mtu + m2.vlan1.mtu = self.params.mtu + m3.vlan1.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr6_1 = "fc00:0:0:1" + + m1.br0.ip_add(ipaddress(net_addr_1 + ".1/24")) + m2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24")) + m2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64")) + m3.vlan1.ip_add(ipaddress(net_addr_1 + ".3/24")) + m3.vlan1.ip_add(ipaddress(net_addr6_1 + "::3/64")) + + m1.nic.up() + m1.tap.up() + m1.br0.up() + m2.nic.up() + m2.vlan1.up() + m3.guestnic.up() + m3.vlan1.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.run("service irqbalance stop") + m3.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, m3 = self.matched.m1, self.matched.m2, self.matched.m3 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start") + m3.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualBridgeVlanInGuestMirroredRecipe, implementing old regression_tests/phase1/virtual_bridge_vlan_in_guest_mirrored.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../VirtualBridgeVlanInGuestMirroredRecipe.py | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py new file mode 100644 index 0000000..7851a22 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInGuestMirroredRecipe.py @@ -0,0 +1,107 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_vlan_in_guest_mirrored.xml + virtual_bridge_vlan_in_guest_mirrored.py) +""" +from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration +from lnst.Devices import VlanDevice +from lnst.Devices import BridgeDevice + +class VirtualBridgeVlanInGuestMirroredRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.nic = DeviceReq(label="to_switch") + m1.tap = DeviceReq(label="to_guest1") + + m2 = HostReq() + m2.nic = DeviceReq(label="to_switch") + m2.tap = DeviceReq(label="to_guest2") + + m3 = HostReq() + m3.guestnic = DeviceReq(label="to_guest1") + + m4 = HostReq() + m4.guestnic = 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): + m1, m2, m3, m4 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4 + + m1.nic.down() + m1.tap.down() + m1.br0 = BridgeDevice() + m1.br0.slave_add(m1.nic) + m1.br0.slave_add(m1.tap) + + m2.nic.down() + m2.tap.down() + m2.br0 = BridgeDevice() + m2.br0.slave_add(m2.nic) + m2.br0.slave_add(m2.tap) + + m3.guestnic.down() + m3.vlan1 = VlanDevice(realdev=m3.guestnic, vlan_id=10) + + m4.guestnic.down() + m4.vlan1 = VlanDevice(realdev=m4.guestnic, vlan_id=10) + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + configuration = EnrtConfiguration() + configuration.endpoint1 = m3.vlan1 + configuration.endpoint2 = m4.vlan1 + + if "mtu" in self.params: + m1.br0.mtu = self.params.mtu + m2.br0.mtu = self.params.mtu + m3.vlan1.mtu = self.params.mtu + m4.vlan1.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr6_1 = "fc00:0:0:1" + + m1.br0.ip_add(ipaddress(net_addr_1 + ".1/24")) + m2.br0.ip_add(ipaddress(net_addr_1 + ".2/24")) + m3.vlan1.ip_add(ipaddress(net_addr_1 + ".3/24")) + m3.vlan1.ip_add(ipaddress(net_addr6_1 + "::3/64")) + m4.vlan1.ip_add(ipaddress(net_addr_1 + ".4/24")) + m4.vlan1.ip_add(ipaddress(net_addr6_1 + "::4/64")) + + m1.nic.up() + m1.tap.up() + m1.br0.up() + m2.nic.up() + m2.tap.up() + m2.br0.up() + m3.guestnic.up() + m3.vlan1.up() + m4.guestnic.up() + m4.vlan1.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.run("service irqbalance stop") + m3.run("service irqbalance stop") + m4.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, m3, m4 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start") + m3.run("service irqbalance start") + m4.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualBridgeVlanInHostMirroredRecipe, implementing old regression_tests/phase1/virtual_bridge_vlan_in_host_mirrored.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../VirtualBridgeVlanInHostMirroredRecipe.py | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py new file mode 100644 index 0000000..4f054a1 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostMirroredRecipe.py @@ -0,0 +1,105 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_vlan_in_host_mirrored.xml + virtual_bridge_vlan_in_host_mirrored.py) +""" +from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration +from lnst.Devices import VlanDevice +from lnst.Devices import BridgeDevice + +class VirtualBridgeVlanInHostMirroredRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.nic = DeviceReq(label="to_switch") + m1.tap = DeviceReq(label="to_guest1") + + m2 = HostReq() + m2.nic = DeviceReq(label="to_switch") + m2.tap = DeviceReq(label="to_guest2") + + m3 = HostReq() + m3.guestnic = DeviceReq(label="to_guest1") + + m4 = HostReq() + m4.guestnic = 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): + m1, m2, m3, m4 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4 + + m1.nic.down() + m1.tap.down() + m1.vlan1 = VlanDevice(realdev=m1.nic, vlan_id=10) + m1.br0 = BridgeDevice() + m1.br0.slave_add(m1.vlan1) + m1.br0.slave_add(m1.tap) + + m2.nic.down() + m2.tap.down() + m2.vlan1 = VlanDevice(realdev=m2.nic, vlan_id=10) + m2.br0 = BridgeDevice() + m2.br0.slave_add(m2.vlan1) + m2.br0.slave_add(m2.tap) + + m3.guestnic.down() + + m4.guestnic.down() + + configuration = EnrtConfiguration() + configuration.endpoint1 = m3.guestnic + configuration.endpoint2 = m4.guestnic + + if "mtu" in self.params: + m1.br0.mtu = self.params.mtu + m2.br0.mtu = self.params.mtu + m3.guestnic.mtu = self.params.mtu + m4.guestnic.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr6_1 = "fc00:0:0:1" + + m1.br0.ip_add(ipaddress(net_addr_1 + ".1/24")) + m2.br0.ip_add(ipaddress(net_addr_1 + ".2/24")) + m3.guestnic.ip_add(ipaddress(net_addr_1 + ".3/24")) + m3.guestnic.ip_add(ipaddress(net_addr6_1 + "::3/64")) + m4.guestnic.ip_add(ipaddress(net_addr_1 + ".4/24")) + m4.guestnic.ip_add(ipaddress(net_addr6_1 + "::4/64")) + + m1.nic.up() + m1.tap.up() + m1.vlan1.up() + m1.br0.up() + m2.nic.up() + m2.tap.up() + m2.vlan1.up() + m2.br0.up() + m3.guestnic.up() + m4.guestnic.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.run("service irqbalance stop") + m3.run("service irqbalance stop") + m4.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, m3, m4 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start") + m3.run("service irqbalance start") + m4.run("service irqbalance start")
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualBridgeVlanInHostRecipe, implementing old regression_tests/phase1/virtual_bridge_vlan_in_host.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/VirtualBridgeVlanInHostRecipe.py | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py new file mode 100644 index 0000000..ada9408 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py @@ -0,0 +1,88 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_vlan_in_host.xml + virtual_bridge_vlan_in_host.py) +""" +from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration +from lnst.Devices import VlanDevice +from lnst.Devices import BridgeDevice + +class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.nic = DeviceReq(label="to_switch") + m1.tap = DeviceReq(label="to_guest") + + m2 = HostReq() + m2.nic = DeviceReq(label="to_switch") + + m3 = HostReq() + m3.guestnic = 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): + m1, m2, m3 = self.matched.m1, self.matched.m2, self.matched.m3 + + m1.nic.down() + m1.tap.down() + m1.vlan1 = VlanDevice(realdev=m1.nic, vlan_id=10) + m1.br0 = BridgeDevice() + m1.br0.slave_add(m1.vlan1) + m1.br0.slave_add(m1.tap) + + m2.nic.down() + m2.vlan1 = VlanDevice(realdev=m2.nic, vlan_id=10) + + m3.guestnic.down() + + configuration = EnrtConfiguration() + configuration.endpoint1 = m3.guestnic + configuration.endpoint2 = m2.vlan1 + + if "mtu" in self.params: + m1.br0.mtu = self.params.mtu + m2.vlan1.mtu = self.params.mtu + m3.guestnic.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr6_1 = "fc00:0:0:1" + + m1.br0.ip_add(ipaddress(net_addr_1 + ".1/24")) + m2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24")) + m2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64")) + m3.guestnic.ip_add(ipaddress(net_addr_1 + ".3/24")) + m3.guestnic.ip_add(ipaddress(net_addr6_1 + "::3/64")) + + m1.nic.up() + m1.tap.up() + m1.vlan1.up() + m1.br0.up() + m2.nic.up() + m2.vlan1.up() + m3.guestnic.up() + + #TODO better service handling through HostAPI + m1.run("service irqbalance stop") + m2.run("service irqbalance stop") + m3.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, m3 = self.matched.m1, self.matched.m2, self.matched.m3 + + #TODO better service handling through HostAPI + m1.run("service irqbalance start") + m2.run("service irqbalance start") + m3.run("service irqbalance start")
On Tue, Aug 21, 2018 at 02:11:14PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualBridgeVlanInHostRecipe, implementing old regression_tests/phase1/virtual_bridge_vlan_in_host.xml. Its structure is based on previously ported SimplePerfRecipe.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py new file mode 100644 index 0000000..ada9408 --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridgeVlanInHostRecipe.py @@ -0,0 +1,88 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_vlan_in_host.xml + virtual_bridge_vlan_in_host.py) +""" +from lnst.Common.Parameters import Param +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration +from lnst.Devices import VlanDevice +from lnst.Devices import BridgeDevice
+class VirtualBridgeVlanInHostRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.nic = DeviceReq(label="to_switch")
- m1.tap = DeviceReq(label="to_guest")
- m2 = HostReq()
- m2.nic = DeviceReq(label="to_switch")
- m3 = HostReq()
- m3.guestnic = 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):
m1, m2, m3 = self.matched.m1, self.matched.m2, self.matched.m3
m1.nic.down()
m1.tap.down()
m1.vlan1 = VlanDevice(realdev=m1.nic, vlan_id=10)
m1.br0 = BridgeDevice()
m1.br0.slave_add(m1.vlan1)
m1.br0.slave_add(m1.tap)
m2.nic.down()
m2.vlan1 = VlanDevice(realdev=m2.nic, vlan_id=10)
m3.guestnic.down()
configuration = EnrtConfiguration()
configuration.endpoint1 = m3.guestnic
configuration.endpoint2 = m2.vlan1
if "mtu" in self.params:
m1.br0.mtu = self.params.mtu
m2.vlan1.mtu = self.params.mtu
m3.guestnic.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr6_1 = "fc00:0:0:1"
m1.br0.ip_add(ipaddress(net_addr_1 + ".1/24"))
m2.vlan1.ip_add(ipaddress(net_addr_1 + ".2/24"))
m2.vlan1.ip_add(ipaddress(net_addr6_1 + "::2/64"))
m3.guestnic.ip_add(ipaddress(net_addr_1 + ".3/24"))
m3.guestnic.ip_add(ipaddress(net_addr6_1 + "::3/64"))
m1.nic.up()
m1.tap.up()
m1.vlan1.up()
m1.br0.up()
m2.nic.up()
m2.vlan1.up()
m3.guestnic.up()
#TODO better service handling through HostAPI
m1.run("service irqbalance stop")
m2.run("service irqbalance stop")
m3.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, m3 = self.matched.m1, self.matched.m2, self.matched.m3
#TODO better service handling through HostAPI
m1.run("service irqbalance start")
m2.run("service irqbalance start")
m3.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.fedoraproject.org/archives/list/lnst-developers@lists.fedoraho...
These VirtualBridge* are ok except for the naming used. It directly follows the ids that we've used in the old xmls but here I think it could be improved.
Instead of having m1, m2, m3, m4. host1, guest1, host2, guest2 would be easier to understand.
Also the guestnic/nic/tap should just be replaced with eth0 to be consistent with the previous recipes. It should be obvious which eth is using which driver based on either a driver parameter that we'll add later or based on the topology described by the "label" attributes.
-Ondrej
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe Vlans3OverActiveBackupBondRecipe, implementing old regression_tests/phase1/3_vlans_over_active_backup_bond.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/Vlans3OverActiveBackupBondRecipe.py | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 lnst/Recipes/ENRT/Vlans3OverActiveBackupBondRecipe.py
diff --git a/lnst/Recipes/ENRT/Vlans3OverActiveBackupBondRecipe.py b/lnst/Recipes/ENRT/Vlans3OverActiveBackupBondRecipe.py new file mode 100644 index 0000000..564fae6 --- /dev/null +++ b/lnst/Recipes/ENRT/Vlans3OverActiveBackupBondRecipe.py @@ -0,0 +1,92 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(3_vlans_over_active_backup_bond.xml + 3_vlans_over_bond.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 BondDevice + +class Vlans3OverActiveBackupBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + m1.eth1 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + + 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"))) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.bond0 = BondDevice(mode="active-backup", name="my_bond0") + m1.eth0.down() + m1.eth1.down() + m1.bond0.slave_add(m1.eth0) + m1.bond0.slave_add(m1.eth1) + m1.vlan1 = VlanDevice(realdev=m1.bond0, vlan_id=10) + m1.vlan2 = VlanDevice(realdev=m1.bond0, vlan_id=20) + m1.vlan3 = VlanDevice(realdev=m1.bond0, vlan_id=30) + + m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10) + m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20) + m2.vlan3 = VlanDevice(realdev=m2.eth0, vlan_id=30) + + #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: + m1.bond0.mtu = self.params.mtu + m2.eth0.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr_2 = "192.168.20" + net_addr_3 = "192.168.30" + net_addr6_1 = "fc00:0:0:1" + net_addr6_2 = "fc00:0:0:2" + net_addr6_3 = "fc00:0:0:3" + + for i, m in [(1, m1), (2, m2)]: + m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i) + "/24")) + m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i) + "/64")) + m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i) + "/24")) + m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i) + "/64")) + m.vlan3.ip_add(ipaddress(net_addr_3 + "." + str(i) + "/24")) + m.vlan3.ip_add(ipaddress(net_addr6_3 + "::" + str(i) + "/64")) + + m1.eth0.up() + m1.eth1.up() + m1.bond0.up() + m1.vlan1.up() + m1.vlan2.up() + m1.vlan3.up() + m2.eth0.up() + m2.vlan1.up() + m2.vlan2.up() + m2.vlan3.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 Vlans3OverRoundRobinBondRecipe, implementing old regression_tests/phase1/3_vlans_over_round_robin_bond.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/Vlans3OverRoundRobinBondRecipe.py | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py
diff --git a/lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py b/lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py new file mode 100644 index 0000000..c522bac --- /dev/null +++ b/lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py @@ -0,0 +1,92 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(3_vlans_over_round_robin_bond.xml + 3_vlans_over_bond.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 BondDevice + +class Vlans3OverRoundRobinBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + m1.eth1 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + + 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"))) + + def test_wide_configuration(self): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.bond0 = BondDevice(mode="balance-rr", name="my_bond0") + m1.eth0.down() + m1.eth1.down() + m1.bond0.slave_add(m1.eth0) + m1.bond0.slave_add(m1.eth1) + m1.vlan1 = VlanDevice(realdev=m1.bond0, vlan_id=10) + m1.vlan2 = VlanDevice(realdev=m1.bond0, vlan_id=20) + m1.vlan3 = VlanDevice(realdev=m1.bond0, vlan_id=30) + + m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10) + m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20) + m2.vlan3 = VlanDevice(realdev=m2.eth0, vlan_id=30) + + #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: + m1.bond0.mtu = self.params.mtu + m2.eth0.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr_2 = "192.168.20" + net_addr_3 = "192.168.30" + net_addr6_1 = "fc00:0:0:1" + net_addr6_2 = "fc00:0:0:2" + net_addr6_3 = "fc00:0:0:3" + + for i, m in [(1, m1), (2, m2)]: + m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i) + "/24")) + m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i) + "/64")) + m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i) + "/24")) + m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i) + "/64")) + m.vlan3.ip_add(ipaddress(net_addr_3 + "." + str(i) + "/24")) + m.vlan3.ip_add(ipaddress(net_addr6_3 + "::" + str(i) + "/64")) + + m1.eth0.up() + m1.eth1.up() + m1.bond0.up() + m1.vlan1.up() + m1.vlan2.up() + m1.vlan3.up() + m2.eth0.up() + m2.vlan1.up() + m2.vlan2.up() + m2.vlan3.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")
On Tue, Aug 21, 2018 at 02:11:16PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe Vlans3OverRoundRobinBondRecipe, implementing old regression_tests/phase1/3_vlans_over_round_robin_bond.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/Vlans3OverRoundRobinBondRecipe.py | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py
diff --git a/lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py b/lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py new file mode 100644 index 0000000..c522bac --- /dev/null +++ b/lnst/Recipes/ENRT/Vlans3OverRoundRobinBondRecipe.py @@ -0,0 +1,92 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(3_vlans_over_round_robin_bond.xml + 3_vlans_over_bond.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 BondDevice
+class Vlans3OverRoundRobinBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m1.eth1 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- 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")))
- def test_wide_configuration(self):
m1, m2 = self.matched.m1, self.matched.m2
m1.bond0 = BondDevice(mode="balance-rr", name="my_bond0")
m1.eth0.down()
m1.eth1.down()
m1.bond0.slave_add(m1.eth0)
m1.bond0.slave_add(m1.eth1)
m1.vlan1 = VlanDevice(realdev=m1.bond0, vlan_id=10)
m1.vlan2 = VlanDevice(realdev=m1.bond0, vlan_id=20)
m1.vlan3 = VlanDevice(realdev=m1.bond0, vlan_id=30)
m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10)
m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20)
m2.vlan3 = VlanDevice(realdev=m2.eth0, vlan_id=30)
#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:
m1.bond0.mtu = self.params.mtu
m2.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
net_addr_3 = "192.168.30"
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
net_addr6_3 = "fc00:0:0:3"
for i, m in [(1, m1), (2, m2)]:
m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i) + "/24"))
m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i) + "/64"))
m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i) + "/24"))
m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i) + "/64"))
m.vlan3.ip_add(ipaddress(net_addr_3 + "." + str(i) + "/24"))
m.vlan3.ip_add(ipaddress(net_addr6_3 + "::" + str(i) + "/64"))
m1.eth0.up()
m1.eth1.up()
m1.bond0.up()
m1.vlan1.up()
m1.vlan2.up()
m1.vlan3.up()
m2.eth0.up()
m2.vlan1.up()
m2.vlan2.up()
m2.vlan3.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")
Same as for the ActiveBackupBond vs RoundRobinBond recipes - the only difference is the bonding mode, so make that a parameter instead and remove one of the recipes.
And it's also missing the miimon parameter.
Finally I'm not sure we really need 3 vlans, we might be ok with just 2.
I also think it's then ok to rename the recipes to VlansOverBondRecipe and don't include the '3' or '2' in the name...
-Ondrej
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe Vlans3Recipe, implementing old regression_tests/phase1/3_vlans.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/Vlans3Recipe.py | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 lnst/Recipes/ENRT/Vlans3Recipe.py
diff --git a/lnst/Recipes/ENRT/Vlans3Recipe.py b/lnst/Recipes/ENRT/Vlans3Recipe.py new file mode 100644 index 0000000..a547498 --- /dev/null +++ b/lnst/Recipes/ENRT/Vlans3Recipe.py @@ -0,0 +1,85 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(3_vlans.xml + 3_vlans.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 + +class Vlans3Recipe(BaseEnrtRecipe): + m1 = HostReq() + m1.eth0 = DeviceReq(label="net1") + + m2 = HostReq() + m2.eth0 = DeviceReq(label="net1") + + 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): + m1, m2 = self.matched.m1, self.matched.m2 + + m1.eth0.down() + m1.vlan1 = VlanDevice(realdev=m1.eth0, vlan_id=10) + m1.vlan2 = VlanDevice(realdev=m1.eth0, vlan_id=20) + m1.vlan3 = VlanDevice(realdev=m1.eth0, vlan_id=30) + + m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10) + m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20) + m2.vlan3 = VlanDevice(realdev=m2.eth0, vlan_id=30) + + #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: + m1.eth0.mtu = self.params.mtu + m2.eth0.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr_2 = "192.168.20" + net_addr_3 = "192.168.30" + net_addr6_1 = "fc00:0:0:1" + net_addr6_2 = "fc00:0:0:2" + net_addr6_3 = "fc00:0:0:3" + + for i, m in [(1, m1), (2, m2)]: + m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i) + "/24")) + m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i) + "/64")) + m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i) + "/24")) + m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i) + "/64")) + m.vlan3.ip_add(ipaddress(net_addr_3 + "." + str(i) + "/24")) + m.vlan3.ip_add(ipaddress(net_addr6_3 + "::" + str(i) + "/64")) + + m1.eth0.up() + m1.vlan1.up() + m1.vlan2.up() + m1.vlan3.up() + m2.eth0.up() + m2.vlan1.up() + m2.vlan2.up() + m2.vlan3.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")
On Tue, Aug 21, 2018 at 02:11:17PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe Vlans3Recipe, implementing old regression_tests/phase1/3_vlans.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
lnst/Recipes/ENRT/Vlans3Recipe.py | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 lnst/Recipes/ENRT/Vlans3Recipe.py
diff --git a/lnst/Recipes/ENRT/Vlans3Recipe.py b/lnst/Recipes/ENRT/Vlans3Recipe.py new file mode 100644 index 0000000..a547498 --- /dev/null +++ b/lnst/Recipes/ENRT/Vlans3Recipe.py @@ -0,0 +1,85 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(3_vlans.xml + 3_vlans.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
+class Vlans3Recipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.eth0 = DeviceReq(label="net1")
- m2 = HostReq()
- m2.eth0 = DeviceReq(label="net1")
- 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):
m1, m2 = self.matched.m1, self.matched.m2
m1.eth0.down()
m1.vlan1 = VlanDevice(realdev=m1.eth0, vlan_id=10)
m1.vlan2 = VlanDevice(realdev=m1.eth0, vlan_id=20)
m1.vlan3 = VlanDevice(realdev=m1.eth0, vlan_id=30)
m2.vlan1 = VlanDevice(realdev=m2.eth0, vlan_id=10)
m2.vlan2 = VlanDevice(realdev=m2.eth0, vlan_id=20)
m2.vlan3 = VlanDevice(realdev=m2.eth0, vlan_id=30)
#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:
m1.eth0.mtu = self.params.mtu
m2.eth0.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
net_addr_3 = "192.168.30"
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
net_addr6_3 = "fc00:0:0:3"
for i, m in [(1, m1), (2, m2)]:
m.vlan1.ip_add(ipaddress(net_addr_1 + "." + str(i) + "/24"))
m.vlan1.ip_add(ipaddress(net_addr6_1 + "::" + str(i) + "/64"))
m.vlan2.ip_add(ipaddress(net_addr_2 + "." + str(i) + "/24"))
m.vlan2.ip_add(ipaddress(net_addr6_2 + "::" + str(i) + "/64"))
m.vlan3.ip_add(ipaddress(net_addr_3 + "." + str(i) + "/24"))
m.vlan3.ip_add(ipaddress(net_addr6_3 + "::" + str(i) + "/64"))
m1.eth0.up()
m1.vlan1.up()
m1.vlan2.up()
m1.vlan3.up()
m2.eth0.up()
m2.vlan1.up()
m2.vlan2.up()
m2.vlan3.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")
Same as for the VlanOverBonding case, I think we'll be ok with just 2 vlans and not having the number in the recipe name.
-Ondrej
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualBridge2VlansOverBondRecipe, implementing old regr_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- .../ENRT/VirtualBridge2VlansOverBondRecipe.py | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py new file mode 100644 index 0000000..7ec3d0e --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py @@ -0,0 +1,125 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_2_vlans_over_active_backup_bond.xml + virtual_bridge_2_vlans_over_bond.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 BondDevice +from lnst.Devices import BridgeDevice + +class VirtualBridge2VlansOverBondRecipe(BaseEnrtRecipe): + m1 = HostReq() + m1.nic1 = DeviceReq(label="to_switch") + m1.nic2 = DeviceReq(label="to_switch") + m1.tap1 = DeviceReq(label="to_guest1") + m1.tap2 = DeviceReq(label="to_guest2") + + m2 = HostReq() + m2.nic1 = DeviceReq(label="to_switch") + m2.nic2 = DeviceReq(label="to_switch") + m2.tap1 = DeviceReq(label="to_guest3") + m2.tap2 = DeviceReq(label="to_guest4") + + m3 = HostReq() + m3.guestnic = DeviceReq(label="to_guest1") + + m4 = HostReq() + m4.guestnic = DeviceReq(label="to_guest2") + + m5 = HostReq() + m5.guestnic = DeviceReq(label="to_guest3") + + m6 = HostReq() + m6.guestnic = 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="on"))) + + def test_wide_configuration(self): + m1, m2, m3, m4, m5, m6 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4, self.matched.m5, self.matched.m6 + + for m, n in [(m1, 10),(m2, 10)]: + m.nic1.down() + m.nic2.down() + m.tap1.down() + m.tap2.down() + m.bond0 = BondDevice(mode="active-backup", name="my_bond0") + m.bond0.slave_add(m.nic1) + m.bond0.slave_add(m.nic2) + m.vlan1 = VlanDevice(realdev=m.bond0, vlan_id=n) + m.vlan2 = VlanDevice(realdev=m.bond0, vlan_id=2*n) + m.br0 = BridgeDevice() + m.br0.slave_add(m.vlan1) + m.br0.slave_add(m.tap1) + m.br1 = BridgeDevice() + m.br1.slave_add(m.vlan2) + m.br1.slave_add(m.tap2) + + for m in (m3, m4, m5, m6): + m.guestnic.down() + + #Due to limitations in the current EnrtConfiguration + #class, a single vlan test pair is chosen + configuration = EnrtConfiguration() + configuration.endpoint1 = m3.guestnic + configuration.endpoint2 = m5.guestnic + + if "mtu" in self.params: + m1.br0.mtu = self.params.mtu + m1.br1.mtu = self.params.mtu + m2.br0.mtu = self.params.mtu + m1.br1.mtu = self.params.mtu + m3.guestnic.mtu = self.params.mtu + m4.guestnic.mtu = self.params.mtu + m5.guestnic.mtu = self.params.mtu + m6.guestnic.mtu = self.params.mtu + + net_addr_1 = "192.168.10" + net_addr_2 = "192.168.20" + net_addr6_1 = "fc00:0:0:1" + net_addr6_2 = "fc00:0:0:2" + + for m, (g1, g2), n in [(m1, (m3, m4), 1), (m2, (m5, m6), 3)]: + m.bond0.ip_add(ipaddress("1.2.3.4")) + m.br0.ip_add(ipaddress(net_addr_1 + "." + str(n) + "/24")) + m.br1.ip_add(ipaddress(net_addr_2 + "." + str(n) + "/24")) + g1.guestnic.ip_add(ipaddress(net_addr_1 + "." + str(n+1) + "/24")) + g1.guestnic.ip_add(ipaddress(net_addr6_1 + "::" + str(n+1) + "/64")) + g2.guestnic.ip_add(ipaddress(net_addr_2 + "." + str(n+1) + "/24")) + g2.guestnic.ip_add(ipaddress(net_addr6_2 + "::" + str(n+1) + "/64")) + + for m, g1, g2 in [(m1, m3, m4), (m2, m5, m6)]: + m.nic1.up() + m.nic2.up() + m.tap1.up() + m.tap2.up() + m.bond0.up() + m.vlan1.up() + m.vlan2.up() + m.br0.up() + m.br1.up() + g1.guestnic.up() + g2.guestnic.up() + + #TODO better service handling through HostAPI + for m in (m1, m2, m3, m4, m5, m6): + m1.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, m3, m4, m5, m6 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4, self.matched.m5, self.matched.m6 + + #TODO better service handling through HostAPI + for m in (m1, m2, m3, m4, m5, m6): + m1.run("service irqbalance start")
On Tue, Aug 21, 2018 at 02:11:18PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ported recipe VirtualBridge2VlansOverBondRecipe, implementing old regr_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml. Its structure is based on previously ported SimplePerfRecipe. Due to limitations in the current EnrtConfiguration class, a single vlan test pair is chosen.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/VirtualBridge2VlansOverBondRecipe.py | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py
diff --git a/lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py new file mode 100644 index 0000000..7ec3d0e --- /dev/null +++ b/lnst/Recipes/ENRT/VirtualBridge2VlansOverBondRecipe.py @@ -0,0 +1,125 @@ +""" +Implements scenario similar to regression_tests/phase1/ +(virtual_bridge_2_vlans_over_active_backup_bond.xml + virtual_bridge_2_vlans_over_bond.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 BondDevice +from lnst.Devices import BridgeDevice
+class VirtualBridge2VlansOverBondRecipe(BaseEnrtRecipe):
- m1 = HostReq()
- m1.nic1 = DeviceReq(label="to_switch")
- m1.nic2 = DeviceReq(label="to_switch")
- m1.tap1 = DeviceReq(label="to_guest1")
- m1.tap2 = DeviceReq(label="to_guest2")
- m2 = HostReq()
- m2.nic1 = DeviceReq(label="to_switch")
- m2.nic2 = DeviceReq(label="to_switch")
- m2.tap1 = DeviceReq(label="to_guest3")
- m2.tap2 = DeviceReq(label="to_guest4")
- m3 = HostReq()
- m3.guestnic = DeviceReq(label="to_guest1")
- m4 = HostReq()
- m4.guestnic = DeviceReq(label="to_guest2")
- m5 = HostReq()
- m5.guestnic = DeviceReq(label="to_guest3")
- m6 = HostReq()
- m6.guestnic = 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="on")))
- def test_wide_configuration(self):
m1, m2, m3, m4, m5, m6 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4, self.matched.m5, self.matched.m6
for m, n in [(m1, 10),(m2, 10)]:
m.nic1.down()
m.nic2.down()
m.tap1.down()
m.tap2.down()
m.bond0 = BondDevice(mode="active-backup", name="my_bond0")
m.bond0.slave_add(m.nic1)
m.bond0.slave_add(m.nic2)
m.vlan1 = VlanDevice(realdev=m.bond0, vlan_id=n)
m.vlan2 = VlanDevice(realdev=m.bond0, vlan_id=2*n)
m.br0 = BridgeDevice()
m.br0.slave_add(m.vlan1)
m.br0.slave_add(m.tap1)
m.br1 = BridgeDevice()
m.br1.slave_add(m.vlan2)
m.br1.slave_add(m.tap2)
for m in (m3, m4, m5, m6):
m.guestnic.down()
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
configuration.endpoint1 = m3.guestnic
configuration.endpoint2 = m5.guestnic
if "mtu" in self.params:
m1.br0.mtu = self.params.mtu
m1.br1.mtu = self.params.mtu
m2.br0.mtu = self.params.mtu
m1.br1.mtu = self.params.mtu
m3.guestnic.mtu = self.params.mtu
m4.guestnic.mtu = self.params.mtu
m5.guestnic.mtu = self.params.mtu
m6.guestnic.mtu = self.params.mtu
net_addr_1 = "192.168.10"
net_addr_2 = "192.168.20"
net_addr6_1 = "fc00:0:0:1"
net_addr6_2 = "fc00:0:0:2"
for m, (g1, g2), n in [(m1, (m3, m4), 1), (m2, (m5, m6), 3)]:
m.bond0.ip_add(ipaddress("1.2.3.4"))
m.br0.ip_add(ipaddress(net_addr_1 + "." + str(n) + "/24"))
m.br1.ip_add(ipaddress(net_addr_2 + "." + str(n) + "/24"))
g1.guestnic.ip_add(ipaddress(net_addr_1 + "." + str(n+1) + "/24"))
g1.guestnic.ip_add(ipaddress(net_addr6_1 + "::" + str(n+1) + "/64"))
g2.guestnic.ip_add(ipaddress(net_addr_2 + "." + str(n+1) + "/24"))
g2.guestnic.ip_add(ipaddress(net_addr6_2 + "::" + str(n+1) + "/64"))
for m, g1, g2 in [(m1, m3, m4), (m2, m5, m6)]:
m.nic1.up()
m.nic2.up()
m.tap1.up()
m.tap2.up()
m.bond0.up()
m.vlan1.up()
m.vlan2.up()
m.br0.up()
m.br1.up()
g1.guestnic.up()
g2.guestnic.up()
#TODO better service handling through HostAPI
for m in (m1, m2, m3, m4, m5, m6):
m1.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, m3, m4, m5, m6 = self.matched.m1, self.matched.m2, self.matched.m3, self.matched.m4, self.matched.m5, self.matched.m6
#TODO better service handling through HostAPI
for m in (m1, m2, m3, m4, m5, m6):
m1.run("service irqbalance start")
Same as for the other VirtualBridge cases just improving the machine and nic names should be ok.
-Ondrej
lnst-developers@lists.fedorahosted.org