Skip to content

Commit

Permalink
ci: sync tests with bootloader naming
Browse files Browse the repository at this point in the history
  • Loading branch information
HuijingHei committed Apr 2, 2024
1 parent aae3313 commit ff68901
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/vmcheck/test-initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for file in first second; do
'.deployments[0]["initramfs-args"]|index("-I") == 0' \
'.deployments[0]["initramfs-args"]|index("/etc/rpmostree-initramfs-testing-'${file}'") == 1' \
'.deployments[0]["initramfs-args"]|length == 2'
initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-2-$osname.conf | sed -e 's,initrd ,/boot/,')
initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-2.conf | sed -e 's,initrd ,/boot/,')
test -n "${initramfs}"
vm_cmd lsinitrd $initramfs > lsinitrd.txt
assert_file_has_content lsinitrd.txt /etc/rpmostree-initramfs-testing-${file}
Expand All @@ -125,7 +125,7 @@ echo "ok initramfs args enable"

vm_rpmostree initramfs --disable
vm_reboot
initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-2-$osname.conf | sed -e 's,initrd ,/boot/,')
initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-2.conf | sed -e 's,initrd ,/boot/,')
test -n "${initramfs}"
vm_cmd lsinitrd $initramfs > lsinitrd.txt
assert_not_file_has_content lsinitrd.txt /etc/rpmostree-initramfs-testing
Expand Down
12 changes: 6 additions & 6 deletions tests/vmcheck/test-kernel-args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ echo "ok kargs display matches options"

vm_kargs_now --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND
# read the conf file into a txt for future comparison
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2.conf > tmp_conf.txt
assert_file_has_content_literal tmp_conf.txt 'FOO=BAR'
assert_file_has_content_literal tmp_conf.txt 'APPENDARG=VALAPPEND APPENDARG=2NDAPPEND'

Expand All @@ -65,7 +65,7 @@ echo "ok kargs append and delete"

# Test for rpm-ostree kargs delete
vm_kargs_now kargs --delete FOO
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2.conf > tmp_conf.txt
assert_not_file_has_content tmp_conf.txt 'FOO=BAR'
echo "ok delete a single key/value pair"

Expand All @@ -76,7 +76,7 @@ assert_file_has_content err.txt "Multiple values for key 'APPENDARG' found"
echo "ok failed to delete key with multiple values"

vm_kargs_now --delete APPENDARG=VALAPPEND
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2.conf > tmp_conf.txt
assert_not_file_has_content tmp_conf.txt 'APPENDARG=VALAPPEND'
assert_file_has_content tmp_conf.txt 'APPENDARG=2NDAPPEND'
echo "ok delete a single key/value pair from multi valued key pairs"
Expand All @@ -91,7 +91,7 @@ vm_rpmostree kargs --replace=REPLACE_TEST=HELLO
if vm_pending_is_staged; then
vm_reboot
fi
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2.conf > tmp_conf.txt
assert_file_has_content_literal tmp_conf.txt 'REPLACE_TEST=HELLO'
echo "ok replacing one key/value pair"

Expand All @@ -104,7 +104,7 @@ echo "ok failed to replace key with multiple values"

# Test for replacing one of the values for multi value keys
vm_kargs_now --replace=REPLACE_MULTI_TEST=TEST=NEWTEST
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2.conf > tmp_conf.txt
assert_file_has_content tmp_conf.txt "REPLACE_MULTI_TEST=NEWTEST"
assert_not_file_has_content tmp_conf.txt "REPLACE_MULTI_TEST=TEST"
assert_file_has_content tmp_conf.txt "REPLACE_MULTI_TEST=NUMBERTWO"
Expand Down Expand Up @@ -142,7 +142,7 @@ assert_not_file_has_content out.txt 'Enabled rpm-md'
echo "ok kargs work offline"
vm_reboot

vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > kargs.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2.conf > kargs.txt
assert_file_has_content_literal kargs.txt 'PACKAGE=TEST'
assert_file_has_content_literal kargs.txt 'PACKAGE2=TEST2'
echo "ok kargs with multiple operations"
Expand Down

0 comments on commit ff68901

Please sign in to comment.