upgrades: leftovers in the avatars storage is not important, ignore

This commit is contained in:
Twenty Panda 2024-03-14 15:05:49 +07:00 committed by p
parent dcab318b4a
commit aa83694fd7

View file

@ -12,11 +12,29 @@ function fixture_get_paths_s3() {
local path=$1 local path=$1
( (
echo -n $path/ mc ls --quiet --recursive testS3/$path | sed -e "s|.* |$path/|"
mc ls --quiet --recursive testS3/$path | sed -e 's/.* //'
) > $DIR/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() { function fixture_get_paths_local() {
local path=$1 local path=$1
local work_path=$DIR/forgejo-work-path local work_path=$DIR/forgejo-work-path
@ -101,9 +119,7 @@ function fixture_avatars_create() {
} }
function fixture_avatars_assert_s3() { function fixture_avatars_assert_s3() {
local filename=$(fixture_get_one_path s3 forgejo/avatars) fixture_content_search_s3 forgejo/avatars "$ONEPIXEL"
local content=$(mc cat testS3/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
} }
function fixture_avatars_assert_local() { function fixture_avatars_assert_local() {