Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Update for ostree BLS file naming change #1433

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dn=$(dirname $0)
# Use the latest ostree by default
id=$(. /etc/os-release && echo $ID)
version_id=$(. /etc/os-release && echo $VERSION_ID)
if [ "$id" == fedora ] && [ "$version_id" == 27 ]; then
if [ "$id" == fedora ] && [ "$version_id" == 28 ]; then
echo -e '[fahc]\nmetadata_expire=1m\nbaseurl=https://ci.centos.org/artifacts/sig-atomic/fahc/rdgo/build/\ngpgcheck=0\n' > /etc/yum.repos.d/fahc.repo
# Until we fix https://github.com/rpm-software-management/libdnf/pull/149
excludes='exclude=ostree ostree-libs ostree-grub2 rpm-ostree'
Expand Down
4 changes: 2 additions & 2 deletions tests/vmcheck/test-initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ 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-$osname-0.conf | sed -e 's,initrd ,/boot/,')
initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-2-$osname.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}
done

vm_rpmostree initramfs --disable

initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-$osname-0.conf | sed -e 's,initrd ,/boot/,')
initramfs=$(vm_cmd grep ^initrd /boot/loader/entries/ostree-2-$osname.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
16 changes: 8 additions & 8 deletions tests/vmcheck/test-kernel-args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ set -x
osname=$(vm_get_booted_deployment_info osname)

vm_rpmostree kargs > kargs.txt
conf_content=$(vm_cmd grep ^options /boot/loader/entries/ostree-$osname-0.conf | sed -e 's,options ,,')
conf_content=$(vm_cmd grep -h ^options /boot/loader/entries/ostree-*.conf | head -1 | sed -e 's,options ,,')
assert_file_has_content_literal kargs.txt "$conf_content"
echo "ok kargs display matches options"

vm_rpmostree kargs --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-$osname-0.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.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 @@ -45,7 +45,7 @@ echo "ok kargs append"

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

Expand All @@ -56,7 +56,7 @@ assert_file_has_content err.txt "Unable to delete argument 'APPENDARG' with mult
echo "ok failed to delete key with multiple values"

vm_rpmostree kargs --delete APPENDARG=VALAPPEND
vm_cmd grep ^options /boot/loader/entries/ostree-$osname-0.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.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 @@ -66,7 +66,7 @@ vm_rpmostree kargs --append=REPLACE_TEST=TEST --append=REPLACE_MULTI_TEST=TEST -

# Test for replacing key/value pair with only one value
vm_rpmostree kargs --replace=REPLACE_TEST=HELLO
vm_cmd grep ^options /boot/loader/entries/ostree-$osname-0.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf > tmp_conf.txt
assert_file_has_content_literal tmp_conf.txt 'REPLACE_TEST=HELLO'
echo "ok replacing one key/value pair"

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

# Test for replacing one of the values for multi value keys
vm_rpmostree kargs --replace=REPLACE_MULTI_TEST=TEST=NEWTEST
vm_cmd grep ^options /boot/loader/entries/ostree-$osname-0.conf > tmp_conf.txt
vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.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 All @@ -90,7 +90,7 @@ vm_reboot

# Do a rollback and check if the content matches original booted conf (read in the beginning of the test)
vm_rpmostree rollback
for arg in $(vm_cmd grep ^options /boot/loader/entries/ostree-$osname-0.conf | sed -e 's,options ,,'); do
for arg in $(vm_cmd grep ^options /boot/loader/entries/ostree-2-$osname.conf | sed -e 's,options ,,'); do
case "$arg" in
ostree=*) # Skip ostree arg
;;
Expand Down Expand Up @@ -137,7 +137,7 @@ vm_rpmostree kargs --append=PACKAGE=TEST
vm_build_rpm foo
vm_rpmostree install foo

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