From 9d984e6eabacd184d05ae4be7131659f932f9707 Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Thu, 29 Feb 2024 04:58:11 +0000 Subject: [PATCH] wip --- facts/inventory.py | 1 + nix/tests/core.nix | 13 ++++++++++++- nix/tests/flake-module.nix | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/facts/inventory.py b/facts/inventory.py index c081ea3e..71e1460a 100755 --- a/facts/inventory.py +++ b/facts/inventory.py @@ -566,6 +566,7 @@ def generatekeaconfig(servers, aps, vlans, outputdir): "id": int(vlan["ipv6prefix"].replace(':', '')[-8:], 16), "user-context": { "vlan": vlan["name"] }, "pools": [{"pool": vlan["ipv6dhcpStart"] + " - " + vlan["ipv6dhcpEnd"]}], + "interface": "eth0", } for vlan in vlans if vlan["ipv6bitmask"] diff --git a/nix/tests/core.nix b/nix/tests/core.nix index 2a82f542..ea14167d 100644 --- a/nix/tests/core.nix +++ b/nix/tests/core.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ inputs, pkgs, ... }: let prefix = "2001:470:f026:103"; routerAddr = { @@ -9,6 +9,15 @@ let ipv6 = "${prefix}::802"; ipv4 = "10.0.3.5"; }; + + dhcp6Sub = inputs.self.packages.${pkgs.system}.scaleInventory.overrideAttrs (oa: { + name = oa.name + "-test"; + postInstall = '' + substituteInPlace $out/config/dhcp6-server.conf \ + --replace "eth0" "eth1" + ''; + }); + in { name = "core"; @@ -58,6 +67,8 @@ in virtualisation.vlans = [ 1 ]; virtualisation.graphics = false; systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug"; + services.kea.dhcp6.configFile = lib.mkForce "${dhcp6Sub}/config/dhcp6-server.conf"; + environment.etc = { "rob/hello".source = "${dhcp6Sub}/config/dhcp6-server.conf"; }; systemd.network = { networks = { "01-eth1" = { diff --git a/nix/tests/flake-module.nix b/nix/tests/flake-module.nix index 25e25100..adf9a6d3 100644 --- a/nix/tests/flake-module.nix +++ b/nix/tests/flake-module.nix @@ -1,8 +1,8 @@ -{ withSystem, inputs, ... }: +{ withSystem, inputs, pkgs, ... }: { flake.checks.x86_64-linux = withSystem "x86_64-linux" ({ pkgs, ... }: { - core = pkgs.testers.runNixOSTest (import ./core.nix { inherit inputs; }); + core = pkgs.testers.runNixOSTest (import ./core.nix { inherit inputs pkgs; }); loghost = pkgs.testers.runNixOSTest ./loghost.nix; });