From 2cea8b1450c9684151a77f11ed5e37c0a40917f4 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Mon, 23 Oct 2023 09:26:19 +0200 Subject: [PATCH] [FIX] packaging: fix rpm tests As [postgresql 15] changed the permissions of the public schema, when testing the rpm package with Fedora 38, the test fails with `InsufficientPrivilege: permission denied for schema public`. With this commit, we properly create the database with the odoo user. While at it, let's do the same with the poor left behind tgz package. [postgresql 15]: https://www.postgresql.org/docs/release/15.0/ Part-of: odoo/odoo#139482 --- setup/package.py | 5 +++-- setup/rpm/odoo.spec | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/package.py b/setup/package.py index 97a52d7419e4c..45441976c06d5 100755 --- a/setup/package.py +++ b/setup/package.py @@ -297,7 +297,7 @@ def start_test(self): 'service postgresql start', 'pip3 install /data/src/odoo_%s.%s.tar.gz' % (VERSION, TSTAMP), 'su postgres -s /bin/bash -c "createuser -s odoo"', - 'su postgres -s /bin/bash -c "createdb mycompany"', + 'su odoo -s /bin/bash -c "createdb mycompany"', 'su odoo -s /bin/bash -c "odoo -d mycompany -i base --stop-after-init"', 'su odoo -s /bin/bash -c "odoo -d mycompany --pidfile=/data/src/odoo.pid"', ] @@ -364,7 +364,8 @@ def start_test(self): cmds = [ 'su postgres -c "/usr/bin/pg_ctl -D /var/lib/postgres/data start"', 'sleep 5', - 'su postgres -c "createdb mycompany"', + 'su postgres -c "createuser -s odoo"', + 'su odoo -c "createdb mycompany"', 'dnf install -d 0 -e 0 /data/src/odoo_%s.%s.rpm -y' % (VERSION, TSTAMP), 'su odoo -s /bin/bash -c "odoo -c /etc/odoo/odoo.conf -d mycompany -i base --stop-after-init"', 'su odoo -s /bin/bash -c "odoo -c /etc/odoo/odoo.conf -d mycompany --pidfile=/data/src/odoo.pid"', diff --git a/setup/rpm/odoo.spec b/setup/rpm/odoo.spec index 6584561cc0ba9..1b582502885ce 100644 --- a/setup/rpm/odoo.spec +++ b/setup/rpm/odoo.spec @@ -1,6 +1,7 @@ %global name odoo %global release 1 %global unmangled_version %{version} +%global __requires_exclude ^.*odoo/addons/mail/static/scripts/odoo-mailgate.py$ Summary: Odoo Server Name: %{name}