nixos/tests: add simple dockerTools test
This commit is contained in:
parent
ac8a149e07
commit
1545f9062e
@ -244,6 +244,7 @@ in rec {
|
|||||||
tests.containers-macvlans = callTest tests/containers-macvlans.nix {};
|
tests.containers-macvlans = callTest tests/containers-macvlans.nix {};
|
||||||
tests.couchdb = callTest tests/couchdb.nix {};
|
tests.couchdb = callTest tests/couchdb.nix {};
|
||||||
tests.docker = callTestOnTheseSystems ["x86_64-linux"] tests/docker.nix {};
|
tests.docker = callTestOnTheseSystems ["x86_64-linux"] tests/docker.nix {};
|
||||||
|
tests.docker-tools = callTestOnTheseSystems ["x86_64-linux"] tests/docker-tools.nix {};
|
||||||
tests.docker-edge = callTestOnTheseSystems ["x86_64-linux"] tests/docker-edge.nix {};
|
tests.docker-edge = callTestOnTheseSystems ["x86_64-linux"] tests/docker-edge.nix {};
|
||||||
tests.dovecot = callTest tests/dovecot.nix {};
|
tests.dovecot = callTest tests/dovecot.nix {};
|
||||||
tests.dnscrypt-proxy = callTestOnTheseSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
|
tests.dnscrypt-proxy = callTestOnTheseSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
|
||||||
|
36
nixos/tests/docker-tools.nix
Normal file
36
nixos/tests/docker-tools.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# this test creates a simple GNU image with docker tools and sees if it executes
|
||||||
|
|
||||||
|
import ./make-test.nix ({ pkgs, ... }: {
|
||||||
|
name = "docker-tools";
|
||||||
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
|
maintainers = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
docker =
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript =
|
||||||
|
let
|
||||||
|
dockerImage = pkgs.dockerTools.buildImage {
|
||||||
|
name = "hello-docker";
|
||||||
|
contents = [ pkgs.hello ];
|
||||||
|
tag = "sometag";
|
||||||
|
|
||||||
|
# TODO: create another test checking whether runAsRoot works as intended.
|
||||||
|
|
||||||
|
config = {
|
||||||
|
Cmd = [ "hello" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in ''
|
||||||
|
$docker->waitForUnit("sockets.target");
|
||||||
|
$docker->succeed("docker load --input='${dockerImage}'");
|
||||||
|
$docker->succeed("docker run hello-docker:sometag");
|
||||||
|
'';
|
||||||
|
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user