summaryrefslogtreecommitdiff
path: root/tests/futility/test_main.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/futility/test_main.sh')
-rwxr-xr-xtests/futility/test_main.sh52
1 files changed, 27 insertions, 25 deletions
diff --git a/tests/futility/test_main.sh b/tests/futility/test_main.sh
index 2e5f4dc4..725abe3a 100755
--- a/tests/futility/test_main.sh
+++ b/tests/futility/test_main.sh
@@ -10,55 +10,57 @@ TMP="$me.tmp"
cd "$OUTDIR"
# No args returns nonzero exit code
-${FUTILITY} && false
+"${FUTILITY}" && false
# It's weird but okay if the command is a full path.
-${FUTILITY} /fake/path/to/help > "$TMP"
+"${FUTILITY}" /fake/path/to/help > "$TMP"
grep Usage "$TMP"
# Make sure logging does something.
LOG="/tmp/futility.log"
-[ -f ${LOG} ] && mv ${LOG} ${LOG}.backup
-touch ${LOG}
-${FUTILITY} help
-grep ${FUTILITY} ${LOG}
-rm -f ${LOG}
-[ -f ${LOG}.backup ] && mv ${LOG}.backup ${LOG}
+[ -f "${LOG}" ] && mv "${LOG}" "${LOG}.backup"
+touch "${LOG}"
+"${FUTILITY}" help
+grep "${FUTILITY}" "${LOG}"
+rm -f "${LOG}"
+[ -f "${LOG}.backup" ] && mv "${LOG}.backup" "${LOG}"
# Use some known digests to verify that things work...
-DEVKEYS=${SRCDIR}/tests/devkeys
+DEVKEYS="${SRCDIR}/tests/devkeys"
SHA=e78ce746a037837155388a1096212ded04fb86eb
# all progs in the pipelines should work
set -o pipefail
# If it's invoked as the name of a command we know, it should do that command
-ln -sf ${FUTILITY} vbutil_key
-./vbutil_key --unpack ${DEVKEYS}/installer_kernel_data_key.vbpubk | grep ${SHA}
-ln -sf ${FUTILITY} vbutil_keyblock
-./vbutil_keyblock --unpack ${DEVKEYS}/installer_kernel.keyblock | grep ${SHA}
-cp ${FUTILITY} show
-./show ${SCRIPT_DIR}/futility/data/rec_kernel_part.bin | grep ${SHA}
+ln -sf "${FUTILITY}" vbutil_key
+./vbutil_key --unpack "${DEVKEYS}/installer_kernel_data_key.vbpubk" | \
+ grep "${SHA}"
+ln -sf "${FUTILITY}" vbutil_keyblock
+./vbutil_keyblock --unpack "${DEVKEYS}/installer_kernel.keyblock" | \
+ grep "${SHA}"
+cp "${FUTILITY}" show
+./show "${SCRIPT_DIR}/futility/data/rec_kernel_part.bin" | grep "${SHA}"
# If it's invoked by any other name, expect the command to be the first arg.
-ln -sf ${FUTILITY} muggle
-./muggle vbutil_key --unpack ${DEVKEYS}/installer_kernel_data_key.vbpubk \
- | grep ${SHA}
-ln -sf ${FUTILITY} buggle
-./buggle vbutil_keyblock --unpack ${DEVKEYS}/installer_kernel.keyblock \
- | grep ${SHA}
-cp ${FUTILITY} boo
-./boo show ${SCRIPT_DIR}/futility/data/rec_kernel_part.bin | grep ${SHA}
+ln -sf "${FUTILITY}" muggle
+./muggle vbutil_key --unpack "${DEVKEYS}/installer_kernel_data_key.vbpubk" \
+ | grep "${SHA}"
+ln -sf "${FUTILITY}" buggle
+./buggle vbutil_keyblock --unpack "${DEVKEYS}/installer_kernel.keyblock" \
+ | grep "${SHA}"
+cp "${FUTILITY}" boo
+./boo show "${SCRIPT_DIR}/futility/data/rec_kernel_part.bin" | grep "${SHA}"
# we expect the first command fail, but the output to match anyway
set +o pipefail
# If it can't figure out the command at all, it should complain.
-${FUTILITY} muggle | grep Usage:
+"${FUTILITY}" muggle | grep Usage:
./buggle futility | grep Usage:
./boo | grep Usage:
# cleanup
-rm -f ${TMP}* vbutil_key vbutil_keyblock show muggle buggle boo
+rm -f "${TMP}"* vbutil_key vbutil_keyblock show muggle buggle boo
exit 0