Commit 5d6876fc authored by Boxiang Sun's avatar Boxiang Sun

caucase: set up a host file which specified for it

This allow caucase test use the random partition IP
address instead of fixed localhost:8000. Which can avoid
the conflict if one test node running multiple test suite.
parent 92d90b06
......@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum = 2a0edca6e0aa2c1277747c980bc0f256
md5sum = 84bd6729e9b299c457cea2d1be6d05a4
......@@ -32,6 +32,16 @@ repository = ${kedifa-repository:location}
<= download-source
repository = ${caucase-repository:location}
[caucase-test-runner]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
export HOSTS="$(mktemp)"
trap 'rm "$HOSTS"' EXIT
printf '%s testhost\n%s testhost\n' "$SLAPOS_TEST_IPV4" "$SLAPOS_TEST_IPV6" > "$HOSTS"
export CAUCASE_NETLOC=testhost:8000 LD_PRELOAD=${userhosts:location}/lib/userhosts.so:$LD_PRELOAD
exec python -m unittest discover -v
rendered = $${caucase:location}/host_setting.sh
[slapos.libnetworkcache]
<= download-source
repository = ${slapos.libnetworkcache-repository:location}
......@@ -98,9 +108,7 @@ template = inline:
)
TestCase(
"caucase",
# XXX caucase uses 2to3 dynamically in setup.py, so it only supports
# runnning tests with python setup.py test
['python', 'setup.py', 'test'],
['$${caucase-test-runner:rendered}'],
cwd="""$${caucase:location}""",
summaryf=UnitTest.summary,
)
......
......@@ -16,6 +16,7 @@ extends =
../../component/jq/buildout.cfg
../../component/sed/buildout.cfg
../../component/grep/buildout.cfg
../../component/userhosts/buildout.cfg
../../stack/slapos.cfg
../../stack/caucase/buildout.cfg
../../stack/nxdtest.cfg
......
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