diff options
author | Jaka Hudoklin <jakahudoklin@gmail.com> | 2014-12-01 17:20:18 +0100 |
---|---|---|
committer | Jaka Hudoklin <jakahudoklin@gmail.com> | 2014-12-01 17:20:35 +0100 |
commit | 40d73c5eb7c9beffea60d34161fd080881760c4a (patch) | |
tree | 5b2e4249f8b328236a62dfaece54e2f79a67f041 /nixos | |
parent | 77049af46f122418114ae9751952282d30695bc3 (diff) |
nixos/docker: fix module, add simple test
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/docker.nix | 4 | ||||
-rw-r--r-- | nixos/release.nix | 1 | ||||
-rw-r--r-- | nixos/tests/docker.nix | 24 |
3 files changed, 27 insertions, 2 deletions
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 9ae9624fd4815..5be76b2682f53 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -7,8 +7,8 @@ with lib; let cfg = config.virtualisation.docker; - pro = config.nix.proxy; - proxy_env = optionalAttrs (pro != "") { Environment = "\"http_proxy=${pro}\""; }; + pro = config.networking.proxy.default; + proxy_env = optionalAttrs (pro != null) { Environment = "\"http_proxy=${pro}\""; }; in diff --git a/nixos/release.nix b/nixos/release.nix index 05d64e1422940..e0530276b6417 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -239,6 +239,7 @@ in rec { tests.chromium = callTest tests/chromium.nix {}; tests.cjdns = callTest tests/cjdns.nix {}; tests.containers = callTest tests/containers.nix {}; + tests.docker = scrubDrv (import tests/docker.nix { system = "x86_64-linux"; }); tests.dockerRegistry = scrubDrv (import tests/docker-registry.nix { system = "x86_64-linux"; }); tests.etcd = scrubDrv (import tests/etcd.nix { system = "x86_64-linux"; }); tests.firefox = callTest tests/firefox.nix {}; diff --git a/nixos/tests/docker.nix b/nixos/tests/docker.nix new file mode 100644 index 0000000000000..63c909ff294c0 --- /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"); + ''; + +} |