From 0410f5dff9ff952bfe129e522933c4c4ef6b3815 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Mon, 20 Apr 2020 12:01:24 +0200 Subject: [PATCH] nixos/tests: support up to 255 nodes in NixOS tests --- nixos/lib/qemu-flags.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/lib/qemu-flags.nix b/nixos/lib/qemu-flags.nix index 859d9e975fe..b310914d36c 100644 --- a/nixos/lib/qemu-flags.nix +++ b/nixos/lib/qemu-flags.nix @@ -2,7 +2,11 @@ { pkgs }: let - zeroPad = n: if n < 10 then "0${toString n}" else toString n; + zeroPad = n: + pkgs.lib.optionalString (n < 16) "0" + + (if n > 255 + then throw "Can't have more than 255 nets or nodes!" + else pkgs.lib.toHex n); in {