summaryrefslogtreecommitdiff
path: root/tests/test-oldstyle-partial.sh
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-04-06 14:19:08 -0400
committerColin Walters <walters@verbum.org>2015-05-06 08:07:20 -0400
commit5becd5ccad47fff009c1578fc870ffad66b940af (patch)
treeaba09b96bfdb0cfed877654dd09c359a39d12a3c /tests/test-oldstyle-partial.sh
parent279308b5b95b587a306ab0841ebdd1b7ae4880e0 (diff)
downloadostree-5becd5ccad47fff009c1578fc870ffad66b940af.tar.gz
Teach fsck about partial commits
An OSTree user noticed that `ostree fsck` would produce `missing object` errors in the case of interrupted pulls. It's possible to do e.g. `ostree pull --subpath=/usr/share/rpm ...`, which gets you just that portion of the commit. The use case for this was being able to see what changes would appear in an update before actually downloading all of it. (I think this would be better covered by static deltas, but those aren't final yet, and `--subpath` predates it) Further, `.commitpartial` is used as a successor to the `transaction` symlink for more precise knowledge in the case where a pull was interrupted that we needed to resume scanning. So it makes sense for `ostree fsck` to be aware of it.
Diffstat (limited to 'tests/test-oldstyle-partial.sh')
-rw-r--r--tests/test-oldstyle-partial.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test-oldstyle-partial.sh b/tests/test-oldstyle-partial.sh
new file mode 100644
index 00000000..84460e97
--- /dev/null
+++ b/tests/test-oldstyle-partial.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 Red Hat, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+set -e
+
+. $(dirname $0)/libtest.sh
+
+setup_fake_remote_repo1 "archive-z2"
+
+echo '1..1'
+
+cd ${test_tmpdir}
+rm repo -rf
+mkdir repo
+${CMD_PREFIX} ostree --repo=repo init
+${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
+
+ostree --repo=repo pull origin main --subpath /baz
+ostree fsck --repo=repo >fsck.out
+assert_file_has_content fsck.out 'Verifying content integrity of 0 commit objects'
+assert_file_has_content fsck.out '1 partial commits not verified'