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")