diff options
author | Daniel Díaz <daniel.diaz@linaro.org> | 2017-02-17 11:24:00 -0600 |
---|---|---|
committer | Daniel Díaz <daniel.diaz@linaro.org> | 2017-02-17 12:06:44 -0600 |
commit | ed2f1e26103f0d07c7ba815aea8eb1784ca5d458 (patch) | |
tree | 451200bdc74a708153bbac09a0c83c70a181bc4a | |
parent | fb5d9f84daecc4a43d1939d52ac22e0123fa1d85 (diff) | |
download | test-definitions-pipe-ed2f1e26103f0d07c7ba815aea8eb1784ca5d458.tar.gz |
cleanup: fix a few shellcheck errors in automated/
Change-Id: If34415c681906aefc6b5b42401ed995e5cdeda11
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
-rwxr-xr-x | automated/linux/openssl/openssl-speed.sh | 4 | ||||
-rwxr-xr-x | automated/linux/optee/optee-xtest.sh | 2 | ||||
-rwxr-xr-x | automated/linux/ui-browser-test/ui-browser-test.sh | 30 |
3 files changed, 19 insertions, 17 deletions
diff --git a/automated/linux/openssl/openssl-speed.sh b/automated/linux/openssl/openssl-speed.sh index 574273b..431ab97 100755 --- a/automated/linux/openssl/openssl-speed.sh +++ b/automated/linux/openssl/openssl-speed.sh @@ -38,8 +38,8 @@ for test in ${cipher_commands}; do case "${test}" in # Parse asymmetric encryption output. rsa2048|dsa2048) - awk -v test_case_id="${test}" 'match($1$2, test_case_id) \ - {printf("%s-sign pass %s sign/s\n", test_case_id, $(NF-1)); \ + awk -v test_case_id="${test}" 'match($1$2, test_case_id) + {printf("%s-sign pass %s sign/s\n", test_case_id, $(NF-1)); printf("%s-verify pass %s verify/s\n", test_case_id, $NF)}' \ "${OUTPUT}/${test}-output.txt" | tee -a "${RESULT_FILE}" ;; diff --git a/automated/linux/optee/optee-xtest.sh b/automated/linux/optee/optee-xtest.sh index 67884dd..f84afe4 100755 --- a/automated/linux/optee/optee-xtest.sh +++ b/automated/linux/optee/optee-xtest.sh @@ -23,7 +23,7 @@ parser() { egrep "^XTEST_TEE_.* (OK|FAILED|SKIPPED)" "${LOG_FILE}" \ > "${OUTPUT}/raw-result.txt" - while read line; do + while read -r line; do test_case=$(echo "${line}" | awk '{print $1}') test_result=$(echo "${line}" | awk '{print $2}') diff --git a/automated/linux/ui-browser-test/ui-browser-test.sh b/automated/linux/ui-browser-test/ui-browser-test.sh index 44e886b..f40cbf9 100755 --- a/automated/linux/ui-browser-test/ui-browser-test.sh +++ b/automated/linux/ui-browser-test/ui-browser-test.sh @@ -59,23 +59,25 @@ install_deps "${pkgs}" "${SKIP_INSTALL}" mkdir -p "${OUTPUT}" dist_name +# shellcheck disable=SC2154 if [ "${dist}" = "debian" ] || [ "${dist}" = "ubuntu" ]; then "${WD}"/install-on-debian.sh else echo "Not a debian machine" fi -# Copy robot test scripts to /tmp -cp -a robot-test-scripts /tmp/ -# Tests should runs by linaro users because X owned by linaro user. -# linaro user can not create output files in /root -# so change directory to /tmp -cd /tmp -# Run as TESTUSER -su "${TESTUSER}" -c "${WD}"/run-robot-tests.sh -# "${UI_BROWSER_TEST_OUTPUT}" directory created by TESTUSER from run-robot-tests.sh -mv "${UI_BROWSER_TEST_OUTPUT}" "${OUTPUT}" -mv robot-test-scripts "${OUTPUT}" -# Parse test results -python "${WD}"/robot-results-parser.py "${OUTPUT}"/"${UI_BROWSER_TEST_OUTPUT}"/output.xml >> "${RESULT_FILE}" -cd - +( + # Copy robot test scripts to /tmp + cp -a robot-test-scripts /tmp/ || error_msg "Could not copy scripts to /tmp" + # Tests should runs by linaro users because X owned by linaro user. + # linaro user can not create output files in /root + # so change directory to /tmp + cd /tmp || error_msg "Could not cd into /tmp" + # Run as TESTUSER + su "${TESTUSER}" -c "${WD}"/run-robot-tests.sh + # "${UI_BROWSER_TEST_OUTPUT}" directory created by TESTUSER from run-robot-tests.sh + mv "${UI_BROWSER_TEST_OUTPUT}" "${OUTPUT}" + mv robot-test-scripts "${OUTPUT}" + # Parse test results + python "${WD}"/robot-results-parser.py "${OUTPUT}"/"${UI_BROWSER_TEST_OUTPUT}"/output.xml >> "${RESULT_FILE}" +) |