Skip to content

Commit

Permalink
fixup! tests/staged-deploy: test --keep-previous option
Browse files Browse the repository at this point in the history
--keep-previous-version
  • Loading branch information
r4f4 committed Nov 22, 2019
1 parent 5c3f573 commit 510d10c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/installed/destructive/staged-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,25 @@
- name: Previous version is retained during staged
shell: |
set -xeuo pipefail
ostree --repo=/ostree/repo rfs --create nonstaged-deploy "${commit}"
ostree --repo=/ostree/repo refs --create nonstaged-deploy "${commit}"
ostree admin deploy nonstaged-deploy
ostree admin status > status.txt
grep -vqFe '(staged)' status.txt
ostree admin deploy --stage --retain-previous staged-deploy
ostree admin deploy --stage --retain-previous-version staged-deploy
test -f /run/ostree/staged-deployment
ostree admin status > status.txt
grep -qFe '(staged)' status.txt
test $(grep -Fce 'Version: ' status.txt) == 2
ostree admin undeploy 0
ostree admin undeploy 1
environment:
commit: "{{ rpmostree_status['deployments'][0]['checksum'] }}"
- include_tasks: ../tasks/reboot.yml
- name: Check that previous version was kept
shell: |
set -xeuo pipefail
rpm-ostree status
# Assert that the previous boot had a journal entry for it
journalctl -b "-1" -u ostree-finalize-staged.service | grep -q -e 'Transaction complete'
# And there should not be a staged deployment
test '!' -f /run/ostree/staged-deployment
ostree admin status > status.txt
test $(grep -Fce 'Version: ' status.txt) == 1
- name: Cleanup refs
shell: ostree refs --delete staged-deploy nonstaged-deploy

0 comments on commit 510d10c

Please sign in to comment.