Skip to content

Commit

Permalink
tests/staged-deploy: test --keep-previous option
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
  • Loading branch information
r4f4 committed Feb 4, 2020
1 parent 754433f commit 1cf889c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/installed/destructive/staged-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,28 @@
environment:
commit: "{{ rpmostree_status['deployments'][0]['checksum'] }}"

- name: Previous version is retained during staged
shell: |
set -xeuo pipefail
ostree --repo=/ostree/repo refs --create nonstaged-deploy "${commit}"
ostree admin deploy nonstaged-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
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 1cf889c

Please sign in to comment.