Skip to content

Commit

Permalink
Add KVM tests to healthcheck
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Harding <kyle@balena.io>
  • Loading branch information
klutchell committed Oct 23, 2023
1 parent 9e43c4f commit 4691f0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ CMD [ "/usr/local/bin/usage.sh" ]
FROM alpine:3.18 AS alpine-rootfs

# hadolint ignore=DL3018
RUN apk add --no-cache bash ca-certificates ca-certificates curl iproute2 iputils-ping lsblk
RUN apk add --no-cache bash ca-certificates ca-certificates curl iproute2 iputils-ping kmod lsblk

FROM jailer AS alpine-test

Expand All @@ -133,7 +133,7 @@ FROM debian:bookworm AS debian-rootfs

# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl iproute2 iputils-ping ca-certificates util-linux \
&& apt-get install -y --no-install-recommends ca-certificates cpu-checker curl iproute2 iputils-ping util-linux \
&& rm -rf /var/lib/apt/lists/*

FROM jailer AS debian-test
Expand All @@ -147,7 +147,7 @@ FROM ubuntu:jammy AS ubuntu-rootfs

# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl iproute2 iputils-ping util-linux \
&& apt-get install -y --no-install-recommends ca-certificates cpu-checker curl iproute2 iputils-ping util-linux \
&& rm -rf /var/lib/apt/lists/*

FROM jailer AS ubuntu-test
Expand Down
7 changes: 7 additions & 0 deletions overlay/usr/local/bin/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ ping -c 4 -M "do" -s 1472 "$(head -1 /etc/resolv.conf | awk '{print $2}')"

curl -fsSL https://raw.githubusercontent.com/dylanaraps/neofetch/7.1.0/neofetch | bash

test -r /dev/kvm
test -w /dev/kvm

if which kvm-ok > /dev/null; then
kvm-ok
fi

mkdir -p /mnt/data
mount -v /dev/vdb /mnt/data
touch /mnt/data/healthy

0 comments on commit 4691f0d

Please sign in to comment.