mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
nixosTests.docker-containers: Port to python
This commit is contained in:
parent
21b31c4e51
commit
967daec1ee
@ -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")
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user