From 441c242855f25f336822c7e9f10a366a98b43f02 Mon Sep 17 00:00:00 2001 From: K900 Date: Tue, 21 Jan 2025 13:44:36 +0300 Subject: [PATCH] nixos/tests: fix bonding test --- nixos/tests/networking/networkd-and-scripted.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nixos/tests/networking/networkd-and-scripted.nix b/nixos/tests/networking/networkd-and-scripted.nix index b7ed834f1f66..3f89df818281 100644 --- a/nixos/tests/networking/networkd-and-scripted.nix +++ b/nixos/tests/networking/networkd-and-scripted.nix @@ -238,6 +238,18 @@ let } ]; }; + + # virtio-net reports its speed and duplex as "unknown" by default, + # which confuses the 802.3ad logic. However, you can just tell it + # to pretend to have any link speed with ethtool, so do that. + systemd.services.fake-link-settings = { + path = [ pkgs.ethtool ]; + script = '' + ethtool -s enp1s0 speed 1000 duplex full + ethtool -s enp2s0 speed 1000 duplex full + ''; + wantedBy = [ "network.target" ]; + }; }; in {