]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: simplify docker rsync & support worktrees
authorDavid Lamparter <equinox@diac24.net>
Tue, 16 Mar 2021 05:11:15 +0000 (06:11 +0100)
committerDavid Lamparter <equinox@diac24.net>
Wed, 17 Mar 2021 12:42:20 +0000 (13:42 +0100)
The previous, more complex mechanism failed to take into account that
git worktrees only have a stub .git file & copying the worktree itself
is not enough.  Just extract a file list beforehand & don't bother with
git inside the container.

Signed-off-by: David Lamparter <equinox@diac24.net>
tests/topotests/docker/frr-topotests.sh
tests/topotests/docker/inner/compile_frr.sh
tests/topotests/docker/inner/funcs.sh

index d25856ea62eac5a84a8534066082a6d4d10d5da1..9ef59b3bbcd6e1db6b6a81cb0b80c6faf61bb5de 100755 (executable)
@@ -132,6 +132,7 @@ if [ -z "$TOPOTEST_FRR" ]; then
                echo "frr-topotests only works if you have your tree in git." >&2
                exit 1
        fi
+       git -C "$TOPOTEST_FRR" ls-files -z > "${TOPOTEST_LOGS}/git-ls-files"
 fi
 
 if [ -z "$TOPOTEST_BUILDCACHE" ]; then
index dee0ec81181fe8a4ec1d2154a47f34f1e44e033d..495beaf3cc401d9946772183f68fdf8e164955fd 100755 (executable)
@@ -34,19 +34,15 @@ CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 
 if [ "${TOPOTEST_CLEAN}" != "0" ]; then
        log_info "Cleaning FRR builddir..."
-       rm -rf $FRR_SYNC_DIR $FRR_BUILD_DIR &> /dev/null
+       rm -rf $FRR_BUILD_DIR &> /dev/null
 fi
 
 log_info "Syncing FRR source with host..."
-mkdir -p $FRR_SYNC_DIR
+mkdir -p $FRR_BUILD_DIR
 rsync -a --info=progress2 \
-       --exclude '*.o' \
-       --exclude '*.lo'\
+       --from0 --files-from=/tmp/git-ls-files \
        --chown root:root \
-       $FRR_HOST_DIR/. $FRR_SYNC_DIR/
-(cd $FRR_SYNC_DIR && git clean -xdf > /dev/null)
-mkdir -p $FRR_BUILD_DIR
-rsync -a --info=progress2 --chown root:root $FRR_SYNC_DIR/. $FRR_BUILD_DIR/
+       $FRR_HOST_DIR/. $FRR_BUILD_DIR/
 
 cd "$FRR_BUILD_DIR" || \
        log_fatal "failed to find frr directory"
index acb8b55e970b63b58bdcd157bd004709ae35a135..d78d5006bc2d61b45cc8e67edc68f6ca5a9e1048 100755 (executable)
@@ -23,7 +23,6 @@
 # SOFTWARE.
 
 FRR_HOST_DIR=/root/host-frr
-FRR_SYNC_DIR=/root/persist/frr-sync
 FRR_BUILD_DIR=/root/persist/frr-build
 
 if [ ! -L "/root/frr" ]; then