ostree/deploy: Test finalization locking

Support for that file was added previously, but the testing lived in
rpm-ostree only. Let's add it here too.

In the process add a hidden `--lock-finalization` to `ostree admin
deploy` to make testing easier (though it could also be useful to update
managers driving OSTree via the CLI).
This commit is contained in:
Jonathan Lebon committed 2022-01-21 13:48:35 -05:00
1 parent 88dca03967
commit baf838de22
2 files changed
+28 -2

No files matched your search

+10 -2
View File
@@ -78,10 +78,18 @@ EOF
# And there should not be a staged deployment
test '!' -f /run/ostree/staged-deployment
# Upgrade with staging
test '!' -f /run/ostree/staged-deployment
ostree admin deploy --stage staged-deploy
ostree admin deploy --stage staged-deploy --lock-finalization
test -f /run/ostree/staged-deployment
test -f /run/ostree/staged-deployment-locked
# check that we can cleanup the staged deployment
ostree admin undeploy 0
test ! -f /run/ostree/staged-deployment
test ! -f /run/ostree/staged-deployment-locked
echo "ok cleanup staged"
# Upgrade with staging
ostree admin deploy --stage staged-deploy
origcommit=$(ostree rev-parse staged-deploy)
cd /ostree/repo/tmp
ostree checkout -H "${origcommit}" t