Skip to content

Commit

Permalink
testversions: skip some downloads for older uplinks
Browse files Browse the repository at this point in the history
uplink command versions >= 1.48.0 always do multipart
uploads which cannot be downloaded by any of the
versions in the test < v1.27.6. so skip those tests.

Change-Id: I9644afbd14bfce9facfd87644d132f7d66367d62
  • Loading branch information
zeebo authored and jtolio committed Feb 22, 2022
1 parent ac5f97a commit 863b01b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/tests/testversions/test-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ test_files_dir="${main_cfg_dir}/testfiles"
stage1_dst_dir="${main_cfg_dir}/stage1"
stage2_dst_dir="${main_cfg_dir}/stage2"

# version_ge returns true if version $1 is greater than or equal to $2
version_ge(){
[ "$( ( echo "$1"; echo "$2" ) | sort -V | head -n 1 )" = "$2" ]
}

replace_in_file(){
local src="$1"
local dest="$2"
Expand Down Expand Up @@ -144,6 +149,16 @@ if [[ "$command" == "download" ]]; then

# download all uploaded files from stage 1 with currently selected uplink
for suffix in ${existing_bucket_name_suffixes}; do
# skip downloads for uplink versions older than v1.27.6 against buckets
# that are v1.48.0 or later because the newer uplinks always upload with
# multipart uploads and older uplinks cannot download those.
if [ "$uplink_version" != "main" ] && \
! version_ge "$uplink_version" "v1.27.6" && \
version_ge "$suffix" "v1.48.0"; then
echo "Skipping $uplink_version downloading $suffix"
continue
fi

bucket_name=${bucket}-${suffix}
original_dst_dir=${stage1_dst_dir}/${suffix}
download_dst_dir=${stage2_dst_dir}/${suffix}
Expand Down

0 comments on commit 863b01b

Please sign in to comment.