nixos/cadvisor: port test to python

This commit is contained in:
Marijan 2019-11-06 14:23:44 +01:00 committed by Marijan Petricevic
parent 2f7199af21
commit 349c14f950

View file

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ... } : {
import ./make-test-python.nix ({ pkgs, ... } : {
name = "cadvisor";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ offline ];
@ -16,20 +16,19 @@ import ./make-test.nix ({ pkgs, ... } : {
};
};
testScript =
''
startAll;
$machine->waitForUnit("cadvisor.service");
$machine->succeed("curl http://localhost:8080/containers/");
testScript = ''
start_all()
machine.wait_for_unit("cadvisor.service")
machine.succeed("curl http://localhost:8080/containers/")
$influxdb->waitForUnit("influxdb.service");
influxdb.wait_for_unit("influxdb.service")
# create influxdb database
$influxdb->succeed(q~
curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"
~);
influxdb.succeed(
'curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"'
)
$influxdb->waitForUnit("cadvisor.service");
$influxdb->succeed("curl http://localhost:8080/containers/");
influxdb.wait_for_unit("cadvisor.service")
influxdb.succeed("curl http://localhost:8080/containers/")
'';
})