ostree/tests/kolainst/destructive/kargs-edit-in-place.sh
Huijing Hei 37aa2ac287 Fix ostree admin kargs edit-in-place assertion when deployments
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=foobar
```
After reboot we get both `foo=bar foobar`.

Fix https://github.com/ostreedev/ostree/issues/2679
2022-08-29 11:31:32 +08:00

25 lines
662 B
Bash
Executable File

#!/bin/bash
# Verify "ostree admin kargs edit-in-place" works
set -xeuo pipefail
. ${KOLA_EXT_DATA}/libinsttest.sh
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
sudo rpm-ostree kargs --append=somedummykarg=1
sudo ostree admin kargs edit-in-place --append-if-missing=testarg
assert_file_has_content /boot/loader/entries/ostree-* testarg
/tmp/autopkgtest-reboot "2"
;;
"2")
assert_file_has_content_literal /proc/cmdline somedummykarg=1
assert_file_has_content_literal /proc/cmdline testarg
echo "ok test with stage: kargs edit-in-place --append-if-missing"
;;
*)
fatal "Unexpected AUTOPKGTEST_REBOOT_MARK=${AUTOPKGTEST_REBOOT_MARK}"
;;
esac