From b26ad1783d64d18a708c558fd4e1695a4bb086ec Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Mon, 16 Jun 2025 23:09:03 -0300 Subject: [PATCH] ci/android: Disable zipbomb detection for CTS The CTS is almost 9GB, when we unzip it locally (on Fedora 41 at least) it is partially extracted because it is falsely detected as a zipbomb. Signed-off-by: Guilherme Gallo Part-of: --- .gitlab-ci/container/debian/x86_64_test-android.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/container/debian/x86_64_test-android.sh b/.gitlab-ci/container/debian/x86_64_test-android.sh index 9a5e8f6cb68..4cdfea852a1 100755 --- a/.gitlab-ci/container/debian/x86_64_test-android.sh +++ b/.gitlab-ci/container/debian/x86_64_test-android.sh @@ -178,13 +178,20 @@ if FOUND_ARTIFACT_URL="$(find_s3_project_artifact "${ARTIFACT_PATH}")"; then else echo "No cached CTS found, downloading from Google and uploading to S3..." curl-with-retry --remote-name "https://dl.google.com/dl/android/cts/${CTS_FILENAME}.zip" - unzip -q -d / "${CTS_FILENAME}.zip" + + # Disable zipbomb detection, because the CTS zip file is too big + # At least locally, it is detected as a zipbomb + UNZIP_DISABLE_ZIPBOMB_DETECTION=TRUE \ + unzip -q -d / "${CTS_FILENAME}.zip" rm "${CTS_FILENAME}.zip" # Keep only the interesting tests to save space # shellcheck disable=SC2086 # we want word splitting ANDROID_CTS_MODULES_KEEP_EXPRESSION=$(printf "%s|" $ANDROID_CTS_MODULES | sed -e 's/|$//g') find /android-cts/testcases/ -mindepth 1 -type d | grep -v -E "$ANDROID_CTS_MODULES_KEEP_EXPRESSION" | xargs rm -rf + + # Using zstd compressed tarball instead of zip, the compression ratio is almost the same, but + # the extraction is faster, also LAVA overlays don't support zip compression. tar --zstd -cf "${CTS_FILENAME}.tar.zst" /android-cts ci-fairy s3cp --token-file "${S3_JWT_FILE}" "${CTS_FILENAME}.tar.zst" \ "https://${S3_BASE_PATH}/${CI_PROJECT_PATH}/${ARTIFACT_PATH}"