[ostree] tests: add test for ostree prune --delete-commit
- From: Giuseppe Scrivano <gscrivano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] tests: add test for ostree prune --delete-commit
- Date: Mon, 16 Nov 2015 10:37:31 +0000 (UTC)
commit daa6f150c43f09d057fbadbdba44366c7dd0cf41
Author: Giuseppe Scrivano <gscrivan redhat com>
Date: Thu Nov 5 13:34:00 2015 +0100
tests: add test for ostree prune --delete-commit
Signed-off-by: Giuseppe Scrivano <gscrivan redhat com>
tests/test-prune.sh | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/tests/test-prune.sh b/tests/test-prune.sh
index fa9e0e8..c73a5ca 100644
--- a/tests/test-prune.sh
+++ b/tests/test-prune.sh
@@ -42,15 +42,15 @@ done
${CMD_PREFIX} ostree --repo=repo pull --depth=-1 origin test
-${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=1 -v
+${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=2 -v
find repo | grep \.commit$ | wc -l > commitcount
-assert_file_has_content commitcount "^2$"
+assert_file_has_content commitcount "^3$"
find repo/objects -name '*.tombstone-commit' | wc -l > tombstonecommitcount
assert_file_has_content tombstonecommitcount "^0$"
-${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=0 -v
+${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=1 -v
find repo | grep \.commit$ | wc -l > commitcount
-assert_file_has_content commitcount "^1$"
+assert_file_has_content commitcount "^2$"
find repo/objects -name '*.tombstone-commit' | wc -l > tombstonecommitcount
assert_file_has_content tombstonecommitcount "^0$"
@@ -77,4 +77,9 @@ ${CMD_PREFIX} ostree --repo=repo pull --depth=-1 origin test
find repo/objects -name '*.tombstone-commit' | wc -l > tombstonecommitcount
assert_file_has_content tombstonecommitcount "^0$"
+COMMIT_TO_DELETE=$(${CMD_PREFIX} ostree --repo=repo log test | grep ^commit | cut -f 2 -d' ' | tail -n 1)
+${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$"
+
echo "ok prune"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]