1import ./make-test.nix ({ pkgs, ... } : {
2 name = "cadvisor";
3 meta = with pkgs.stdenv.lib.maintainers; {
4 maintainers = [ offline ];
5 };
6
7 nodes = {
8 machine = { config, pkgs, ... }: {
9 services.cadvisor.enable = true;
10 };
11
12 influxdb = { config, pkgs, lib, ... }: with lib; {
13 services.cadvisor.enable = true;
14 services.cadvisor.storageDriver = "influxdb";
15 services.influxdb.enable = true;
16 systemd.services.influxdb.postStart = mkAfter ''
17 ${pkgs.curl}/bin/curl -X POST 'http://localhost:8086/db?u=root&p=root' \
18 -d '{"name": "root"}'
19 '';
20 };
21 };
22
23 testScript =
24 ''
25 startAll;
26 $machine->waitForUnit("cadvisor.service");
27 $machine->succeed("curl http://localhost:8080/containers/");
28
29 $influxdb->waitForUnit("influxdb.service");
30 $influxdb->waitForUnit("cadvisor.service");
31 $influxdb->succeed("curl http://localhost:8080/containers/");
32 '';
33})