From b4ac004d09a32160932a22f53c767f3f578051a3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 22 Feb 2022 17:29:41 +0100 Subject: nixos/test/networking: test bonding netdev creation Previously the bonding driver would create an initial `bond0` interface when it was loaded. If the network management integration used that interface and did not recreate it, it was stuck to the default `balance-rr` mode. Deploying systemds modprobe.d configuration sets `max_bonds=0`, so we don't run into that issue anymore. Hence we now make sure that we can indeed create `bond0` with `802.3ad` (LACP), which is a non default mode. --- nixos/tests/networking.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'nixos/tests/networking.nix') diff --git a/nixos/tests/networking.nix b/nixos/tests/networking.nix index 2510937b5dc..2d68bc859df 100644 --- a/nixos/tests/networking.nix +++ b/nixos/tests/networking.nix @@ -246,13 +246,13 @@ let networking = { useNetworkd = networkd; useDHCP = false; - bonds.bond = { + bonds.bond0 = { interfaces = [ "eth1" "eth2" ]; - driverOptions.mode = "balance-rr"; + driverOptions.mode = "802.3ad"; }; interfaces.eth1.ipv4.addresses = mkOverride 0 [ ]; interfaces.eth2.ipv4.addresses = mkOverride 0 [ ]; - interfaces.bond.ipv4.addresses = mkOverride 0 + interfaces.bond0.ipv4.addresses = mkOverride 0 [ { inherit address; prefixLength = 30; } ]; }; }; @@ -274,6 +274,10 @@ let client2.wait_until_succeeds("ping -c 2 192.168.1.1") client2.wait_until_succeeds("ping -c 2 192.168.1.2") + + with subtest("Verify bonding mode"): + for client in client1, client2: + client.succeed('grep -q "Bonding Mode: IEEE 802.3ad Dynamic link aggregation" /proc/net/bonding/bond0') ''; }; bridge = let -- cgit 1.4.1