export TEST_ARCH=x86_64
export TEST_KERNEL_VERSION=6.7.8-9-default

run pbl --loader grub2

# ***  the following tests are ordered least priority first  ***

# fallback result (nothing in /boot)
run pbl --default-settings

# if there are several kernels in /boot, choose latest one
echo > /boot/vmlinuz-5.6.7-6-foobar
sleep 0.1
echo > /boot/vmlinuz-5.6.7-7-foobar
sleep 0.1
echo > /boot/vmlinuz-5.6.7-8-foobar
run pbl --default-settings

# if there's a kernel matching the running kernel in /usr/lib, choose it
mkdir -p /usr/lib/modules/$TEST_KERNEL_VERSION
echo > /usr/lib/modules/$TEST_KERNEL_VERSION/vmlinuz
run pbl --default-settings

# if there's a kernel matching the running kernel in /boot, choose it
echo > /boot/vmlinuz-$TEST_KERNEL_VERSION
run pbl --default-settings

# if there are "<KERNEL_IMAGE>" and "initrd" symlinks, choose them
ln -s vmlinuz-5.6.7-7-foobar /boot/vmlinuz
ln -s initrd-5.6.7-7-foobar /boot/initrd
echo > /boot/initrd-5.6.7-7-foobar
run pbl --default-settings
