]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2950] fix pgsql 15 setup for unit tests
authorWlodek Wencel <wlodek@isc.org>
Wed, 28 Jun 2023 09:19:15 +0000 (11:19 +0200)
committerWlodzimierz Wencel <wlodek@isc.org>
Wed, 28 Jun 2023 13:43:03 +0000 (13:43 +0000)
hammer.py

index ff8c5e9b67d13ab8d6db3945043f8f8e638103db..59e971f4dd6904e1390c52f4c7c30d5cb9238d83 100755 (executable)
--- a/hammer.py
+++ b/hammer.py
@@ -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"'