From 4b758e374e19774509a5c93726d79dde4744a8bc Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Fri, 10 Apr 2015 06:06:52 +0200 Subject: Initial attempt at configuring from EC2 userdata (with input from cstrahan). Now with VM tests! --- nixos/tests/ec2.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'nixos/tests') diff --git a/nixos/tests/ec2.nix b/nixos/tests/ec2.nix index 7ea9b3d07f72..1296ff4e8e30 100644 --- a/nixos/tests/ec2.nix +++ b/nixos/tests/ec2.nix @@ -62,7 +62,7 @@ let "9ZcDMiWaEhoAR6FGoaGI04ff7CS+1yybQ= snakeoil" ]; in { - bootEc2NixOps = makeEc2Test { + boot-ec2-nixops = makeEc2Test { name = "nixops-userdata"; sshPublicKey = snakeOilPublicKey; # That's right folks! My user's key is also the host key! @@ -93,4 +93,27 @@ in { $machine->shutdown; ''; }; + + boot-ec2-config = makeEc2Test { + name = "config-userdata"; + sshPublicKey = snakeOilPublicKey; + + userData = '' + ### http://nixos.org/channels/nixos-unstable nixos + { + imports = [ + + + ]; + environment.etc.testFile = { + text = "whoa"; + }; + } + ''; + script = '' + $machine->start; + $machine->waitForFile("/etc/testFile"); + $machine->succeed("cat /etc/testFile | grep -q 'whoa'"); + ''; + }; } -- cgit 1.4.1