summaryrefslogtreecommitdiff
path: root/tests/test-prune.sh
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2015-11-09 11:07:16 +0000
committerGiuseppe Scrivano <gscrivan@redhat.com>2015-11-16 11:07:55 +0100
commit11bc9e58c1a6da8cb6053ea84f2d9e622838bcb2 (patch)
tree19bda345cd6f49b42488d09d7dd504524c237503 /tests/test-prune.sh
parent68f70d8e747d64a2b5ef525c9fec95c258eeabaa (diff)
downloadostree-11bc9e58c1a6da8cb6053ea84f2d9e622838bcb2.tar.gz
tests: add tests for prune --keep-younger-than=DATE
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'tests/test-prune.sh')
-rw-r--r--tests/test-prune.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-prune.sh b/tests/test-prune.sh
index c73a5cae..a4b6fc20 100644
--- a/tests/test-prune.sh
+++ b/tests/test-prune.sh
@@ -82,4 +82,15 @@ ${CMD_PREFIX} ostree --repo=repo prune --delete-commit=$COMMIT_TO_DELETE
find repo/objects -name '*.tombstone-commit' | wc -l > tombstonecommitcount
assert_file_has_content tombstonecommitcount "^1$"
+${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=0 -v
+find repo/objects -name '*.commit' | wc -l > commitcount
+assert_file_has_content commitcount "^1$"
+${CMD_PREFIX} ostree --repo=repo commit --branch=test -m test -s test tree --timestamp="2010-10-29 12:43:29 +0000"
+${CMD_PREFIX} ostree --repo=repo commit --branch=test -m test -s test tree --timestamp="2005-10-29 12:43:29 +0000"
+find repo/objects -name '*.commit' | wc -l > commitcount
+assert_file_has_content commitcount "^3$"
+${CMD_PREFIX} ostree --repo=repo prune --keep-younger-than="2015-10-29 12:43:29 +0000"
+find repo/objects -name '*.commit' | wc -l > commitcount
+assert_file_has_content commitcount "^1$"
+
echo "ok prune"