Skip to content

Commit

Permalink
test: prepare for upgarde test repositories
Browse files Browse the repository at this point in the history
Signed-off-by: Jiang Xin <[email protected]>
  • Loading branch information
jiangxin committed Apr 24, 2024
1 parent 6838591 commit 4a28650
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions test/sharness.d/0020-create-test-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,47 @@ create_test_repository () {
fi

# Download git.tgz
for gitver in 2.31.1 2.36.0
versions="2.31.1 2.36.0"
for gitver in $versions
do
if test ! -f "${TEST_DIRECTORY}/git-$gitver.tar"
then
wget -O "${TEST_DIRECTORY}/git-$gitver.tar.gz" \
--progress=dot:mega \
https://mirrors.edge.kernel.org/pub/software/scm/git/git-$gitver.tar.gz &&
(
wget -O "${TEST_DIRECTORY}/git-$gitver.tar.gz" \
--progress=dot:mega \
https://mirrors.edge.kernel.org/pub/software/scm/git/git-$gitver.tar.gz ||
wget -O "${TEST_DIRECTORY}/git-$gitver.tar.gz" \
--progress=dot:mega \
https://github.com/git/git/archive/refs/tags/v$gitver.tar.gz
) &&
gunzip "${TEST_DIRECTORY}/git-$gitver.tar.gz"
if test $? -ne 0
then
echo >&2 "ERROR: fail to download or unzip git-$gitver.tar.gz"
return 1
fi
wget -O "${TEST_DIRECTORY}/git-$gitver.tar.sign" \
https://mirrors.edge.kernel.org/pub/software/scm/git/git-$gitver.tar.sign &&
gpg --verify "${TEST_DIRECTORY}/git-$gitver.tar.sign"
if test $? -ne 0
fi &&
if wget -O "${TEST_DIRECTORY}/git-$gitver.tar.sign" \
https://mirrors.edge.kernel.org/pub/software/scm/git/git-$gitver.tar.sign
then
echo >&2 "WARNING: cannot verify the signature of the download git package"
gpg --verify "${TEST_DIRECTORY}/git-$gitver.tar.sign"
if test $? -ne 0
then
echo >&2 "ERROR: cannot verify the signature of the download git package" &&
return 1
fi
fi
fi
done

# Remove whole shared repository
if test -d "$PO_HELPER_TEST_REPOSITORY"
then
echo >&2 "Will recreate shared repository in $PO_HELPER_TEST_REPOSITORY"
echo >&2 "Will recreate shared repository in $PO_HELPER_TEST_REPOSITORY" &&
rm -rf "$PO_HELPER_TEST_REPOSITORY"
fi

# Start to create shared repository
create_test_repository_real 2.31.1 2.36.0 &&
create_test_repository_real $versions &&
echo ${PO_HELPER_TEST_REPOSITORY_VERSION} >${PO_HELPER_TEST_REPOSITORY_VERSION_FILE} &&
rm -f "${PO_HELPER_TEST_REPOSITORY}.lock"
}
Expand Down

0 comments on commit 4a28650

Please sign in to comment.