nixosTests.pgmanage: Port tests to python

This commit is contained in:
Christian Kampka 2019-12-15 18:48:18 +01:00
parent 1bf1ec35bc
commit a20683acbe
No known key found for this signature in database
GPG Key ID: B88E140DB4FE1AA5

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ... } : import ./make-test-python.nix ({ pkgs, ... } :
let let
role = "test"; role = "test";
password = "secret"; password = "secret";
@ -29,11 +29,13 @@ in
}; };
testScript = '' testScript = ''
startAll; start_all()
$one->waitForUnit("default.target"); one.wait_for_unit("default.target")
$one->requireActiveUnit("pgmanage.service"); one.require_unit_state("pgmanage.service", "active")
# Test if we can log in. # Test if we can log in.
$one->waitUntilSucceeds("curl 'http://localhost:8080/pgmanage/auth' --data 'action=login&connname=${conn}&username=${role}&password=${password}' --fail"); one.wait_until_succeeds(
"curl 'http://localhost:8080/pgmanage/auth' --data 'action=login&connname=${conn}&username=${role}&password=${password}' --fail"
)
''; '';
}) })