diff --git a/docker-compose.test.yml b/docker-compose.test.yml index f56d634..eba6d6f 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -60,9 +60,6 @@ services: cache_from: - sut:latest hostname: alpine-test - environment: - - DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME:-} - - DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD:-} debian-test: extends: @@ -75,9 +72,6 @@ services: cache_from: - sut:latest hostname: debian-test - environment: - - DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME:-} - - DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD:-} ubuntu-test: extends: @@ -90,6 +84,3 @@ services: cache_from: - sut:latest hostname: ubuntu-test - environment: - - DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME:-} - - DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD:-} diff --git a/overlay/sbin/init b/overlay/sbin/init index 2c8bd74..2ee759b 100644 --- a/overlay/sbin/init +++ b/overlay/sbin/init @@ -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 diff --git a/test/healthcheck.sh b/test/healthcheck.sh index 2866744..2e26c75 100644 --- a/test/healthcheck.sh +++ b/test/healthcheck.sh @@ -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 @@ -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