Skip to content

Commit

Permalink
tests/var-mount/scsi-id: simplify bootloader entry finding
Browse files Browse the repository at this point in the history
We don't have to be super strict here in how we find the bootloader
entry. There should only be one, so simplify the logic using a glob
instead.

Motivated by the fact that this will break otherwise as part of
openshift/os#1445 where the `ID` will be
`centos`, but the stateroot will still be `scos`.
  • Loading branch information
jlebon committed Feb 22, 2024
1 parent c9f6fbb commit 476a371
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tests/kola/var-mount/scsi-id/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ if [ $fstype != xfs ]; then
fatal "Error: /var fstype is $fstype, expected is xfs"
fi

source /etc/os-release
ostree_conf=""
if [ "$ID" == "fedora" ]; then
ostree_conf="/boot/loader.1/entries/ostree-1-fedora-coreos.conf"
elif [[ "${ID_LIKE}" =~ "rhel" ]]; then
ostree_conf="/boot/loader.1/entries/ostree-1-${ID}.conf"
else
fatal "fail: not operating on expected OS"
fi
ostree_conf=$(ls /boot/loader/entries/*.conf)

initramfs=/boot$(grep initrd ${ostree_conf} | sed 's/initrd //g')
tempfile=$(mktemp)
Expand Down

0 comments on commit 476a371

Please sign in to comment.