ceph/qa/workunits/fs/snaps/snaptest-git-ceph.sh
Xiubo Li c160e972ab qa: retry cloning the ceph.git
The cloning may take a very long time, 2.5 hours for example, usally
it should be done in server minutes. If it really very slow, there
maybe something wrong with the current socket connections, retry it
maybe fixed.

This fixing will timeout the clone command after 30m, and retry it
by doubling the timeout value.

Fixes: https://tracker.ceph.com/issues/50021
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-04-06 16:02:45 +08:00

44 lines
633 B
Bash
Executable File

#!/bin/sh -x
set -e
# try it again if the clone is slow and the second time
retried=false
trap -- 'retry' EXIT
retry() {
rm -rf ceph
# double the timeout value
timeout 3600 git clone git://git.ceph.com/ceph.git
}
rm -rf ceph
timeout 1800 git clone git://git.ceph.com/ceph.git
trap - EXIT
cd ceph
versions=`seq 1 21`
for v in $versions
do
ver="v0.$v"
echo $ver
git reset --hard $ver
mkdir .snap/$ver
done
for v in $versions
do
ver="v0.$v"
echo checking $ver
cd .snap/$ver
git diff --exit-code
cd ../..
done
for v in $versions
do
ver="v0.$v"
rmdir .snap/$ver
done
echo OK