From 56303e02881731a88eaae6324c0215fece9baabe Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 28 Sep 2023 16:40:33 +0200 Subject: just-mr fetch: Add handling of --fetch-absent option --- test/end-to-end/just-mr/fetch.sh | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'test') diff --git a/test/end-to-end/just-mr/fetch.sh b/test/end-to-end/just-mr/fetch.sh index 323db6d1..c216fd1c 100644 --- a/test/end-to-end/just-mr/fetch.sh +++ b/test/end-to-end/just-mr/fetch.sh @@ -73,4 +73,46 @@ newfoocontent=$(git hash-object "${DISTDIR}/foo-1.2.3.tar") echo "Foo archive has now content ${newfoocontent}" test "${newfoocontent}" = "${foocontent}" + +# Verify we can fetch the same archive if marked absent using --fetch-absent +cat > repos.json <&1 + +# Remove distdir content +rm -rf "${DISTDIR}" +mkdir -p "${DISTDIR}" + +# Ask just-mr to fetch to the empty distdir +"${JUST_MR}" --norc --local-build-root "${LBR}" --fetch-absent fetch -o "${DISTDIR}" 2>&1 + +# Verify that the correct file is stored in the distdir +test -f "${DISTDIR}/foo-1.2.3.tar" +newfoocontent=$(git hash-object "${DISTDIR}/foo-1.2.3.tar") +echo "Foo archive has now content ${newfoocontent}" +test "${newfoocontent}" = "${foocontent}" + echo OK -- cgit v1.2.3