From 212cc2ebc5342cd6577849634b4ddca38c6c2fab Mon Sep 17 00:00:00 2001 From: Jan Tluka Date: Tue, 29 Oct 2024 13:00:28 +0100 Subject: [PATCH] Recipes/ENRT/BaseLACPRecipe.py: adapt to BondingMixin changes Signed-off-by: Jan Tluka --- lnst/Recipes/ENRT/BaseLACPRecipe.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lnst/Recipes/ENRT/BaseLACPRecipe.py b/lnst/Recipes/ENRT/BaseLACPRecipe.py index c434caa0d..ce747ba88 100644 --- a/lnst/Recipes/ENRT/BaseLACPRecipe.py +++ b/lnst/Recipes/ENRT/BaseLACPRecipe.py @@ -3,7 +3,6 @@ StrParam, DictParam ) -from lnst.Devices import BondDevice from lnst.Common.IpAddress import interface_addresses from lnst.Recipes.ENRT.helpers import ip_endpoint_pairs from lnst.Recipes.ENRT.DoubleBondRecipe import DoubleBondRecipe @@ -44,15 +43,22 @@ def test_wide_configuration(self): ipv4_addr = interface_addresses(self.params.net_ipv4) ipv6_addr = interface_addresses(self.params.net_ipv6) + + self.create_bond_devices( + config, + { + "host1": { + "bond0": [host1.eth0, host1.eth1] + }, + "host2": { + "bond0": [host2.eth0, host2.eth1] + } + } + ) + for host in [host1, host2]: - host.bond0 = BondDevice(mode=self.params.bonding_mode, - miimon=self.params.miimon_value) host.bond0.xmit_hash_policy = "layer2+3" - for dev in [host.eth0, host.eth1]: - dev.down() - host.bond0.slave_add(dev) - config.configure_and_track_ip(host.bond0, next(ipv4_addr)) config.configure_and_track_ip(host.bond0, next(ipv4_addr)) @@ -60,7 +66,7 @@ def test_wide_configuration(self): config.configure_and_track_ip(host.bond0, next(ipv6_addr)) for dev in [host.eth0, host.eth1, host.bond0]: - dev.up() + dev.up_and_wait() self.test_wide_switch_configuration() @@ -78,4 +84,3 @@ def test_wide_deconfiguration(self, config): def generate_perf_endpoints(self, config): return [ip_endpoint_pairs(config, (self.matched.host1.bond0, self.matched.host2.bond0), combination_func=zip)] -