2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00

[#2950] fix pgsql 15 setup for unit tests

This commit is contained in:
Wlodek Wencel 2023-06-28 11:19:15 +02:00 committed by Wlodzimierz Wencel
parent b0b270459e
commit d9517e1712

View File

@ -1498,6 +1498,16 @@ def _configure_pgsql(system, features, revision):
cmd += 'EOF\n"'
execute(cmd, cwd='/tmp')
if system == 'fedora' and int(revision) >= 38 or \
system == 'debian' and int(revision) >= 12 or \
system == 'alpine' and float(revision) >= 3.17:
#TODO it needs detection of pgsql version, and apply this only for postgres >= 15
cmd = """bash -c \"cat <<EOF | sudo -u postgres psql postgres
GRANT ALL ON DATABASE keatest TO keatest;
ALTER DATABASE keatest OWNER TO keatest;\n"""
cmd += 'EOF\n"'
execute(cmd, cwd='/tmp')
cmd = """bash -c \"cat <<EOF | sudo -u postgres psql -U keatest keatest
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO keatest_readonly;\n"""
cmd += 'EOF\n"'