diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-02 19:03:13 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-02 19:59:27 +0100 |
commit | cc925d0506ab2a049d5ee55c1173950073ed307f (patch) | |
tree | 3364d1625f558a4ac3ac9f722a9e65ef293008e3 /nixos/tests/initrd-network.nix | |
parent | 901163c0c707d36323400394bf6e75adc4621e2f (diff) |
boot.initrd.network: Support DHCP
This allows us to use it for EC2 instances.
Diffstat (limited to 'nixos/tests/initrd-network.nix')
-rw-r--r-- | nixos/tests/initrd-network.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/initrd-network.nix b/nixos/tests/initrd-network.nix new file mode 100644 index 0000000000000..db9f572d3c2f6 --- /dev/null +++ b/nixos/tests/initrd-network.nix @@ -0,0 +1,22 @@ +import ./make-test.nix ({ pkgs, ...} : { + name = "initrd-network"; + + meta.maintainers = [ pkgs.stdenv.lib.maintainers.eelco ]; + + machine = { config, pkgs, ... }: { + imports = [ ../modules/profiles/minimal.nix ]; + boot.initrd.network.enable = true; + boot.initrd.network.postCommands = + '' + ip addr | grep 10.0.2.15 || exit 1 + ping -c1 10.0.2.2 || exit 1 + ''; + }; + + testScript = + '' + startAll; + $machine->waitForUnit("multi-user.target"); + $machine->succeed("ip link >&2"); + ''; +}) |