Add volume mount for the repo sync test

This commit is contained in:
sed-i 2022-02-25 11:51:01 -05:00
parent 9780b620c0
commit c3791f59b2
1 changed files with 9 additions and 6 deletions

View File

@ -110,8 +110,9 @@ function clean_work() {
mkdir -p "$WORK"
}
# REPO is the source repo under test.
# REPO and REPO2 are the source repos under test.
REPO="$DIR/repo"
REPO2="${REPO}2"
MAIN_BRANCH="e2e-branch"
function init_repo() {
rm -rf "$REPO"
@ -120,6 +121,9 @@ function init_repo() {
touch "$REPO"/file
git -C "$REPO" add file
git -C "$REPO" commit -aqm "init file"
rm -rf "$REPO2"
cp -r "$REPO" "$REPO2"
}
# ROOT is the volume (usually) used as --root.
@ -156,6 +160,7 @@ function GIT_SYNC() {
-u $(id -u):$(id -g) \
-v "$ROOT":"$ROOT":rw \
-v "$REPO":"$REPO":ro \
-v "$REPO2":"$REPO2":ro \
-v "$WORK":"$WORK":ro \
-v "$(pwd)/slow_git_clone.sh":"$SLOW_GIT_CLONE":ro \
-v "$(pwd)/slow_git_fetch.sh":"$SLOW_GIT_FETCH":ro \
@ -432,14 +437,12 @@ function e2e::repo_sync() {
assert_file_eq "$ROOT"/link/file "$FUNCNAME 1"
# Prepare other repo
OTHER_REPO="${REPO}2"
cp -r "$REPO" "$OTHER_REPO"
echo "$FUNCNAME 2" > "$OTHER_REPO"/file
git -C "$OTHER_REPO" commit -qam "$FUNCNAME 2"
echo "$FUNCNAME 2" > "$REPO2"/file
git -C "$REPO2" commit -qam "$FUNCNAME 2"
# Now sync the other repo
GIT_SYNC \
--repo="file://$OTHER_REPO" \
--repo="file://$REPO2" \
--branch="$MAIN_BRANCH" \
--root="$ROOT" \
--dest="link" \