summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-11 11:01:45 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-11 15:17:16 +0100
commit55fc744a5dcbd839a85c3437de3550da9e29eea3 (patch)
treeb709e027dda5f80551695a5bb092fae8bb22bf37
parent20d105a65d305c724948ce389654c74cacac013c (diff)
downloadjustbuild-55fc744a5dcbd839a85c3437de3550da9e29eea3.tar.gz
Extend gc end-to-end test to cover --no-rotate
... verifying that - emphemeral directories are removed, - left-over remove-me directories are removed, and - the available content of CAS and cache are not affected.
-rw-r--r--test/end-to-end/gc/basic.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/end-to-end/gc/basic.sh b/test/end-to-end/gc/basic.sh
index 28552885..9db35002 100644
--- a/test/end-to-end/gc/basic.sh
+++ b/test/end-to-end/gc/basic.sh
@@ -80,6 +80,26 @@ rm -rf "${TOOLS_DIR}"
wc -c "${OUT}/out-large/out.txt"
test $(cat "${OUT}/out-large/out.txt" | wc -c) -gt 100000
+# Now test non-rotating gc; this does not affect how far the
+# cache. At the end, we also repeat it serveral time to demontstrate
+# that things don't fall out of cache.
+
+LEFT_OVER_REMOVE_DIR="${LBR}/protocol-dependent/remove-me-$$-xxx"
+EPHEMERAL_DIR="${LBR}/protocol-dependent/generation-0/ephemeral"
+
+mkdir -p "${LEFT_OVER_REMOVE_DIR}/xxx"
+mkdir -p "${EPHEMERAL_DIR}/xxx"
+
+"${JUST}" gc --local-build-root "${LBR}" --no-rotate 2>&1
+
+echo "Checking that ${EPHEMERAL_DIR} was removed"
+[ -e "${EPHEMERAL_DIR}" ] && exit 1 || :
+echo "Checking that ${LEFT_OVER_REMOVE_DIR} was removed"
+[ -e "${LEFT_OVER_REMOVE_DIR}" ] && exit 1 || :
+
+"${JUST}" gc --local-build-root "${LBR}" --no-rotate 2>&1
+"${JUST}" gc --local-build-root "${LBR}" --no-rotate 2>&1
+
# collect garbage
"${JUST}" gc --local-build-root "${LBR}" 2>&1