diff options
author | worldofpeace <worldofpeace@protonmail.ch> | 2020-02-14 14:15:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-14 14:15:21 -0500 |
commit | 2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15 (patch) | |
tree | 98b6cdcb4516f779be1b105ccb001a499770d60f /nixos/tests | |
parent | b2314a6d01ef141edd19e7ed546e23cb59afa739 (diff) | |
parent | 967daec1eee3d1dc44e1b004657cc37de0944b9a (diff) | |
download | nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.tar nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.tar.gz nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.tar.bz2 nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.tar.lz nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.tar.xz nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.tar.zst nixlib-2eb87c0bf7cdf98dd68707a16f9a4b0b3f689e15.zip |
Merge pull request #80049 from tfc/port-docker-containers-test
nixosTests.docker-containers: Port to python
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/docker-containers.nix | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/nixos/tests/docker-containers.nix b/nixos/tests/docker-containers.nix index 9be9bfa80ce0..0e318a52d9f1 100644 --- a/nixos/tests/docker-containers.nix +++ b/nixos/tests/docker-containers.nix @@ -1,30 +1,27 @@ # Test Docker containers as systemd units -import ./make-test.nix ({ pkgs, lib, ... }: - -{ +import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "docker-containers"; meta = { maintainers = with lib.maintainers; [ benley mkaito ]; }; nodes = { - docker = { pkgs, ... }: - { - virtualisation.docker.enable = true; + docker = { pkgs, ... }: { + virtualisation.docker.enable = true; - docker-containers.nginx = { - image = "nginx-container"; - imageFile = pkgs.dockerTools.examples.nginx; - ports = ["8181:80"]; - }; + docker-containers.nginx = { + image = "nginx-container"; + imageFile = pkgs.dockerTools.examples.nginx; + ports = ["8181:80"]; }; + }; }; testScript = '' - startAll; - $docker->waitForUnit("docker-nginx.service"); - $docker->waitForOpenPort(8181); - $docker->waitUntilSucceeds("curl http://localhost:8181|grep Hello"); + start_all() + docker.wait_for_unit("docker-nginx.service") + docker.wait_for_open_port(8181) + docker.wait_until_succeeds("curl http://localhost:8181 | grep Hello") ''; }) |