upgrade: Add --override-commit=CHECKSUM option

Adds an entry to the origin file to force the OstreeSysrootUpgrader to
pull and deploy the given checksum.

  [origin]
  override-commit=CHECKSUM

If the option is not given, any such entry is explicitly removed from
the origin file to ensure we upgrade to the latest available commit.
This commit is contained in:
Matthew Barnes committed 2015-10-13 12:34:57 -04:00
1 parent 39b732ffaa
commit 2210a79bfa
3 files changed
+55

No files matched your search

+15
View File
@@ -203,3 +203,18 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'consol
validate_bootloader
echo "ok upgrade with multiple kernel args"
# Test upgrade with and without --override-commit
# See https://github.com/GNOME/ostree/pull/147
${CMD_PREFIX} ostree pull --repo=sysroot/ostree/repo --commit-metadata-only --depth=-1 testos:testos/buildmaster/x86_64-runtime
head_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime)
prev_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime^^^^)
assert_not_streq ${head_rev} ${prev_rev}
${CMD_PREFIX} ostree admin upgrade --os=testos --override-commit=${prev_rev} --allow-downgrade
curr_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime)
assert_streq ${curr_rev} ${prev_rev}
${CMD_PREFIX} ostree admin upgrade --os=testos
curr_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime)
assert_streq ${curr_rev} ${head_rev}
echo "ok upgrade with and without override-commit"