nixpkgs/nixos/tests/cadvisor.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
884 B
Nix
Raw Normal View History

import ./make-test-python.nix ({ lib, pkgs, ... } : {
2014-12-28 20:21:41 +01:00
name = "cadvisor";
meta.maintainers = with lib.maintainers; [ offline ];
2014-12-28 20:21:41 +01:00
nodes = {
machine = { ... }: {
2014-12-28 20:21:41 +01:00
services.cadvisor.enable = true;
};
influxdb = { lib, ... }: {
2014-12-28 20:21:41 +01:00
services.cadvisor.enable = true;
services.cadvisor.storageDriver = "influxdb";
services.influxdb.enable = true;
};
};
2019-11-06 14:23:44 +01:00
testScript = ''
start_all()
machine.wait_for_unit("cadvisor.service")
2020-09-16 18:02:28 +02:00
machine.succeed("curl -f http://localhost:8080/containers/")
2014-12-28 20:21:41 +01:00
2019-11-06 14:23:44 +01:00
influxdb.wait_for_unit("influxdb.service")
2016-09-15 14:28:41 +02:00
# create influxdb database
2019-11-06 14:23:44 +01:00
influxdb.succeed(
2020-09-16 18:02:28 +02:00
'curl -f -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"'
2019-11-06 14:23:44 +01:00
)
2016-09-15 14:28:41 +02:00
2019-11-06 14:23:44 +01:00
influxdb.wait_for_unit("cadvisor.service")
2020-09-16 18:02:28 +02:00
influxdb.succeed("curl -f http://localhost:8080/containers/")
2014-12-28 20:21:41 +01:00
'';
})