1 import ./make-test-python.nix ({ lib, pkgs, ... }:
6 meta = with lib.maintainers; {
7 maintainers = [ willibutz ];
13 configFile = "${pkgs.grafana-loki.src}/cmd/loki/loki-local-config.yaml";
15 systemd.services.promtail = {
16 description = "Promtail service for Loki test";
17 wantedBy = [ "multi-user.target" ];
21 ${pkgs.grafana-loki}/bin/promtail --config.file ${pkgs.grafana-loki.src}/cmd/promtail/promtail-local-config.yaml
30 machine.wait_for_unit("loki.service")
31 machine.wait_for_unit("promtail.service")
32 machine.wait_for_open_port(3100)
33 machine.wait_for_open_port(9080)
34 machine.succeed("echo 'Loki Ingestion Test' > /var/log/testlog")
35 machine.wait_until_succeeds(
36 "${pkgs.grafana-loki}/bin/logcli --addr='http://localhost:3100' query --no-labels '{job=\"varlogs\",filename=\"/var/log/testlog\"}' | grep -q 'Loki Ingestion Test'"