tests: Improve check for /proc/cmdline kargs
On some systems there may be no root= argument, so the tests for appending /proc/cmdline arguments will fail. Instead, loop over each of the arguments in the host's /proc/cmdline and test that they're in the constructed config file. That will actually test if ostree added all of the system's /proc/cmdline args correctly. The regex isn't perfect here, but it's probably good enough for this test. Closes: #372 Approved by: cgwalters
This commit is contained in:
parent
99a76c9b34
commit
a94530111a
|
|
@ -43,10 +43,9 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'option
|
||||||
echo "ok deploy with --karg, but same config"
|
echo "ok deploy with --karg, but same config"
|
||||||
|
|
||||||
${CMD_PREFIX} ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime
|
${CMD_PREFIX} ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime
|
||||||
# Here we're asserting that the *host* system has a root= kernel
|
for arg in $(cat /proc/cmdline); do
|
||||||
# argument. I think it's unlikely that anyone doesn't have one, but
|
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf "options.*$arg"
|
||||||
# if this is not true for you, please file a bug!
|
done
|
||||||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*root=.'
|
|
||||||
|
|
||||||
echo "ok deploy --karg-proc-cmdline"
|
echo "ok deploy --karg-proc-cmdline"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,7 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'option
|
||||||
echo "ok instutil set-kargs --append"
|
echo "ok instutil set-kargs --append"
|
||||||
|
|
||||||
${CMD_PREFIX} ostree admin instutil set-kargs --import-proc-cmdline
|
${CMD_PREFIX} ostree admin instutil set-kargs --import-proc-cmdline
|
||||||
# Here we're asserting that the *host* system has a root= kernel
|
for arg in $(cat /proc/cmdline); do
|
||||||
# argument. I think it's unlikely that anyone doesn't have one, but
|
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf "options.*$arg"
|
||||||
# if this is not true for you, please file a bug!
|
done
|
||||||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*root=.'
|
|
||||||
echo "ok instutil set-kargs --import-proc-cmdline"
|
echo "ok instutil set-kargs --import-proc-cmdline"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue