Skip to content

Commit 93e8d24

Browse files
committed
fix: error when copying to a non-existing target
1 parent 87fc01d commit 93e8d24

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/run-tests.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,25 @@ while (( ${index} <= ${max_connection_attempts} )); do
9494
done
9595

9696
# Create $IMAGEBUILDER_TEST_DIR directory and upload tests there
97+
echo "Copying tests to the tester instance..."
98+
ssh -i "${PRIVATE_SSH_KEY}" \
99+
-o UserKnownHostsFile="${TEMPDIR}/known_hosts" \
100+
-o StrictHostKeyChecking=no \
101+
"${USER}@${IP}" \
102+
"/bin/bash -e -c 'mkdir -p "${IMAGEBUILDER_TEST_DIR}"'"
97103
scp -r \
98104
-i "${PRIVATE_SSH_KEY}" \
99105
-o UserKnownHostsFile="${TEMPDIR}/known_hosts" \
100106
-o StrictHostKeyChecking=no \
101107
"${TESTS_DIR}" "${USER}@${IP}:${IMAGEBUILDER_TEST_DIR}/"
102108

103109
# Run tests
110+
echo "Running tests in tester instance..."
104111
ssh -i "${PRIVATE_SSH_KEY}" \
105112
-o UserKnownHostsFile="${TEMPDIR}/known_hosts" \
106113
-o StrictHostKeyChecking=no \
107114
"${USER}@${IP}" \
108-
"/bin/bash -eu -c 'chmod +x ${IMAGEBUILDER_TEST_DIR}/run-tests-on-instance.sh && PACKER_SSH_USERNAME=${PACKER_SSH_USERNAME} SOLUTION_NAME=${SOLUTION_NAME} ${IMAGEBUILDER_TEST_DIR}/run-tests-on-instance.sh'" \
115+
"/bin/bash -eu -c 'chmod +x ${IMAGEBUILDER_TEST_DIR}/tests/run-tests-on-instance.sh && PACKER_SSH_USERNAME=${PACKER_SSH_USERNAME} SOLUTION_NAME=${SOLUTION_NAME} ${IMAGEBUILDER_TEST_DIR}/tests/run-tests-on-instance.sh'" \
109116
&& lcstatus=$? || lcstatus=$?
110117

111118
echo "--> Deleting the temporary instance (${INSTANCE}) ..."

0 commit comments

Comments
 (0)