Skip to content

Commit

Permalink
CI: test on arm hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Jan 29, 2025
1 parent 40f251f commit 6c278b2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,24 @@ jobs:
- debootstrap
- mmdebstrap

runner:
- ubuntu-latest
- ubuntu-24.04-arm

exclude:
# debootstrap in bullseye is too old.
- host_release: bullseye
release: trixie
# restrict arm tests to bookworm and newer, mostly to save time
- runner: ubuntu-24.04-arm
host_release: bullseye
- runner: ubuntu-24.04-arm
release: bullseye
- runner: ubuntu-24.04-arm
release: buster

# We want a working shell, qemu, python and docker. Specific version should not matter (much).
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion tests/build-vm-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi

if [ "$1" == "setup" ]; then
sudo apt-get update
sudo apt-get -qq -y install curl qemu-system-x86 kpartx python3-pexpect python3-serial
sudo apt-get -qq -y install curl qemu-system-x86 qemu-system-arm kpartx python3-pexpect python3-serial
# vncsnapshot might not be available, though we don't want to abort execution then
sudo apt-get -qq -y install vncsnapshot || true
[ -x ./tests/goss ] || curl -fsSL https://goss.rocks/install | GOSS_DST="$(pwd)/tests" sh
Expand Down
19 changes: 15 additions & 4 deletions tests/test-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,22 @@ chmod a+rx "$TEST_TMPDIR"/testrunner

cd "$TEST_TMPDIR"

DPKG_ARCHITECTURE=$(dpkg --print-architecture)
if [ "${DPKG_ARCHITECTURE}" = "amd64" ]; then
QEMU=qemu-system-x86_64
elif [ "${DPKG_ARCHITECTURE}" = "arm64" ]; then
QEMU=qemu-system-aarch64
else
echo "E: unsupported ${DPKG_ARCHITECTURE}"
exit 1
fi

MOUNT_TAG=host0
qemu-system-x86_64 -hda "${VM_IMAGE}" -m 2048 \
-display none -vnc :0 \
-virtfs local,path="$TEST_TMPDIR",mount_tag="$MOUNT_TAG",security_model=none,id=host0 \
-serial pty &>qemu.log &
"${QEMU}" \
-hda "${VM_IMAGE}" -m 2048 \
-display none -vnc :0 \
-virtfs local,path="$TEST_TMPDIR",mount_tag="$MOUNT_TAG",security_model=none,id=host0 \
-serial pty &>qemu.log &
QEMU_PID="$!"

timeout=30
Expand Down

0 comments on commit 6c278b2

Please sign in to comment.