1import ./make-test-python.nix ({ pkgs, ... } : {
2 name = "cadvisor";
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ offline ];
5 };
6
7 nodes = {
8 machine = { ... }: {
9 services.cadvisor.enable = true;
10 };
11
12 influxdb = { lib, ... }: with lib; {
13 services.cadvisor.enable = true;
14 services.cadvisor.storageDriver = "influxdb";
15 services.influxdb.enable = true;
16 };
17 };
18
19 testScript = ''
20 start_all()
21 machine.wait_for_unit("cadvisor.service")
22 machine.succeed("curl -f http://localhost:8080/containers/")
23
24 influxdb.wait_for_unit("influxdb.service")
25
26 # create influxdb database
27 influxdb.succeed(
28 'curl -f -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"'
29 )
30
31 influxdb.wait_for_unit("cadvisor.service")
32 influxdb.succeed("curl -f http://localhost:8080/containers/")
33 '';
34})