diff options
author | Jana Traue <jana.traue@cyberus-technology.de> | 2019-10-27 11:24:26 +0100 |
---|---|---|
committer | Jacek Galowicz <jacek.galowicz@cyberus-technology.de> | 2019-11-04 23:51:09 +0100 |
commit | 9b33b5d38c3f2f93ff03e195b090ed1b25f6d51c (patch) | |
tree | 29e29746ecffd738422fa10b0310c90f20c60857 /nixos/tests/gitea.nix | |
parent | 8eead58520f45f55cec40b7d7f0ca47e458356a8 (diff) |
nixos/gitea: convert test to python
Diffstat (limited to 'nixos/tests/gitea.nix')
-rw-r--r-- | nixos/tests/gitea.nix | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/nixos/tests/gitea.nix b/nixos/tests/gitea.nix index b8ab6dabc8c1f..ffbc07cfbb21f 100644 --- a/nixos/tests/gitea.nix +++ b/nixos/tests/gitea.nix @@ -3,7 +3,7 @@ pkgs ? import ../.. { inherit system config; } }: -with import ../lib/testing.nix { inherit system pkgs; }; +with import ../lib/testing-python.nix { inherit system pkgs; }; with pkgs.lib; { @@ -18,11 +18,11 @@ with pkgs.lib; }; testScript = '' - startAll; + start_all() - $machine->waitForUnit('gitea.service'); - $machine->waitForOpenPort('3000'); - $machine->succeed("curl --fail http://localhost:3000/"); + machine.wait_for_unit("gitea.service") + machine.wait_for_open_port(3000) + machine.succeed("curl --fail http://localhost:3000/") ''; }; @@ -37,11 +37,11 @@ with pkgs.lib; }; testScript = '' - startAll; + start_all() - $machine->waitForUnit('gitea.service'); - $machine->waitForOpenPort('3000'); - $machine->succeed("curl --fail http://localhost:3000/"); + machine.wait_for_unit("gitea.service") + machine.wait_for_open_port(3000) + machine.succeed("curl --fail http://localhost:3000/") ''; }; @@ -56,12 +56,14 @@ with pkgs.lib; }; testScript = '' - startAll; + start_all() - $machine->waitForUnit('gitea.service'); - $machine->waitForOpenPort('3000'); - $machine->succeed("curl --fail http://localhost:3000/"); - $machine->succeed("curl --fail http://localhost:3000/user/sign_up | grep 'Registration is disabled. Please contact your site administrator.'"); + machine.wait_for_unit("gitea.service") + machine.wait_for_open_port(3000) + machine.succeed("curl --fail http://localhost:3000/") + machine.succeed( + "curl --fail http://localhost:3000/user/sign_up | grep 'Registration is disabled. Please contact your site administrator.'" + ) ''; }; } |