From: norbert.bizet Date: Tue, 26 Jul 2022 09:44:58 +0000 (-0400) Subject: cloud: test default object tier X-Git-Tag: Beta-15.0.0~542 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5a07f1c51e5653a886075fa87f57692708a64a0;p=thirdparty%2Fbacula.git cloud: test default object tier --- diff --git a/regress/tests/cloud-object-tier-test b/regress/tests/cloud-object-tier-test new file mode 100755 index 000000000..1c9a29fb9 --- /dev/null +++ b/regress/tests/cloud-object-tier-test @@ -0,0 +1,93 @@ +#!/bin/bash +# +# Copyright (C) 2000-2021 Kern Sibbald +# Copyright (C) 2021-2022 Bacula Systems SA +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Cloud test. We run backups and restore with the "truncate cache" command in-between +# +TestName="cloud-object-tier-test" +JobName=NightlySave +. scripts/functions + +require_cloud + +#config is required for cloud cleanup +scripts/copy-test-confs +scripts/cleanup + +FORCE_FILE_SET=${FORCE_FILE_SET:-"${cwd}/build"} +echo "$FORCE_FILE_SET" >${cwd}/tmp/file-list + +start_test + +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "MaximumPartSize", "10000000", "Device")' +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "MaximumUploadBandwidth", "4MB/s", "Cloud")' +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "MaximumDownloadBandwidth", "4MB/s", "Cloud")' + +# {"S3Standard", S3_STANDARD}, +# {"S3StandardIA", S3_STANDARD_IA}, +# {"S3IntelligentTiering", S3_INTELLIGENT_TIERING}, +# {"S3OneZoneIA", S3_ONE_ZONE_IA}, +# {"S3GlacierInstantRetrieval", S3_GLACIER_INSTANT_RETRIEVAL}, +# {"S3GlacierFlexibleRetrieval", S3_GLACIER_FLEXIBLE_RETRIEVAL}, +# {"S3GlacierDeepArchive", S3_GLACIER_DEEP_ARCHIVE}, +# {"S3Rrs", S3_RRS}, + +declare -A tiers +tiers[0]=S3Standard +tiers[1]=S3StandardIA +tiers[2]=S3IntelligentTiering +tiers[3]=S3OneZoneIA +tiers[4]=S3GlacierInstantRetrieval +tiers[5]=S3GlacierFlexibleRetrieval +tiers[6]=S3GlacierDeepArchive +tiers[7]=S3Rrs + +test_tier() +{ +#$1 : tier_index +#$2 : tier value + +echo " == checking tier[$1]: $2 ==" + +$bperl -e 'add_attribute("$conf/bacula-sd.conf", "ObjectsDefaultTier", "'$2'", "Cloud")' + +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out ${cwd}/tmp/log$1.out +setdebug tags=cloud level=50 trace=1 storage +label storage=File volume=Vol$1 +END_OF_DATA + +# do label +run_bacula + +#cat <${cwd}/tmp/bconcmds +#run job=$JobName level=Full yes +#wait +#messages +#END_OF_DATA + +#run_bconsole + +sleep 2 +check_for_zombie_jobs storage=File +stop_bacula + +# must check if the versioned part has been cleaned up +grep "objects_default_tier: $1" $working/*-sd.trace > /dev/null +if test $? -ne 0; then + echo "Error: could not find correct tier $2" + estat=1 +else + echo "tier $2=$1 OK." +fi +} + +estat = 0 + +for key in "${!tiers[@]}"; do test_tier $key ${tiers[$key]}; done + +end_test