diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2018-04-24 12:51:38 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-24 17:04:27 +0000 |
commit | dc4aa346a360d4fd30496f701d61a438039ec8af (patch) | |
tree | 58cf21a8b2c03344f079234b3c1b37ef445d890d /tests/test-admin-deploy-2.sh | |
parent | ab8d694361a91d0a181149c7ecb1ad69dd2a9353 (diff) | |
download | ostree-dc4aa346a360d4fd30496f701d61a438039ec8af.tar.gz |
lib/deploy: Also compare deployment csum versions
When comparing deployments to determine whether we need a new
bootversion, we should also check whether the commit "version" metadata
is the same. Otherwise, we may end up with the a bootconfig whose
`title` includes a version that doesn't match the one from the
deployment checksum.
Closes: https://github.com/projectatomic/rpm-ostree/issues/1343
Closes: #1556
Approved by: cgwalters
Diffstat (limited to 'tests/test-admin-deploy-2.sh')
-rwxr-xr-x | tests/test-admin-deploy-2.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/test-admin-deploy-2.sh b/tests/test-admin-deploy-2.sh index eab0a3d3..7e69ec88 100755 --- a/tests/test-admin-deploy-2.sh +++ b/tests/test-admin-deploy-2.sh @@ -26,7 +26,7 @@ set -euo pipefail # Exports OSTREE_SYSROOT so --sysroot not needed. setup_os_repository "archive" "syslinux" -echo "1..6" +echo "1..7" ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) @@ -64,6 +64,19 @@ assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-r echo "ok manual cleanup" +# Commit + upgrade twice, so that we'll rotate out the original deployment +os_repository_new_commit "1" +${CMD_PREFIX} ostree admin upgrade --os=testos +oldversion=${version} +# another commit with *same* bootcsum but *new* content +os_repository_new_commit "1" "2" +newversion=${version} +assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf ${oldversion} +${CMD_PREFIX} ostree admin upgrade --os=testos +assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf ${newversion} + +echo "ok new version same bootcsum" + assert_n_pinned() { local n=$1 ${CMD_PREFIX} ostree admin status > status.txt |