summary refs log tree commit diff
path: root/nixos/tests/networking.nix
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-02-22 17:29:41 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-02-22 17:29:41 +0100
commitb4ac004d09a32160932a22f53c767f3f578051a3 (patch)
treeaf292f4423f91c28ecef30e96b93a0ec49f695b7 /nixos/tests/networking.nix
parentc2147ab6a88250ed668c1b3e577b8c735f63d054 (diff)
downloadnixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.tar
nixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.tar.gz
nixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.tar.bz2
nixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.tar.lz
nixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.tar.xz
nixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.tar.zst
nixpkgs-b4ac004d09a32160932a22f53c767f3f578051a3.zip
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.
Diffstat (limited to 'nixos/tests/networking.nix')
-rw-r--r--nixos/tests/networking.nix10
1 files changed, 7 insertions, 3 deletions
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