tests: add tests for prune --keep-younger-than=DATE
authorGiuseppe Scrivano <gscrivan@redhat.com>
Mon, 9 Nov 2015 11:07:16 +0000 (11:07 +0000)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Mon, 16 Nov 2015 10:07:55 +0000 (11:07 +0100)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
tests/test-prune.sh

index c73a5cae13776332a098f62dd843bf8b87456ef8..a4b6fc20ff463574923e38d75a4fe9fd6ece7bf9 100644 (file)
@@ -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"