2023-05-24 13:37:59 +00:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... } : {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "cadvisor";
|
2023-05-24 13:37:59 +00:00
|
|
|
meta.maintainers = with lib.maintainers; [ offline ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nodes = {
|
|
|
|
machine = { ... }: {
|
|
|
|
services.cadvisor.enable = true;
|
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
influxdb = { lib, ... }: {
|
2020-04-24 23:36:52 +00:00
|
|
|
services.cadvisor.enable = true;
|
|
|
|
services.cadvisor.storageDriver = "influxdb";
|
|
|
|
services.influxdb.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
start_all()
|
|
|
|
machine.wait_for_unit("cadvisor.service")
|
2020-10-27 00:29:36 +00:00
|
|
|
machine.succeed("curl -f http://localhost:8080/containers/")
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
influxdb.wait_for_unit("influxdb.service")
|
|
|
|
|
|
|
|
# create influxdb database
|
|
|
|
influxdb.succeed(
|
2020-10-27 00:29:36 +00:00
|
|
|
'curl -f -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"'
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
influxdb.wait_for_unit("cadvisor.service")
|
2020-10-27 00:29:36 +00:00
|
|
|
influxdb.succeed("curl -f http://localhost:8080/containers/")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
})
|