Skip to content

Commit

Permalink
[FIX] packaging: fix rpm tests
Browse files Browse the repository at this point in the history
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#139482
  • Loading branch information
d-fence committed Oct 24, 2023
1 parent a05683f commit 2cea8b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setup/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"',
]
Expand Down Expand Up @@ -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"',
Expand Down
1 change: 1 addition & 0 deletions setup/rpm/odoo.spec
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit 2cea8b1

Please sign in to comment.