[FIX] packaging: find admin uid when testing packages

Since 2f7c03d the admin user could have any uid and the uid 1 is
reserved for the system user. As the uid was hardcoded as 1 when testing
packages, the tests were failing.

With this commit, the uid of the admin user is searched before testing
the packages.

Closes #26603
This commit is contained in:
Christophe Monniez
2018-08-27 13:25:43 +02:00
committed by GitHub
parent 0e307f8280
commit 6dc790d2da
+5 -2
View File
@@ -75,13 +75,16 @@ def system(l, chdir=None):
def _rpc_count_modules(addr='http://127.0.0.1', port=8069, dbname='mycompany'):
time.sleep(5)
uid = xmlrpclib.ServerProxy('%s:%s/xmlrpc/common' % (addr, port)).authenticate(
dbname, 'admin', 'admin', {}
)
modules = xmlrpclib.ServerProxy('%s:%s/xmlrpc/object' % (addr, port)).execute(
dbname, 1, 'admin', 'ir.module.module', 'search', [('state', '=', 'installed')]
dbname, uid, 'admin', 'ir.module.module', 'search', [('state', '=', 'installed')]
)
if modules and len(modules) > 1:
time.sleep(1)
toinstallmodules = xmlrpclib.ServerProxy('%s:%s/xmlrpc/object' % (addr, port)).execute(
dbname, 1, 'admin', 'ir.module.module', 'search', [('state', '=', 'to install')]
dbname, uid, 'admin', 'ir.module.module', 'search', [('state', '=', 'to install')]
)
if toinstallmodules:
logging.error("Package test: FAILED. Not able to install dependencies of base.")