If wget fails (e.g. due to a certificate issue), it still creates
an empty file. Then this file is marked executable, ./"${SCRIPT}"
immediately returns 0 and run_xfstests_qemu.sh exits successfully
without running a single xfstest.
This started on Sep 30, 2021 with the expiration of Let's Encrypt
root certificate -- all qemu jobs with "test: qa/run_xfstests_qemu.sh"
just booted the VM for a couple of seconds and reported success.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
387be947948ff1dd40e88ae5288b9a52c7cde403)
cd "${TESTDIR}"
wget -O "${SCRIPT}" "${URL_BASE}/${SCRIPT}"
-chmod +x "${SCRIPT}"
+# mark executable only if the file isn't empty since ./"${SCRIPT}"
+# on an empty file would succeed
+if [[ -s "${SCRIPT}" ]]; then
+ chmod +x "${SCRIPT}"
+fi
# tests excluded fail in the current testing vm regardless of whether
# rbd is used