summary refs log tree commit diff
path: root/nixos/tests/ec2.nix
diff options
context:
space:
mode:
authorDan Peebles <pumpkingod@gmail.com>2015-04-10 06:06:52 +0200
committerDan Peebles <pumpkingod@gmail.com>2015-06-11 23:16:35 -0400
commit4b758e374e19774509a5c93726d79dde4744a8bc (patch)
tree2c527e13b109ae8fee67547a604e0f6f86fb42e3 /nixos/tests/ec2.nix
parentf0753327f00940c9274320f41b76766bbf2b21a3 (diff)
downloadnixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.tar
nixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.tar.gz
nixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.tar.bz2
nixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.tar.lz
nixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.tar.xz
nixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.tar.zst
nixpkgs-4b758e374e19774509a5c93726d79dde4744a8bc.zip
Initial attempt at configuring from EC2 userdata (with input from cstrahan). Now with VM tests!
Diffstat (limited to 'nixos/tests/ec2.nix')
-rw-r--r--nixos/tests/ec2.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/nixos/tests/ec2.nix b/nixos/tests/ec2.nix
index 7ea9b3d07f7..1296ff4e8e3 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 = [
+          <nixpkgs/nixos/modules/virtualisation/amazon-image.nix>
+          <nixpkgs/nixos/modules/testing/test-instrumentation.nix>
+        ];
+        environment.etc.testFile = {
+          text = "whoa";
+        };
+      }
+    '';
+    script = ''
+      $machine->start;
+      $machine->waitForFile("/etc/testFile");
+      $machine->succeed("cat /etc/testFile | grep -q 'whoa'");
+    '';
+  };
 }