]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/run_xfstests_qemu.sh: harden against wget failures
authorIlya Dryomov <idryomov@gmail.com>
Tue, 11 Jan 2022 12:13:01 +0000 (13:13 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 14 Jan 2022 11:35:35 +0000 (12:35 +0100)
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)

qa/run_xfstests_qemu.sh

index 40300cea6fef3b2df632eb08039a603565a5019b..157f58aa2d503e1f8f71ab702a72a7c91ad19dd8 100644 (file)
@@ -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