summaryrefslogtreecommitdiffstats
path: root/nixos/tests/docker.nix
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2014-12-01 17:20:18 +0100
committerJaka Hudoklin <jakahudoklin@gmail.com>2014-12-01 17:20:35 +0100
commit40d73c5eb7c9beffea60d34161fd080881760c4a (patch)
tree5b2e4249f8b328236a62dfaece54e2f79a67f041 /nixos/tests/docker.nix
parent77049af46f122418114ae9751952282d30695bc3 (diff)
nixos/docker: fix module, add simple test
Diffstat (limited to 'nixos/tests/docker.nix')
-rw-r--r--nixos/tests/docker.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/docker.nix b/nixos/tests/docker.nix
new file mode 100644
index 000000000000..63c909ff294c
--- /dev/null
+++ b/nixos/tests/docker.nix
@@ -0,0 +1,24 @@
+# This test runs docker and checks if simple container starts
+
+import ./make-test.nix {
+ name = "docker";
+
+ nodes = {
+ docker =
+ { config, pkgs, ... }:
+ {
+ virtualisation.docker.enable = true;
+ };
+ };
+
+ testScript = ''
+ startAll;
+
+ $docker->waitForUnit("docker.service");
+ $docker->succeed("tar cv --files-from /dev/null | docker import - scratch");
+ $docker->succeed("docker run -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratch /bin/sleep 10");
+ $docker->succeed("docker ps | grep sleeping");
+ $docker->succeed("docker stop sleeping");
+ '';
+
+}