diff options
| author | tv <tv@krebsco.de> | 2026-11-14 03:26:12 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-14 03:35:25 +0100 |
| commit | 4ed0731ecab446ed0cc4a6146df414a36978e05b (patch) | |
| tree | dff1378fff43036f0970e1f8b5efc40007ac02b1 | |
| parent | 4742c6de2c532e6b1be145a5544d815fc95199b4 (diff) | |
tests: silence network interface warnings
| -rw-r--r-- | pkgs/populate/tests/vm.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/populate/tests/vm.nix b/pkgs/populate/tests/vm.nix index dc599dd..55362f9 100644 --- a/pkgs/populate/tests/vm.nix +++ b/pkgs/populate/tests/vm.nix @@ -29,7 +29,7 @@ let }) scenarios)); - common = { pkgs, ... }: { + common = { config, pkgs, ... }: { imports = [ module ]; # The plan refers to all scripts the scenarios run. Being part of the # system, they survive the scenarios collecting garbage. @@ -52,6 +52,17 @@ let systemd.oomd.enable = false; virtualisation.memorySize = 2048; virtualisation.diskSize = 4096; + networking.useNetworkd = true; + systemd.network.networks = let + qemu-common = import (pkgs.path + "/nixos/lib/qemu-common.nix") { + inherit lib; inherit (pkgs) stdenv; + }; + mac = i: lib.toLower + (qemu-common.qemuNicMac i.vlan config.virtualisation.test.nodeNumber); + in + lib.mapAttrs' (_: i: lib.nameValuePair "40-${i.name}" { + matchConfig = lib.mkForce { PermanentMACAddress = mac i; }; + }) config.virtualisation.allInterfaces; }; in pkgs.testers.runNixOSTest { |
