From eafa806ea012f738789a4a258a10e50f6d9739dd Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 27 Feb 2023 11:49:54 +0100 Subject: Switch shell tests to use just as remote execution endpoint ... and, in this way, ensure the test also tests properly in absence of an external remote execution system. --- test/end-to-end/remote-execution/TARGETS | 20 ++++--------- .../end-to-end/remote-execution/native-protocol.sh | 34 ++++++++++------------ test/end-to-end/remote-execution/upload-test.sh | 24 +++++++-------- 3 files changed, 33 insertions(+), 45 deletions(-) (limited to 'test/end-to-end/remote-execution') diff --git a/test/end-to-end/remote-execution/TARGETS b/test/end-to-end/remote-execution/TARGETS index f2ba00f5..3574f6db 100644 --- a/test/end-to-end/remote-execution/TARGETS +++ b/test/end-to-end/remote-execution/TARGETS @@ -1,35 +1,27 @@ { "native-protocol": - { "type": ["@", "rules", "shell/test", "script"] + { "type": ["test/end-to-end", "with remote"] , "name": ["native-protocol"] , "test": ["native-protocol.sh"] , "deps": [ ["test/end-to-end", "tool-under-test"] , ["test/end-to-end", "mr-tool-under-test"] - , ["@", "credentials", "", ""] ] } , "large-blobs": - { "type": ["@", "rules", "shell/test", "script"] + { "type": ["test/end-to-end", "with remote"] , "name": ["large-blobs"] , "test": ["large-blobs.sh"] - , "deps": - [["test/end-to-end", "tool-under-test"], ["@", "credentials", "", ""]] + , "deps": [["test/end-to-end", "tool-under-test"]] } , "upload-test": - { "type": ["@", "rules", "shell/test", "script"] + { "type": ["test/end-to-end", "with remote"] , "name": ["upload-test"] , "test": ["upload-test.sh"] - , "deps": - [["test/end-to-end", "tool-under-test"], ["@", "credentials", "", ""]] + , "deps": [["test/end-to-end", "tool-under-test"]] } , "TESTS": { "type": "install" , "tainted": ["test"] - , "deps": - [ "native-protocol" - , "large-blobs" - , "upload-test" - , ["@", "credentials", "", ""] - ] + , "deps": ["native-protocol", "large-blobs", "upload-test"] } } diff --git a/test/end-to-end/remote-execution/native-protocol.sh b/test/end-to-end/remote-execution/native-protocol.sh index 68667dad..0bc2c488 100644 --- a/test/end-to-end/remote-execution/native-protocol.sh +++ b/test/end-to-end/remote-execution/native-protocol.sh @@ -86,24 +86,22 @@ TREE_ID="$(jq -r ".${OUT_DIRNAME}.id" "${RESULT}" 2>&1)" test ${TREE_ID} ${EQUAL} ${GIT_TREE_ID} AUTH_ARGS="" -if [ "${REMOTE_EXECUTION_ADDRESS:-}" != "" ]; then - REMOTE_EXECUTION_ARGS="-r ${REMOTE_EXECUTION_ADDRESS}" - if [ "${REMOTE_EXECUTION_PROPERTIES:-}" != "" ]; then - REMOTE_EXECUTION_ARGS="${REMOTE_EXECUTION_ARGS} --remote-execution-property ${REMOTE_EXECUTION_PROPERTIES}" +REMOTE_EXECUTION_ARGS="-r ${REMOTE_EXECUTION_ADDRESS}" +if [ "${REMOTE_EXECUTION_PROPERTIES:-}" != "" ]; then + REMOTE_EXECUTION_ARGS="${REMOTE_EXECUTION_ARGS} --remote-execution-property ${REMOTE_EXECUTION_PROPERTIES}" +fi +if [ -f "${CREDENTIALS_DIR}/ca.crt" ]; then + AUTH_ARGS=" --tls-ca-cert ${CREDENTIALS_DIR}/ca.crt " + if [ -f "${CREDENTIALS_DIR}/client.crt" ]; then + AUTH_ARGS=" --tls-client-cert ${CREDENTIALS_DIR}/client.crt "${AUTH_ARGS} fi - if [ -f "${CREDENTIALS_DIR}/ca.crt" ]; then - AUTH_ARGS=" --tls-ca-cert ${CREDENTIALS_DIR}/ca.crt " - if [ -f "${CREDENTIALS_DIR}/client.crt" ]; then - AUTH_ARGS=" --tls-client-cert ${CREDENTIALS_DIR}/client.crt "${AUTH_ARGS} - fi - if [ -f "${CREDENTIALS_DIR}/client.key" ]; then - AUTH_ARGS=" --tls-client-key ${CREDENTIALS_DIR}/client.key "${AUTH_ARGS} - fi + if [ -f "${CREDENTIALS_DIR}/client.key" ]; then + AUTH_ARGS=" --tls-client-key ${CREDENTIALS_DIR}/client.key "${AUTH_ARGS} fi - echo - echo Upload and download Git tree to remote CAS in ${NAME} mode - echo - "${JUST}" build -C "${CONF}" --main test test ${REMOTE_EXECUTION_ARGS} ${AUTH_ARGS} --local-build-root="${LBRDIR}" --dump-artifacts "${RESULT}" ${ARGS} 2>&1 - TREE_ID="$(jq -r ".${OUT_DIRNAME}.id" "${RESULT}" 2>&1)" - test ${TREE_ID} ${EQUAL} ${GIT_TREE_ID} fi +echo +echo Upload and download Git tree to remote CAS in ${NAME} mode +echo +"${JUST}" build -C "${CONF}" --main test test ${REMOTE_EXECUTION_ARGS} ${AUTH_ARGS} --local-build-root="${LBRDIR}" --dump-artifacts "${RESULT}" ${ARGS} 2>&1 +TREE_ID="$(jq -r ".${OUT_DIRNAME}.id" "${RESULT}" 2>&1)" +test ${TREE_ID} ${EQUAL} ${GIT_TREE_ID} diff --git a/test/end-to-end/remote-execution/upload-test.sh b/test/end-to-end/remote-execution/upload-test.sh index 40d2628b..6a3a2978 100644 --- a/test/end-to-end/remote-execution/upload-test.sh +++ b/test/end-to-end/remote-execution/upload-test.sh @@ -59,19 +59,17 @@ export CONF="$(realpath repos.json)" # Build remotely AUTH_ARGS="" -if [ "${REMOTE_EXECUTION_ADDRESS:-}" != "" ]; then - REMOTE_EXECUTION_ARGS="-r ${REMOTE_EXECUTION_ADDRESS}" - if [ "${REMOTE_EXECUTION_PROPERTIES:-}" != "" ]; then - REMOTE_EXECUTION_ARGS="${REMOTE_EXECUTION_ARGS} --remote-execution-property ${REMOTE_EXECUTION_PROPERTIES}" +REMOTE_EXECUTION_ARGS="-r ${REMOTE_EXECUTION_ADDRESS}" +if [ "${REMOTE_EXECUTION_PROPERTIES:-}" != "" ]; then + REMOTE_EXECUTION_ARGS="${REMOTE_EXECUTION_ARGS} --remote-execution-property ${REMOTE_EXECUTION_PROPERTIES}" +fi +if [ -f "${CREDENTIALS_DIR}/ca.crt" ]; then + AUTH_ARGS=" --tls-ca-cert ${CREDENTIALS_DIR}/ca.crt " + if [ -f "${CREDENTIALS_DIR}/client.crt" ]; then + AUTH_ARGS=" --tls-client-cert ${CREDENTIALS_DIR}/client.crt "${AUTH_ARGS} fi - if [ -f "${CREDENTIALS_DIR}/ca.crt" ]; then - AUTH_ARGS=" --tls-ca-cert ${CREDENTIALS_DIR}/ca.crt " - if [ -f "${CREDENTIALS_DIR}/client.crt" ]; then - AUTH_ARGS=" --tls-client-cert ${CREDENTIALS_DIR}/client.crt "${AUTH_ARGS} - fi - if [ -f "${CREDENTIALS_DIR}/client.key" ]; then - AUTH_ARGS=" --tls-client-key ${CREDENTIALS_DIR}/client.key "${AUTH_ARGS} - fi + if [ -f "${CREDENTIALS_DIR}/client.key" ]; then + AUTH_ARGS=" --tls-client-key ${CREDENTIALS_DIR}/client.key "${AUTH_ARGS} fi - "${JUST}" build -C "${CONF}" --local-build-root="${LBRDIR}" ${ARGS} ${REMOTE_EXECUTION_ARGS} ${AUTH_ARGS} 2>&1 fi +"${JUST}" build -C "${CONF}" --local-build-root="${LBRDIR}" ${ARGS} ${REMOTE_EXECUTION_ARGS} ${AUTH_ARGS} 2>&1 -- cgit v1.2.3