summaryrefslogtreecommitdiff
path: root/tests/test-prune.sh
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2018-03-05 10:56:45 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-05 16:58:12 +0000
commit733c0498dca8926e9078563240bd06a488fcd527 (patch)
tree0a23ed6e5fe3d0565b5289102231e593e81cf7fa /tests/test-prune.sh
parent1214395f0e08c9e895e0983edaee4648b07ec69c (diff)
downloadostree-733c0498dca8926e9078563240bd06a488fcd527.tar.gz
lib/repo: Do account for size with prune --no-prune
I think this got changed in a refactor. We definitely want to total up the amount of space that *would* be freed even with `--no-prune` AKA `OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE`. It's actually a bit terrifying this is apparently the first test case for the `--no-prune` option... Closes: https://github.com/ostreedev/ostree/issues/1480 Closes: #1483 Approved by: jlebon
Diffstat (limited to 'tests/test-prune.sh')
-rwxr-xr-xtests/test-prune.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test-prune.sh b/tests/test-prune.sh
index 0f083221..7de372c8 100755
--- a/tests/test-prune.sh
+++ b/tests/test-prune.sh
@@ -52,6 +52,13 @@ assert_repo_has_n_commits() {
assert_streq "$(find ${repo}/objects -name '*.commit' | wc -l)" "${count}"
}
+# Test --no-prune
+objectcount_orig=$(find repo/objects | wc -l)
+${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=0 --no-prune | tee noprune.txt
+assert_file_has_content noprune.txt 'Would delete: [1-9][0-9]* objects, freeing [1-9][0-9]*'
+objectcount_new=$(find repo/objects | wc -l)
+assert_streq "${objectcount_orig}" "${objectcount_new}"
+
${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=2 -v
assert_repo_has_n_commits repo 3
find repo/objects -name '*.tombstone-commit' | wc -l > tombstonecommitcount