summaryrefslogtreecommitdiff
path: root/tests/test-delta.sh
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2015-01-13 15:09:43 +0100
committerAlexander Larsson <alexl@redhat.com>2015-01-14 14:43:32 +0100
commit5b721a5b08c9dc46c120d5f54783fcd3652a3170 (patch)
tree1f615ab9830d8e4287a7c1c960c14b46f63ce074 /tests/test-delta.sh
parent82ed6c43edeca7ff1cbc464a08dba4a38f248b9a (diff)
downloadostree-5b721a5b08c9dc46c120d5f54783fcd3652a3170.tar.gz
Allow creating and pulling static deltas starting from "empty"
You create these with something like: ostree static-delta generate --empty --to=master These will be automatically used during pull if no previous revision exists in the target repo. These work very much like the normal static deltas except they are named just by the "to" revision. I.e: deltas/94/f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d for a from-scratch to 94f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d delta. https://bugzilla.gnome.org/show_bug.cgi?id=721799
Diffstat (limited to 'tests/test-delta.sh')
-rwxr-xr-xtests/test-delta.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/test-delta.sh b/tests/test-delta.sh
index 175daec2..c5981861 100755
--- a/tests/test-delta.sh
+++ b/tests/test-delta.sh
@@ -55,17 +55,23 @@ function permuteDirectory() {
done
}
+origrev=$(ostree --repo=repo rev-parse test)
+
+ostree --repo=repo static-delta generate --empty --to=${origrev}
+ostree --repo=repo static-delta list | grep ${origrev} || exit 1
+
permuteDirectory 1 files
ostree --repo=repo commit -b test -s test --tree=dir=files
-ostree --repo=repo static-delta list
-origrev=$(ostree --repo=repo rev-parse test^)
newrev=$(ostree --repo=repo rev-parse test)
ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev}
+ostree --repo=repo static-delta list | grep ${origrev}-${newrev} || exit 1
+
origstart=$(echo ${origrev} | dd bs=1 count=2 2>/dev/null)
origend=$(echo ${origrev} | dd bs=1 skip=2 2>/dev/null)
assert_has_dir repo/deltas/${origstart}/${origend}-${newrev}
+assert_has_dir repo/deltas/${origstart}/${origend}
mkdir repo2
ostree --repo=repo2 init --mode=archive-z2
@@ -74,3 +80,9 @@ ostree --repo=repo2 pull-local repo ${origrev}
ostree --repo=repo2 static-delta apply-offline repo/deltas/${origstart}/${origend}-${newrev}
ostree --repo=repo2 fsck
ostree --repo=repo2 show ${newrev}
+
+mkdir repo3
+ostree --repo=repo3 init --mode=archive-z2
+ostree --repo=repo3 static-delta apply-offline repo/deltas/${origstart}/${origend}
+ostree --repo=repo3 fsck
+ostree --repo=repo3 show ${origrev}