From: Ilya Dryomov Date: Tue, 11 Jan 2022 12:13:01 +0000 (+0100) Subject: qa/run_xfstests_qemu.sh: harden against wget failures X-Git-Tag: v17.1.0~58^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=387be947948ff1dd40e88ae5288b9a52c7cde403;p=ceph.git qa/run_xfstests_qemu.sh: harden against wget failures 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 --- diff --git a/qa/run_xfstests_qemu.sh b/qa/run_xfstests_qemu.sh index 40300cea6fef3..157f58aa2d503 100644 --- a/qa/run_xfstests_qemu.sh +++ b/qa/run_xfstests_qemu.sh @@ -13,7 +13,11 @@ SCRIPT="run_xfstests-obsolete.sh" 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