Skip to content

Commit

Permalink
Merge branch 'green/automated-test-versions' of github.com:storj/stor…
Browse files Browse the repository at this point in the history
…j into green/automated-test-versions
  • Loading branch information
mobyvb committed Dec 11, 2019
2 parents e81cfdd + 4b08761 commit 97af2da
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 175 deletions.
13 changes: 9 additions & 4 deletions scripts/test-sim-versions.sh
Expand Up @@ -24,13 +24,13 @@ populates_sno_versions(){
# in stage 1: satellite and storagenode use latest release version, uplink uses all highest point release from all major releases starting from v0.15
# in stage 2: satellite core uses latest release version and satellite api uses master. Storage nodes are splited into half on latest release version and half on master. Uplink uses the all versions from stage 1 plus master
current_release_version=$(git describe --tags `git rev-list --tags --max-count=1`)
majorReleaseTags=$(git tag -l --sort -version:refname | sort -k2,2 -t'.' --unique | grep -e "^v0\.\(1[5-9]\)\|2[2-9]")
major_release_tags=$(git tag -l --sort -version:refname | sort -k2,2 -t'.' --unique | grep -e "^v0\.\(1[5-9]\)\|2[2-9]")
stage1_sat_version=$current_release_version
stage1_uplink_versions=$majorReleaseTags
stage1_uplink_versions=$major_release_tags
stage1_storagenode_versions=$(populates_sno_versions $current_release_version 10)
# TODO separate satellite version into satellite api version and satellite core verion
stage2_sat_version="master"
stage2_uplink_versions=$majorReleaseTags\ "master"
stage2_uplink_versions=$major_release_tags\ "master"
stage2_storagenode_versions=$(populates_sno_versions $current_release_version 5)\ $(populates_sno_versions "master" 5)

echo "stage1_sat_version" $stage1_sat_version
Expand All @@ -54,7 +54,12 @@ replace_in_file(){
local src="$1"
local dest="$2"
local path=$3
sed -i "s#${src}#${dest}#g" "${path}"
case "$OSTYPE" in
darwin*)
sed -i '' "s#${src}#${dest}#g" "${path}" ;;
*)
sed -i "s#${src}#${dest}#g" "${path}" ;;
esac
}


Expand Down
156 changes: 0 additions & 156 deletions scripts/test-versions-custom-ul-cfg.sh

This file was deleted.

38 changes: 23 additions & 15 deletions scripts/test-versions.sh
@@ -1,4 +1,5 @@
#!/usr/bin/env bash

set -ueo pipefail

main_cfg_dir=$1
Expand Down Expand Up @@ -28,11 +29,18 @@ echo "Begin test-versions.sh, storj-sim config directory:" ${main_cfg_dir}
echo "which storj-sim: $(which storj-sim)"
# shasum $(which storj-sim)

if [ ! -d ${main_cfg_dir}/uplink ]; then
mkdir -p ${main_cfg_dir}/uplink
api_key=$(storj-sim --config-dir=$main_cfg_dir network env GATEWAY_0_API_KEY)
sat_addr=$(storj-sim --config-dir=$main_cfg_dir network env SATELLITE_0_ADDR)
uplink setup --non-interactive --api-key="$api_key" --satellite-addr="$sat_addr" --config-dir="${main_cfg_dir}/uplink" --enc.encryption-key="TestEncKey"
fi
echo -e "\nConfig directory for uplink:"
echo "${main_cfg_dir}/gateway/0"
echo "${main_cfg_dir}/uplink"
echo "which uplink: $(which uplink)"
echo "Shasum for uplink:"
shasum $(which uplink)

# uplink version --config-dir "${main_cfg_dir}/gateway/0/"

echo -e "\nConfig directory for satellite:"
Expand All @@ -58,15 +66,15 @@ if [[ "$command" == "upload" ]]; then
download_dst_dir=${stage1_dst_dir}/${uplink_version}
mkdir -p "$download_dst_dir"

uplink --config-dir "${main_cfg_dir}/gateway/0" mb "sj://$bucket_name/"
uplink mb "sj://$bucket_name/" --config-dir="${main_cfg_dir}/uplink"

uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "${test_files_dir}/small-upload-testfile" "sj://$bucket_name/"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "${test_files_dir}/big-upload-testfile" "sj://$bucket_name/"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "${test_files_dir}/multisegment-upload-testfile" "sj://$bucket_name/"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "${test_files_dir}/small-upload-testfile" "sj://$bucket_name/"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "${test_files_dir}/big-upload-testfile" "sj://$bucket_name/"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "${test_files_dir}/multisegment-upload-testfile" "sj://$bucket_name/"

uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "sj://$bucket_name/small-upload-testfile" "${download_dst_dir}"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "sj://$bucket_name/big-upload-testfile" "${download_dst_dir}"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "sj://$bucket_name/multisegment-upload-testfile" "${download_dst_dir}"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "sj://$bucket_name/small-upload-testfile" "${download_dst_dir}"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "sj://$bucket_name/big-upload-testfile" "${download_dst_dir}"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "sj://$bucket_name/multisegment-upload-testfile" "${download_dst_dir}"

if cmp "${test_files_dir}/small-upload-testfile" "${download_dst_dir}/small-upload-testfile"
then
Expand Down Expand Up @@ -105,9 +113,9 @@ if [[ "$command" == "download" ]]; then

echo "bucket name: ${bucket_name}"
echo "download folder name: ${download_dst_dir}"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "sj://$bucket_name/small-upload-testfile" "${download_dst_dir}"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "sj://$bucket_name/big-upload-testfile" "${download_dst_dir}"
uplink --config-dir "${main_cfg_dir}/gateway/0" cp --progress=false "sj://$bucket_name/multisegment-upload-testfile" "${download_dst_dir}"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "sj://$bucket_name/small-upload-testfile" "${download_dst_dir}"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "sj://$bucket_name/big-upload-testfile" "${download_dst_dir}"
uplink cp --config-dir="${main_cfg_dir}/uplink" --progress=false "sj://$bucket_name/multisegment-upload-testfile" "${download_dst_dir}"

if cmp "${original_dst_dir}/small-upload-testfile" "${download_dst_dir}/small-upload-testfile"
then
Expand Down Expand Up @@ -139,10 +147,10 @@ if [[ "$command" == "cleanup" ]]; then
uplink_versions=$3
for ul_version in ${uplink_versions}; do
bucket_name=${bucket}-${ul_version}
uplink --config-dir "${main_cfg_dir}/gateway/0" rm "sj://$bucket_name/small-upload-testfile"
uplink --config-dir "${main_cfg_dir}/gateway/0" rm "sj://$bucket_name/big-upload-testfile"
uplink --config-dir "${main_cfg_dir}/gateway/0" rm "sj://$bucket_name/multisegment-upload-testfile"
uplink --config-dir "${main_cfg_dir}/gateway/0" rb "sj://$bucket_name"
uplink rm --config-dir="${main_cfg_dir}/uplink" "sj://$bucket_name/small-upload-testfile"
uplink rm --config-dir="${main_cfg_dir}/uplink" "sj://$bucket_name/big-upload-testfile"
uplink rm --config-dir="${main_cfg_dir}/uplink" "sj://$bucket_name/multisegment-upload-testfile"
uplink rb --config-dir="${main_cfg_dir}/uplink" "sj://$bucket_name"
done
fi

Expand Down

0 comments on commit 97af2da

Please sign in to comment.