Loading nixos/modules/services/networking/dhcpcd.nix +2 −1 Original line number Diff line number Diff line Loading @@ -284,7 +284,8 @@ in [ dhcpcd config.networking.resolvconf.package ] ++ lib.optional cfg.setHostname ( ] ++ lib.optional cfg.setHostname ( pkgs.writeShellScriptBin "hostname" '' ${lib.getExe' pkgs.systemd "hostnamectl"} set-hostname --transient $1 '' Loading nixos/tests/networking/networkd-and-scripted.nix +23 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,29 @@ let router.wait_until_succeeds("ping -c 1 fd00:1234:5678:2::2") ''; }; dhcpHostname = { name = "hostnameDHCP"; nodes.router = router; nodes.client = clientConfig { # use the name given by the DHCP server system.name = "client"; networking.hostName = lib.mkForce ""; security.polkit.enable = true; virtualisation.interfaces.enp1s0.vlan = 1; networking.interfaces.enp1s0.useDHCP = true; }; testScript = '' router.start() router.systemctl("start network-online.target") router.wait_for_unit("network-online.target") client.start() client.wait_for_unit("network.target") with subtest("Wait until we have received the hostname"): client.wait_until_succeeds("hostname | grep -q 'client1'") ''; }; dhcpOneIf = { name = "OneInterfaceDHCP"; nodes.router = router; Loading pkgs/by-name/dh/dhcpcd/package.nix +6 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,12 @@ stdenv.mkDerivation rec { ) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; passthru.tests = { inherit (nixosTests.networking.scripted) macvlan dhcpSimple dhcpOneIf; inherit (nixosTests.networking.scripted) macvlan dhcpSimple dhcpHostname dhcpOneIf ; }; meta = with lib; { Loading Loading
nixos/modules/services/networking/dhcpcd.nix +2 −1 Original line number Diff line number Diff line Loading @@ -284,7 +284,8 @@ in [ dhcpcd config.networking.resolvconf.package ] ++ lib.optional cfg.setHostname ( ] ++ lib.optional cfg.setHostname ( pkgs.writeShellScriptBin "hostname" '' ${lib.getExe' pkgs.systemd "hostnamectl"} set-hostname --transient $1 '' Loading
nixos/tests/networking/networkd-and-scripted.nix +23 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,29 @@ let router.wait_until_succeeds("ping -c 1 fd00:1234:5678:2::2") ''; }; dhcpHostname = { name = "hostnameDHCP"; nodes.router = router; nodes.client = clientConfig { # use the name given by the DHCP server system.name = "client"; networking.hostName = lib.mkForce ""; security.polkit.enable = true; virtualisation.interfaces.enp1s0.vlan = 1; networking.interfaces.enp1s0.useDHCP = true; }; testScript = '' router.start() router.systemctl("start network-online.target") router.wait_for_unit("network-online.target") client.start() client.wait_for_unit("network.target") with subtest("Wait until we have received the hostname"): client.wait_until_succeeds("hostname | grep -q 'client1'") ''; }; dhcpOneIf = { name = "OneInterfaceDHCP"; nodes.router = router; Loading
pkgs/by-name/dh/dhcpcd/package.nix +6 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,12 @@ stdenv.mkDerivation rec { ) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; passthru.tests = { inherit (nixosTests.networking.scripted) macvlan dhcpSimple dhcpOneIf; inherit (nixosTests.networking.scripted) macvlan dhcpSimple dhcpHostname dhcpOneIf ; }; meta = with lib; { Loading