Skip to content

Commit

Permalink
Test kernel personality hacks
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Dec 14, 2023
1 parent 9011338 commit d44a208
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
9 changes: 0 additions & 9 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ services:
cache_from:
- sut:latest
hostname: alpine-test
environment:
- DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME:-}
- DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD:-}

debian-test:
extends:
Expand All @@ -75,9 +72,6 @@ services:
cache_from:
- sut:latest
hostname: debian-test
environment:
- DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME:-}
- DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD:-}

ubuntu-test:
extends:
Expand All @@ -90,6 +84,3 @@ services:
cache_from:
- sut:latest
hostname: ubuntu-test
environment:
- DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME:-}
- DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD:-}
2 changes: 1 addition & 1 deletion overlay/sbin/init
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if [ ! -d /sys/fs/cgroup/systemd ]; then
mount -v -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
fi

if ! grep -q localhost /etc/hosts; then
if ! grep -q localhost /etc/hosts 2>/dev/null; then
echo "127.0.0.1 localhost" >>/etc/hosts
fi

Expand Down
31 changes: 25 additions & 6 deletions test/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@ id

date

uname -a
userspace_arch="$(dpkg --print-architecture 2>/dev/null || apk --print-arch)"
case ${userspace_arch} in
x86_64|amd64)
uname -a | grep x86_64
;;
aarch64|arm64)
uname -a | grep aarch64
setarch linux32 uname -m | tee /dev/stderr | grep armv7l
setarch linux32 --uname-2.6 uname -m | tee /dev/stderr | grep armv6l
;;
*)
echo "Unsupported architecture: ${userspace_arch}"
exit 1
;;
esac

df -h

Expand Down Expand Up @@ -51,15 +65,20 @@ if command -v ip >/dev/null 2>&1; then
ip route
fi

# nested virtualization is not available on aarch64
if [ -r /dev/kvm ]; then
case $(uname -m) in
x86_64)
ls -l /dev/kvm
test -w /dev/kvm

test -w /dev/kvm || test "$(id -u)" != 0
if which kvm-ok >/dev/null; then
kvm-ok
fi
fi
;;
*)
# https://github.com/balena-io-experimental/container-jail/issues/44
# https://github.com/firecracker-microvm/firecracker/issues/1721
echo "Nested KVM unavailable on this architecture!"
;;
esac

if command -v npm >/dev/null 2>&1; then
npm ping
Expand Down

0 comments on commit d44a208

Please sign in to comment.