Skip to content

Commit

Permalink
Recipes/ENRT/BaseLACPRecipe.py: adapt to BondingMixin changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Tluka <[email protected]>
  • Loading branch information
jtluka authored and olichtne committed Oct 30, 2024
1 parent b9c990b commit 212cc2e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lnst/Recipes/ENRT/BaseLACPRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -44,23 +43,30 @@ 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))

config.configure_and_track_ip(host.bond0, next(ipv6_addr))
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()

Expand All @@ -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)]

0 comments on commit 212cc2e

Please sign in to comment.