From 82df050e65fffda7f0ea9b3cdc087811cbb82a0f Mon Sep 17 00:00:00 2001 From: Douglas Camata <douglas.camata@nexedi.com> Date: Mon, 26 Sep 2016 15:58:10 +0000 Subject: [PATCH] wendelin: custom test runner to load our own libstdc++ @Tyagov, please review. Now the test runners use the LD_PRELOAD environment variable to load the correct libstdc++ built by slapos and restart themselves. The restart is necessary because LD_PRELOAD is only taken into account at the time the process is started. Changing this environment variable in runtime has no effects. Tests results are available at Nexedi's ERP5 and are 100% ok: https://nexedi.erp5.net/test_result_module/20160927-3FA05624. /reviewed-on https://lab.nexedi.com/nexedi/slapos/merge_requests/99 --- software/wendelin/software.cfg | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/software/wendelin/software.cfg b/software/wendelin/software.cfg index 654edf46f..346a64ac8 100644 --- a/software/wendelin/software.cfg +++ b/software/wendelin/software.cfg @@ -12,6 +12,8 @@ parts += ipython wendelin.core ipython-notebook + wendelin_test_suite_runner + wendelin_testrunner [eggs] initialization = @@ -24,7 +26,35 @@ eggs += ${msgpack-python:egg} ${wendelin.core:egg} ${ipython:egg} - + +[generic_testrunner_init] +initialization = + # The 4 lines below will replace the process with another one, with the proper + # LD_PRELOAD environment variable. This is necessary because LD_PRELOAD is only + # taken into account when the process starts. Modifying it in runtime doesn't + # work. + import struct, os + arch = 8 * struct.calcsize("P") + rerun = not os.getenv('LD_PRELOAD') + if rerun: os.environ['LD_PRELOAD'] = '''${gcc-fortran:location}/lib%s/libstdc++.so''' % arch + if rerun: os.execve(os.path.realpath(__file__), sys.argv, os.environ) + +[wendelin_test_suite_runner] +<= test_suite_runner +# we need to override the test suite runner to add our custom libstdc++ dynamic +# library to the path +initialization = + ${generic_testrunner_init:initialization} + ${test_suite_runner:initialization} + +[wendelin_testrunner] +<= testrunner +# we need to override the test suite runner to add our custom libstdc++ dynamic +# library to the path +initialization = + ${generic_testrunner_init:initialization} + ${testrunner:initialization} + [erp5_repository_list] repository_id_list += wendelin -- 2.30.9