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 nexedi/userhosts!2 , so at the same time we update userhosts to get these fixes.

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