From db387a6f0d2dee8e74dd150e175f06983646dad5 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Thu, 15 Sep 2016 21:28:41 +0900 Subject: [PATCH] cadvisor: fix test --- nixos/tests/cadvisor.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nixos/tests/cadvisor.nix b/nixos/tests/cadvisor.nix index c55b08c0e92..3a887514773 100644 --- a/nixos/tests/cadvisor.nix +++ b/nixos/tests/cadvisor.nix @@ -13,10 +13,6 @@ import ./make-test.nix ({ pkgs, ... } : { services.cadvisor.enable = true; services.cadvisor.storageDriver = "influxdb"; services.influxdb.enable = true; - systemd.services.influxdb.postStart = mkAfter '' - ${pkgs.curl.bin}/bin/curl -X POST 'http://localhost:8086/db?u=root&p=root' \ - -d '{"name": "root"}' - ''; }; }; @@ -27,6 +23,15 @@ import ./make-test.nix ({ pkgs, ... } : { $machine->succeed("curl http://localhost:8080/containers/"); $influxdb->waitForUnit("influxdb.service"); + + # Wait until influxdb admin interface is available + $influxdb->waitUntilSucceeds("curl -f 127.0.0.1:8083"); + + # create influxdb database + $influxdb->succeed(q~ + curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root" + ~); + $influxdb->waitForUnit("cadvisor.service"); $influxdb->succeed("curl http://localhost:8080/containers/"); '';