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