From ea47668ea9b38581fbe1b6c72e133824043a8d38 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Sat, 4 Nov 2023 22:51:35 +0100 Subject: [PATCH] Docker: Pass environment variable to aiida-prepare script (#6169) Set `with-contenv` such that environment variables are forwarded. Without this, settings like the work dir of `localhost` will be set incorrectly and will cause calculations to fail. Cherry-pick: 6123f526cfcec26bea96f60cafeb2c6984da104c --- .../aiida-core-base/s6-assets/s6-rc.d/aiida-prepare/up | 2 ++ .docker/tests/test_aiida.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.docker/aiida-core-base/s6-assets/s6-rc.d/aiida-prepare/up b/.docker/aiida-core-base/s6-assets/s6-rc.d/aiida-prepare/up index 60e82d7e43..b1045997fd 100644 --- a/.docker/aiida-core-base/s6-assets/s6-rc.d/aiida-prepare/up +++ b/.docker/aiida-core-base/s6-assets/s6-rc.d/aiida-prepare/up @@ -1,4 +1,6 @@ #!/command/execlineb -S0 +with-contenv + foreground { s6-echo "Calling /etc/init/aiida-prepare" } /etc/init/aiida-prepare.sh diff --git a/.docker/tests/test_aiida.py b/.docker/tests/test_aiida.py index 803bc855d7..0ab8860231 100644 --- a/.docker/tests/test_aiida.py +++ b/.docker/tests/test_aiida.py @@ -30,3 +30,11 @@ def test_verdi_status(aiida_exec, container_user, timeout): # check that we have suppressed the warnings assert 'Warning' not in output + + +def test_computer_setup_success(aiida_exec, container_user, timeout): + time.sleep(timeout) + output = aiida_exec('verdi computer test localhost', user=container_user).decode().strip() + + assert 'Success' in output + assert 'Failed' not in output