Commit 024f2317 authored by Jérome Perrin's avatar Jérome Perrin

Enable userhosts in ERP5 tests

Run ERP5 tests under [usershosts](https://lab.nexedi.com/nexedi/userhosts) wrapper with the same host mapping as zope instances.

This will allow to simplify configuration of services such as memcached and also be a more realistic environment.

This revealed problems with userhosts, at least on Debian 9,  that have been fixed in userhosts!2 , so at the same time we update userhosts to get these fixes.

/reviewed-on !303
parents 11872bf6 0c43b616
......@@ -13,6 +13,6 @@ location = ${userhosts-get:location}/userhosts
[userhosts-get]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/userhosts.git
revision = 48241da33416ef76097c9cdd6c70b8a57b4b69a8
revision = 1d3b463e7856db6e674a06258c0840206e6a7b72
git-executable = ${git:location}/bin/git
location = ${buildout:parts-directory}/userhosts
......@@ -87,7 +87,7 @@ md5sum = d1f33d406d528ae27d973e2dd0efb1ba
[template-zope]
filename = instance-zope.cfg.in
md5sum = 490001726c0dd93cc94960d83a2f08e5
md5sum = 6aec575a632a2a2672a54bcaedae81cb
[template-balancer]
filename = instance-balancer.cfg.in
......
......@@ -30,12 +30,22 @@ memcached-url = {{ dumps(slapparameter_dict['memcached-url']) }}
cloudooo-url = {{ dumps(slapparameter_dict['cloudooo-url']) }}
test-instance-path = ${directory:unit-test-path}
prepend-path = ${buildout:bin-directory}
run-unit-test = ${buildout:bin-directory}/runUnitTest
run-test-suite = ${buildout:bin-directory}/runTestSuite
run-unit-test = ${buildout:bin-directory}/runUnitTest.real
run-test-suite = ${buildout:bin-directory}/runTestSuite.real
openssl-binary = ${test-certificate-authority:openssl-binary}
run-unit-test-binary = {{ parameter_dict['bin-directory'] }}/runUnitTest
run-test-suite-binary = {{ parameter_dict['bin-directory'] }}/runTestSuite
[{{ section('run-unit-test-userhosts-wrapper') }}]
<= userhosts-wrapper-base
wrapped-command-line = ${test-runner:run-unit-test}
wrapper-path = ${buildout:bin-directory}/runUnitTest
[{{ section('run-test-suite-userhosts-wrapper') }}]
<= userhosts-wrapper-base
wrapped-command-line = ${test-runner:run-test-suite}
wrapper-path = ${buildout:bin-directory}/runTestSuite
[test-certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${binary-link:target-directory}/openssl
......@@ -168,6 +178,14 @@ template = inline: {{ '
rendered = ${directory:etc}/hosts
context = key host_dict hosts-parameter:host-dict
[userhosts-wrapper-base]
recipe = slapos.cookbook:wrapper
environment =
HOSTALIASES=${hostaliases:rendered}
HOSTS=${hosts:rendered}
parameters-extra = true
command-line = '{{ parameter_dict['userhosts'] }}' ${:wrapped-command-line}
{# Hack to deploy SSL certs via instance parameters -#}
{% for zodb in zodb_dict.itervalues() -%}
{% set storage_dict = zodb.setdefault('storage-dict', {}) -%}
......@@ -190,10 +208,8 @@ pem = {{dumps(storage_dict.pop(k))}}
{# endhack -#}
[runzope-base]
recipe = slapos.cookbook:wrapper
environment =
HOSTALIASES=${hostaliases:rendered}
HOSTS=${hosts:rendered}
<= userhosts-wrapper-base
environment +=
TMP=${directory:tmp}
TMPDIR=${directory:tmp}
HOME=${buildout:directory}
......@@ -204,8 +220,7 @@ environment =
{% if slapparameter_dict.get('wendelin-core-zblk-fmt') %}
WENDELIN_CORE_ZBLK_FMT={{ slapparameter_dict['wendelin-core-zblk-fmt'] }}
{% endif %}
parameters-extra = true
command-line = '{{ parameter_dict['userhosts'] }}' '{{ bin_directory }}/runzope' -C '${:configuration-file}'
wrapped-command-line = '{{ bin_directory }}/runzope' -C '${:configuration-file}'
private-dev-shm = {{ slapparameter_dict['private-dev-shm'] }}
[{{ section('zcml') }}]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment