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