tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/tests: add simple dockerTools test
Profpatsch
8 years ago
1545f906
ac8a149e
+37
2 changed files
expand all
collapse all
unified
split
nixos
release.nix
tests
docker-tools.nix
+1
nixos/release.nix
···
244
244
tests.containers-macvlans = callTest tests/containers-macvlans.nix {};
245
245
tests.couchdb = callTest tests/couchdb.nix {};
246
246
tests.docker = callTestOnTheseSystems ["x86_64-linux"] tests/docker.nix {};
247
247
+
tests.docker-tools = callTestOnTheseSystems ["x86_64-linux"] tests/docker-tools.nix {};
247
248
tests.docker-edge = callTestOnTheseSystems ["x86_64-linux"] tests/docker-edge.nix {};
248
249
tests.dovecot = callTest tests/dovecot.nix {};
249
250
tests.dnscrypt-proxy = callTestOnTheseSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
+36
nixos/tests/docker-tools.nix
···
1
1
+
# this test creates a simple GNU image with docker tools and sees if it executes
2
2
+
3
3
+
import ./make-test.nix ({ pkgs, ... }: {
4
4
+
name = "docker-tools";
5
5
+
meta = with pkgs.stdenv.lib.maintainers; {
6
6
+
maintainers = [ ];
7
7
+
};
8
8
+
9
9
+
nodes = {
10
10
+
docker =
11
11
+
{ config, pkgs, ... }: {
12
12
+
virtualisation.docker.enable = true;
13
13
+
};
14
14
+
};
15
15
+
16
16
+
testScript =
17
17
+
let
18
18
+
dockerImage = pkgs.dockerTools.buildImage {
19
19
+
name = "hello-docker";
20
20
+
contents = [ pkgs.hello ];
21
21
+
tag = "sometag";
22
22
+
23
23
+
# TODO: create another test checking whether runAsRoot works as intended.
24
24
+
25
25
+
config = {
26
26
+
Cmd = [ "hello" ];
27
27
+
};
28
28
+
};
29
29
+
30
30
+
in ''
31
31
+
$docker->waitForUnit("sockets.target");
32
32
+
$docker->succeed("docker load --input='${dockerImage}'");
33
33
+
$docker->succeed("docker run hello-docker:sometag");
34
34
+
'';
35
35
+
36
36
+
})