Skip to content

Commit

Permalink
zip corpus files
Browse files Browse the repository at this point in the history
  • Loading branch information
jouho committed Aug 2, 2024
1 parent b9a97bc commit 03b402f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/fuzz/runFuzzTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ if [ "$CORPUS_UPLOAD_LOC" != "none" ]; then
# The LD variables interferes with certificate validation when communicating with AWS S3.
unset LD_PRELOAD
unset LD_LIBRARY_PATH
printf "Copying corpus files from S3 bucket...\n"
aws s3 sync $CORPUS_UPLOAD_LOC/${TEST_NAME}/ "${TEMP_CORPUS_DIR}"
if aws s3 ls "${CORPUS_UPLOAD_LOC}/${TEST_NAME}/corpus.zip" > /dev/null 2>&1; then
echo "corpus.zip found, downloading from S3 bucket and unzipping..."
# Download corpus.zip
aws s3 cp "${CORPUS_UPLOAD_LOC}/${TEST_NAME}/corpus.zip" "${TEMP_CORPUS_DIR}/corpus.zip"
# Unzip the file
unzip -o "${TEMP_CORPUS_DIR}/corpus.zip" -d "${TEMP_CORPUS_DIR}"
)
else
cp -r ./corpus/${TEST_NAME}/. "${TEMP_CORPUS_DIR}"
Expand Down Expand Up @@ -225,8 +229,11 @@ then
unset LD_PRELOAD
unset LD_LIBRARY_PATH
if [ "$CORPUS_UPLOAD_LOC" != "none" ]; then
printf "Uploading corpus files to S3 bucket...\n"
aws s3 sync ./corpus/${TEST_NAME}/ $CORPUS_UPLOAD_LOC/${TEST_NAME}/
printf "Zipping corpus files...\n"
zip -r ./corpus/${TEST_NAME}.zip ./corpus/${TEST_NAME}/
printf "Uploading zipped corpus file to S3 bucket...\n"
aws s3 cp ./corpus/${TEST_NAME}.zip $CORPUS_UPLOAD_LOC/${TEST_NAME}/corpus.zip
fi
fi
Expand Down

0 comments on commit 03b402f

Please sign in to comment.