2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ...} : {
|
|
|
|
name = "initrd-network";
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
meta.maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nodes.machine = { ... }: {
|
2020-04-24 23:36:52 +00:00
|
|
|
imports = [ ../modules/profiles/minimal.nix ];
|
|
|
|
boot.initrd.network.enable = true;
|
|
|
|
boot.initrd.network.postCommands =
|
|
|
|
''
|
|
|
|
ip addr show
|
|
|
|
ip route show
|
|
|
|
ip addr | grep 10.0.2.15 || exit 1
|
|
|
|
ping -c1 10.0.2.2 || exit 1
|
|
|
|
'';
|
|
|
|
# Check if cleanup was done correctly
|
|
|
|
boot.initrd.postMountCommands = lib.mkAfter
|
|
|
|
''
|
|
|
|
ip addr show
|
|
|
|
ip route show
|
|
|
|
ip addr | grep 10.0.2.15 && exit 1
|
|
|
|
ping -c1 10.0.2.2 && exit 1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
start_all()
|
|
|
|
machine.wait_for_unit("multi-user.target")
|
|
|
|
machine.succeed("ip addr show >&2")
|
|
|
|
machine.succeed("ip route show >&2")
|
|
|
|
'';
|
|
|
|
})
|