From 66f9b3fe7b0b14992e0186d696b9756b17de9020 Mon Sep 17 00:00:00 2001 From: HuijingHei Date: Tue, 2 Apr 2024 13:41:49 +0800 Subject: [PATCH] ci: sync tests with bootloader naming Xerf to https://github.com/ostreedev/ostree/pull/3206 --- tests/vmcheck/test-initramfs.sh | 5 ++--- tests/vmcheck/test-kernel-args.sh | 14 ++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/vmcheck/test-initramfs.sh b/tests/vmcheck/test-initramfs.sh index 8601ffb8dc..e50c798d0d 100755 --- a/tests/vmcheck/test-initramfs.sh +++ b/tests/vmcheck/test-initramfs.sh @@ -102,7 +102,6 @@ vm_assert_status_jq \ echo "ok initramfs enable disable reboot" assert_streq $base $(vm_get_booted_csum) -osname=$(vm_get_booted_deployment_info osname) for file in first second; do vm_cmd touch /etc/rpmostree-initramfs-testing-$file @@ -116,7 +115,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} @@ -125,7 +124,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 diff --git a/tests/vmcheck/test-kernel-args.sh b/tests/vmcheck/test-kernel-args.sh index e66373cfc6..c7cddca8c3 100755 --- a/tests/vmcheck/test-kernel-args.sh +++ b/tests/vmcheck/test-kernel-args.sh @@ -30,8 +30,6 @@ set -x # vm_cmd ostree config --repo /sysroot/ostree/repo set sysroot.readonly true # vm_cmd systemctl restart rpm-ostreed -osname=$(vm_get_booted_deployment_info osname) - vm_kargs_now() { vm_rpmostree kargs "$@" vm_reboot @@ -44,7 +42,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' @@ -65,7 +63,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" @@ -76,7 +74,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" @@ -91,7 +89,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" @@ -104,7 +102,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" @@ -142,7 +140,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"