Skip to content

Commit

Permalink
systemtests: PostgreSQL setup_local_db.sh add root db
Browse files Browse the repository at this point in the history
Create also the root database in case of tests in podman rootless

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
  • Loading branch information
bruno-at-bareos authored and joergsteffens committed Jan 29, 2024
1 parent ec48c87 commit dfbd8b3
Showing 1 changed file with 3 additions and 1 deletion.
@@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit dfbd8b3

Please sign in to comment.