From ce910fca8841061e86bfbfd15f8976132c2bfd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Wed, 29 Jun 2022 04:17:38 +0900 Subject: [PATCH] nixos/tests: add phlactery --- nixos/tests/all-tests.nix | 1 + nixos/tests/web-apps/phylactery.nix | 20 ++++++++++++++++++++ pkgs/servers/web-apps/phylactery/default.nix | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/web-apps/phylactery.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 87bed40eac9e..70904d61077b 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -424,6 +424,7 @@ in { php = handleTest ./php {}; php80 = handleTest ./php { php = pkgs.php80; }; php81 = handleTest ./php { php = pkgs.php81; }; + phylactery = handleTest ./web-apps/phylactery.nix {}; pict-rs = handleTest ./pict-rs.nix {}; pinnwand = handleTest ./pinnwand.nix {}; plasma5 = handleTest ./plasma5.nix {}; diff --git a/nixos/tests/web-apps/phylactery.nix b/nixos/tests/web-apps/phylactery.nix new file mode 100644 index 000000000000..cf2689d2300d --- /dev/null +++ b/nixos/tests/web-apps/phylactery.nix @@ -0,0 +1,20 @@ +import ../make-test-python.nix ({ pkgs, lib, ... }: { + name = "phylactery"; + + nodes.machine = { ... }: { + services.phylactery = rec { + enable = true; + port = 8080; + library = "/tmp"; + }; + }; + + testScript = '' + start_all() + machine.wait_for_unit('phylactery') + machine.wait_for_open_port(8080) + machine.wait_until_succeeds('curl localhost:8080') + ''; + + meta.maintainers = with lib.maintainers; [ McSinyx ]; +}) diff --git a/pkgs/servers/web-apps/phylactery/default.nix b/pkgs/servers/web-apps/phylactery/default.nix index 72687e2065dc..a3cddf2fc8d5 100644 --- a/pkgs/servers/web-apps/phylactery/default.nix +++ b/pkgs/servers/web-apps/phylactery/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoPackage, fetchFromSourcehut }: +{ lib, buildGoPackage, fetchFromSourcehut, nixosTests }: buildGoPackage rec { pname = "phylactery"; @@ -15,6 +15,7 @@ buildGoPackage rec { # Upstream repo doesn't provide any test. doCheck = false; + passthru.tests.phylactery = nixosTests.phylactery; meta = with lib; { description = "Old school comic web server";