summaryrefslogtreecommitdiffstats
path: root/nixos/tests/docker-containers.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/docker-containers.nix')
-rw-r--r--nixos/tests/docker-containers.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/nixos/tests/docker-containers.nix b/nixos/tests/docker-containers.nix
new file mode 100644
index 000000000000..972552735202
--- /dev/null
+++ b/nixos/tests/docker-containers.nix
@@ -0,0 +1,29 @@
+# Test Docker containers as systemd units
+
+import ./make-test.nix ({ pkgs, lib, ... }: {
+ name = "docker-containers";
+ meta = {
+ maintainers = with lib.maintainers; [ benley ];
+ };
+
+ nodes = {
+ docker = { pkgs, ... }:
+ {
+ virtualisation.docker.enable = true;
+
+ virtualisation.dockerPreloader.images = [ pkgs.dockerTools.examples.nginx ];
+
+ docker-containers.nginx = {
+ image = "nginx-container";
+ ports = ["8181:80"];
+ };
+ };
+ };
+
+ testScript = ''
+ startAll;
+ $docker->waitForUnit("docker-nginx.service");
+ $docker->waitForOpenPort(8181);
+ $docker->waitUntilSucceeds("curl http://localhost:8181|grep Hello");
+ '';
+})