From dfbd8b32326f3ba9462a660a9e10f6c233534dc2 Mon Sep 17 00:00:00 2001 From: Bruno Friedmann Date: Mon, 29 Jan 2024 11:54:19 +0100 Subject: [PATCH] systemtests: PostgreSQL setup_local_db.sh add root db Create also the root database in case of tests in podman rootless Signed-off-by: Bruno Friedmann --- .../tests/py3plug-fd-postgresql/database/setup_local_db.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/systemtests/tests/py3plug-fd-postgresql/database/setup_local_db.sh.in b/systemtests/tests/py3plug-fd-postgresql/database/setup_local_db.sh.in index 61eb4ff7f5b..7b63d5d4877 100755 --- a/systemtests/tests/py3plug-fd-postgresql/database/setup_local_db.sh.in +++ b/systemtests/tests/py3plug-fd-postgresql/database/setup_local_db.sh.in @@ -1,7 +1,7 @@ #!/bin/bash # BAREOSĀ® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2020-2023 Bareos GmbH & Co. KG +# Copyright (C) 2020-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -78,9 +78,11 @@ local_db_start_server() { local_db_create_superuser_role() { if [ $UID -eq 0 ]; then su postgres -c "${POSTGRES_BIN_PATH}/psql -h \"$1\" -d postgres -c 'CREATE ROLE root WITH SUPERUSER CREATEDB CREATEROLE REPLICATION LOGIN'" + su postgres -c "${POSTGRES_BIN_PATH}/psql -h \"$1\" -d postgres -c 'CREATE DATABASE root WITH OWNER root'" else # create role and db root for podman test. ${POSTGRES_BIN_PATH}/psql -h "$1" -d postgres -c 'CREATE ROLE root WITH SUPERUSER CREATEDB CREATEROLE REPLICATION LOGIN' + ${POSTGRES_BIN_PATH}/psql -h "$1" -d postgres -c 'CREATE DATABASE root WITH OWNER root' fi }