bin/deploy: Avoid loading merge deployment kargs unless necessary

The fact that `ostree admin deploy` always itself loaded the
merge kargs masked a bug in the core.  Let's change our tests
to not pass any kernel arguments to ensure we cover this.

The new logic in the CLI is a bit subtle, but if you read
carefully is a lot clearer I believe.  Basically we have one
of a few "starting points" in the first section, which can
then be further augmented.

Closes: #1558
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2018-04-27 17:48:21 +00:00
1 parent de4c7105f0
commit 06d39efcb5
2 files changed
+24 -19

No files matched your search

@@ -4,7 +4,7 @@
- name: Write staged-deploy commit
shell: |
ostree --repo=/ostree/repo commit --parent="${commit}" -b staged-deploy --tree=ref="${commit}" --no-bindings
ostree admin deploy --stage --karg-proc-cmdline --karg=ostreetest=yes staged-deploy
ostree admin deploy --stage staged-deploy
test -f /run/ostree/staged-deployment
environment:
commit: "{{ rpmostree_status['deployments'][0]['checksum'] }}"
@@ -13,8 +13,6 @@
shell: |
# 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 that we have the new kernel argument
grep -q -e 'ostreetest=yes' /proc/cmdline
# And there should not be a staged deployment
test '!' -f /run/ostree/staged-deployment
- name: Rollback
@@ -22,14 +20,11 @@
- include_tasks: ../tasks/reboot.yml
- shell: |
rpm-ostree cleanup -rp
# And now we shouldn't have the kernel commandline entry
- name: Check we do not have new kernel cmdline entry
shell: grep -qv -e 'ostreetest=yes' /proc/cmdline
# Ensure we can unstage
- name: Write staged-deploy commit, then unstage
shell: |
ostree admin deploy --stage --karg-proc-cmdline --karg=ostreetest=yes staged-deploy
ostree admin deploy --stage staged-deploy
ostree admin status > status.txt
grep -qFe '(staged)' status.txt
test -f /run/ostree/staged-deployment
@@ -43,10 +38,10 @@
# Staged should be overwritten by non-staged
- name: Write staged-deploy commit, then unstage
shell: |
ostree admin deploy --stage --karg-proc-cmdline --karg=ostreetest=yes staged-deploy
ostree admin deploy --stage staged-deploy
test -f /run/ostree/staged-deployment
ostree --repo=/ostree/repo commit --parent="${commit}" -b nonstaged-deploy --tree=ref="${commit}" --no-bindings
ostree admin deploy --karg-proc-cmdline --karg=ostreetest=yes nonstaged-deploy
ostree admin deploy nonstaged-deploy
ostree admin status > status.txt
grep -vqFe '(staged)' status.txt
test '!' -f /run/ostree/staged-deployment