From b3e86dc1e942c0173c816cf1690509305ed1f55f Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Wed, 11 Sep 2024 21:49:30 -0700 Subject: [PATCH] nixosTests.systemd-initrd.bridge: fix failing test Since slave interfaces of a bridge cannot be assigned IP addresses, we must prevent IPs from being assigned to them via the test framework modules. Since c6f6c282181d5c6fb8f63d95738b97b09f25c945, all nodes get ipv6 addresses by default, so we must ensure IP addresses of any type don't get assigned to the bridge slave interfaces. --- nixos/tests/systemd-initrd-bridge.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nixos/tests/systemd-initrd-bridge.nix b/nixos/tests/systemd-initrd-bridge.nix index f0c7d5f98f7a..7548787bc18c 100644 --- a/nixos/tests/systemd-initrd-bridge.nix +++ b/nixos/tests/systemd-initrd-bridge.nix @@ -24,20 +24,23 @@ serviceConfig.Type = "oneshot"; }; - networking.primaryIPAddress = "192.168.1.${toString config.virtualisation.test.nodeNumber}"; + networking.primaryIPAddress = lib.mkForce "192.168.1.${toString config.virtualisation.test.nodeNumber}"; + + virtualisation.interfaces.eth1 = { + vlan = 1; + assignIP = false; + }; + virtualisation.interfaces.eth2 = { + vlan = 2; + assignIP = false; + }; - virtualisation.vlans = [ - 1 - 2 - ]; networking.bridges.br0.interfaces = [ "eth1" "eth2" ]; networking.interfaces = { - eth1.ipv4.addresses = lib.mkForce [ ]; - eth2.ipv4.addresses = lib.mkForce [ ]; br0.ipv4.addresses = [ { address = config.networking.primaryIPAddress;