1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
3 meta.maintainers = [ lib.maintainers.anthonyroussel ];
6 environment.systemPackages = [ pkgs.jq ];
16 addr."tcp://localhost:8080" = {
18 local-address = "127.0.0.1";
20 command."check-goss-version" = {
21 exec = "${lib.getExe pkgs.goss} --version";
24 dns.localhost.resolvable = true;
26 filetype = "directory";
29 group.root.exists = true;
30 kernel-param."kernel.ostype".value = "Linux";
31 user.root.exists = true;
39 machine.wait_for_unit("goss.service")
40 machine.wait_for_open_port(8080)
42 with subtest("returns health status"):
43 result = json.loads(machine.succeed("curl -sS http://localhost:8080/healthz"))
45 assert len(result["results"]) == 8, f".results should be an array of 10 items, was {result['results']!r}"
46 assert result["summary"]["failed-count"] == 0, f".summary.failed-count should be zero, was {result['summary']['failed-count']}"
47 assert result["summary"]["test-count"] == 8, f".summary.test-count should be 10, was {result['summary']['test-count']}"