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`.

(cherry picked from commit 476a371)

---

We're backporting this because a recent rebuild of 4.15 cosa pulled in a
new ostree which enables `bootloader-naming-2` by default, which changes
the BLS entry name:

ostreedev/ostree#3206
  • Loading branch information
jlebon committed Apr 11, 2024
1 parent 47dc03a commit fae8c75
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 fae8c75

Please sign in to comment.