upgrades: leftovers in the avatars storage is not important, ignore
This commit is contained in:
parent
dcab318b4a
commit
aa83694fd7
1 changed files with 21 additions and 5 deletions
|
@ -12,11 +12,29 @@ function fixture_get_paths_s3() {
|
|||
local path=$1
|
||||
|
||||
(
|
||||
echo -n $path/
|
||||
mc ls --quiet --recursive testS3/$path | sed -e 's/.* //'
|
||||
mc ls --quiet --recursive testS3/$path | sed -e "s|.* |$path/|"
|
||||
) > $DIR/path
|
||||
}
|
||||
|
||||
function fixture_content_search_s3() {
|
||||
local path="$1"
|
||||
local expected="$2"
|
||||
|
||||
fixture_get_paths_s3 $path
|
||||
if test $(wc -l < $DIR/path) -lt 1 ; then
|
||||
echo expected at least one but got "'$(cat $DIR/path)'"
|
||||
return 1
|
||||
fi
|
||||
for filename in $(cat $DIR/path) ; do
|
||||
local content=$(mc cat testS3/$filename | base64 -w0)
|
||||
if test "$content" = "$expected" ; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
echo nothing in $path found with the expected content "$expected"
|
||||
return 1
|
||||
}
|
||||
|
||||
function fixture_get_paths_local() {
|
||||
local path=$1
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
@ -101,9 +119,7 @@ function fixture_avatars_create() {
|
|||
}
|
||||
|
||||
function fixture_avatars_assert_s3() {
|
||||
local filename=$(fixture_get_one_path s3 forgejo/avatars)
|
||||
local content=$(mc cat testS3/$filename | base64 -w0)
|
||||
test "$content" = "$ONEPIXEL"
|
||||
fixture_content_search_s3 forgejo/avatars "$ONEPIXEL"
|
||||
}
|
||||
|
||||
function fixture_avatars_assert_local() {
|
||||
|
|
Loading…
Add table
Reference in a new issue