nixosTests.systemd-initrd-networkd: handleTest -> runTest
This commit is contained in:
parent
2fcd5fedf9
commit
dde4a38d69
@ -1364,7 +1364,7 @@ in
|
|||||||
systemd-initrd-luks-tpm2 = runTest ./systemd-initrd-luks-tpm2.nix;
|
systemd-initrd-luks-tpm2 = runTest ./systemd-initrd-luks-tpm2.nix;
|
||||||
systemd-initrd-luks-unl0kr = runTest ./systemd-initrd-luks-unl0kr.nix;
|
systemd-initrd-luks-unl0kr = runTest ./systemd-initrd-luks-unl0kr.nix;
|
||||||
systemd-initrd-modprobe = runTest ./systemd-initrd-modprobe.nix;
|
systemd-initrd-modprobe = runTest ./systemd-initrd-modprobe.nix;
|
||||||
systemd-initrd-networkd = handleTest ./systemd-initrd-networkd.nix { };
|
systemd-initrd-networkd = import ./systemd-initrd-networkd.nix { inherit runTest; };
|
||||||
systemd-initrd-networkd-ssh = runTest ./systemd-initrd-networkd-ssh.nix;
|
systemd-initrd-networkd-ssh = runTest ./systemd-initrd-networkd-ssh.nix;
|
||||||
systemd-initrd-networkd-openvpn = handleTestOn [
|
systemd-initrd-networkd-openvpn = handleTestOn [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
|
@ -1,16 +1,9 @@
|
|||||||
{
|
{ runTest }:
|
||||||
system ? builtins.currentSystem,
|
|
||||||
config ? { },
|
|
||||||
pkgs ? import ../.. { inherit system config; },
|
|
||||||
lib ? pkgs.lib,
|
|
||||||
}:
|
|
||||||
|
|
||||||
with import ../lib/testing-python.nix { inherit system pkgs; };
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib.maintainers) elvishjerricco;
|
common =
|
||||||
|
{ pkgs, ... }:
|
||||||
common = {
|
{
|
||||||
boot.initrd.systemd = {
|
boot.initrd.systemd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
network.wait-online.timeout = 10;
|
network.wait-online.timeout = 10;
|
||||||
@ -29,11 +22,15 @@ let
|
|||||||
|
|
||||||
mkFlushTest =
|
mkFlushTest =
|
||||||
flush: script:
|
flush: script:
|
||||||
makeTest {
|
runTest (
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
name = "systemd-initrd-network-${lib.optionalString (!flush) "no-"}flush";
|
name = "systemd-initrd-network-${lib.optionalString (!flush) "no-"}flush";
|
||||||
meta.maintainers = [ elvishjerricco ];
|
meta.maintainers = with lib.maintainers; [ elvishjerricco ];
|
||||||
|
|
||||||
nodes.machine = {
|
nodes.machine =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
imports = [ common ];
|
imports = [ common ];
|
||||||
|
|
||||||
boot.initrd.network.flushBeforeStage2 = flush;
|
boot.initrd.network.flushBeforeStage2 = flush;
|
||||||
@ -67,13 +64,15 @@ let
|
|||||||
|
|
||||||
machine.wait_for_unit("multi-user.target")
|
machine.wait_for_unit("multi-user.target")
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
basic = makeTest {
|
basic = runTest (
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
name = "systemd-initrd-network";
|
name = "systemd-initrd-network";
|
||||||
meta.maintainers = [ elvishjerricco ];
|
meta.maintainers = with lib.maintainers; [ elvishjerricco ];
|
||||||
|
|
||||||
nodes.machine = common;
|
nodes.machine = common;
|
||||||
|
|
||||||
@ -91,7 +90,8 @@ in
|
|||||||
machine.succeed("ip addr show >&2")
|
machine.succeed("ip addr show >&2")
|
||||||
machine.succeed("ip route show >&2")
|
machine.succeed("ip route show >&2")
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
);
|
||||||
|
|
||||||
doFlush = mkFlushTest true ''
|
doFlush = mkFlushTest true ''
|
||||||
if ip addr | grep 10.0.2.15; then
|
if ip addr | grep 10.0.2.15; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user