From bc1d542f09572cc70eb41ebe70fce3c6f632324b Mon Sep 17 00:00:00 2001 From: Jan Hrnko Date: Sat, 9 Nov 2019 20:35:50 +0100 Subject: [PATCH] nixos/miniflux: port test to python --- nixos/tests/miniflux.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/nixos/tests/miniflux.nix b/nixos/tests/miniflux.nix index 19ab4803a1d3..7d83d061a9df 100644 --- a/nixos/tests/miniflux.nix +++ b/nixos/tests/miniflux.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ pkgs, lib, ... }: +import ./make-test-python.nix ({ pkgs, lib, ... }: let port = 3142; @@ -37,16 +37,20 @@ with lib; }; }; testScript = '' - startAll; + start_all() - $default->waitForUnit('miniflux.service'); - $default->waitForOpenPort(${toString defaultPort}); - $default->succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep -q OK"); - $default->succeed("curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"); + default.wait_for_unit("miniflux.service") + default.wait_for_open_port(${toString defaultPort}) + default.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep -q OK") + default.succeed( + "curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'" + ) - $customized->waitForUnit('miniflux.service'); - $customized->waitForOpenPort(${toString port}); - $customized->succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK"); - $customized->succeed("curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"); + customized.wait_for_unit("miniflux.service") + customized.wait_for_open_port(${toString port}) + customized.succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK") + customized.succeed( + "curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep -q '\"is_admin\":true'" + ) ''; })