make keycloak db integration test pass
This commit is contained in:
parent
5f10d3f307
commit
24a23ed3d7
2 changed files with 18 additions and 12 deletions
|
@ -27,9 +27,6 @@ rec {
|
|||
servicesFile = "tests/integration/keycloak/services.nix";
|
||||
networkFile = "tests/integration/keycloak/network.nix";
|
||||
distributionFile = "tests/integration/keycloak/distribution.nix";
|
||||
# extraParams = {
|
||||
# "extra-builtins-file" = ../../extra-builtins.nix;
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -41,11 +38,20 @@ rec {
|
|||
# dysnomiaStateDir = /var/state/dysnomia;
|
||||
testScript =
|
||||
''
|
||||
# Wait until the front-end application is deployed
|
||||
# $test1->waitForFile("/var/tomcat/webapps/testapp");
|
||||
def assert_service_started(machine, name):
|
||||
code, log = machine.systemctl("status " + name)
|
||||
if code != 0:
|
||||
raise Exception(name + " could not be started:\n---\n" + log + "---\n")
|
||||
|
||||
# Wait a little longer and capture the output of the entry page
|
||||
# my $result = $test1->mustSucceed("sleep 10; curl --fail http://test2:8080/testapp");
|
||||
def assert_database_exists(machine, name):
|
||||
if machine.succeed("""psql -XtA -U postgres -h localhost -c "SELECT 1 FROM pg_database WHERE datname='{}'" """.format(name)) != '1\n':
|
||||
raise Exception("could not find database '{}' in postgresql".format(name))
|
||||
|
||||
with subtest("check postgres service started"):
|
||||
assert_service_started(test1, "postgresql.service")
|
||||
|
||||
with subtest("check db is created"):
|
||||
assert_database_exists(test1, "keycloak")
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -26,11 +26,11 @@ rec {
|
|||
};
|
||||
};
|
||||
|
||||
# deployment.keys = {
|
||||
# keycloakinitialadmin.text = ''
|
||||
# KEYCLOAK_ADMIN_PASSWORD="${builtins.extraBuiltins.pass "keycloak.${domain}/admin"}"
|
||||
# '';
|
||||
# };
|
||||
systemd.tmpfiles.rules = [
|
||||
# Type Path Mode User Group Age Argument...
|
||||
''d /run/keys 0755 root root - -''
|
||||
''f+ /run/keys/keycloackinitialadmin 0755 root root - KEYCLOAK_ADMIN_PASSWORD="KEYCLOAK_ADMIN_PASSWORD"''
|
||||
];
|
||||
|
||||
services = {
|
||||
openssh = {
|
||||
|
|
Loading…
Add table
Reference in a new issue