aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/tests/ihatemoney.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/ihatemoney.nix')
-rw-r--r--nixpkgs/nixos/tests/ihatemoney.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/nixpkgs/nixos/tests/ihatemoney.nix b/nixpkgs/nixos/tests/ihatemoney.nix
index 7df0ea0b691..0451a450580 100644
--- a/nixpkgs/nixos/tests/ihatemoney.nix
+++ b/nixpkgs/nixos/tests/ihatemoney.nix
@@ -1,5 +1,11 @@
+{ system ? builtins.currentSystem,
+ config ? {},
+ pkgs ? import ../.. { inherit system config; }
+}:
+
let
- f = backend: import ./make-test-python.nix ({ pkgs, ... }: {
+ inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
+ f = backend: makeTest {
name = "ihatemoney-${backend}";
machine = { lib, ... }: {
services.ihatemoney = {
@@ -24,9 +30,10 @@ let
testScript = ''
machine.wait_for_open_port(8000)
machine.wait_for_unit("uwsgi.service")
+ machine.wait_until_succeeds("curl http://localhost:8000")
assert '"yay"' in machine.succeed(
- "curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay\@example.com'"
+ "curl -X POST http://localhost:8000/api/projects -d 'name=yay&id=yay&password=yay&contact_email=yay@example.com'"
)
owner, timestamp = machine.succeed(
"stat --printf %U:%G___%Y /var/lib/ihatemoney/secret_key"
@@ -48,7 +55,7 @@ let
assert "ihatemoney" in machine.succeed("curl http://localhost:8000")
'';
- });
+ };
in {
ihatemoney-sqlite = f "sqlite";
ihatemoney-postgresql = f "postgresql";