[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
This commit is contained in:
Christophe Monniez
2023-10-24 13:55:27 +00:00
parent a05683fdd2
commit 2cea8b1450
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -297,7 +297,7 @@ class DockerTgz(Docker):
'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 @@ class DockerRpm(Docker):
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"',
+1
View File
@@ -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}