Skip to content

Commit

Permalink
ci: remove remaining workarounds from the alpine container
Browse files Browse the repository at this point in the history
Reorganize VMLINUZ detection to make the test pass again
on alpine after the container change.
  • Loading branch information
jozzsi authored and LaszloGombos committed Oct 20, 2024
1 parent ae3ba26 commit d9497f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 0 additions & 5 deletions test/container/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,3 @@ RUN apk add --no-cache \
util-linux-misc \
xfsprogs \
xz

RUN \
cp /usr/lib/udev/rules.d/* /lib/udev/rules.d/ && \
ln -sf /sbin/poweroff /sbin/shutdown && \
ln -sf /boot/vmlinuz-virt /boot/vmlinuz-$(cd /lib/modules; ls -1 | tail -1)
16 changes: 10 additions & 6 deletions test/test-functions
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ if ! [ -f "$VMLINUZ" ]; then
VMLINUZ="/lib/modules/${KVERSION}/vmlinux"
fi

[ -z "$VMLINUZ" ] && VMLINUZ=$(find /boot/vmlinuz-* -type f 2> /dev/null | tail -1)

if ! [ -f "$VMLINUZ" ]; then
[[ -f /etc/machine-id ]] && read -r MACHINE_ID < /etc/machine-id

Expand All @@ -84,13 +82,19 @@ if ! [ -f "$VMLINUZ" ]; then
VMLINUZ="/boot/vmlinux-${KVERSION}"
elif [ -f "/boot/kernel-${KVERSION}" ]; then
VMLINUZ="/boot/kernel-${KVERSION}"
else
echo "Could not find a Linux kernel version $KVERSION to test with!" >&2
echo "Please install linux." >&2
exit 1
fi
fi

if ! [ -f "$VMLINUZ" ]; then
VMLINUZ=$(find /boot/vmlinuz-* -type f 2> /dev/null | tail -1)
fi

if ! [ -f "$VMLINUZ" ]; then
echo "Could not find a Linux kernel version $KVERSION to test with!" >&2
echo "Please install linux." >&2
exit 1
fi

export VMLINUZ

command -v test_check &> /dev/null || test_check() {
Expand Down

0 comments on commit d9497f3

Please sign in to comment.