diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index e7341a2..91a1b15 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -1,12 +1,13 @@ -name: qemu-minimal-smoke-test +name: smoke-tests on: pull_request: branches: [ main ] jobs: - ubuntu-smoke-test: - name: ubuntu-smoke-test + + ubuntu-latest-x86: + name: ubuntu-latest-x86 runs-on: ubuntu-latest steps: - name: Check out code using action/checkout @@ -15,7 +16,7 @@ jobs: run: sudo apt update && sudo apt install -y qemu-system-x86 cloud-image-utils - name: Generate an ssh key-pair for this test run: ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "" - - name: Run a qemu-based ./gen-vm smoke-test + - name: Generate a x86_64 qemu-based ./gen-vm smoke-test run: ./gen-vm working-directory: qemu env: @@ -23,3 +24,23 @@ jobs: KVM: none USERNAME: ubuntu PASS: password + + ubuntu-latest-arm64: + name: ubuntu-latest-arm64 + runs-on: ubuntu-latest + steps: + - name: Check out code using action/checkout + uses: actions/checkout@v4.1.1 + - name: Install a couple of packages via the apt package manager + run: sudo apt update && sudo apt install -y qemu-system-arm cloud-image-utils + - name: Generate an ssh key-pair for this test + run: ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "" + - name: Run a aarch64 qemu-based ./gen-vm smoke-test + run: ./gen-vm + working-directory: qemu + env: + VM_NAME: qemu-minimal-smoke-test-arm64 + KVM: none + USERNAME: ubuntu + PASS: password + ARCH: arm64 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index c13f681..f48c440 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -1,4 +1,4 @@ -name: qemu-minimal-spell-check +name: spell-check on: pull_request: @@ -9,8 +9,8 @@ on: - '.spellcheck.yaml' jobs: - ubuntu-spell-check: - name: ubuntu-spell-check + ubuntu-latest: + name: ubuntu-latest runs-on: ubuntu-latest steps: - name: Check out code. diff --git a/qemu/gen-vm b/qemu/gen-vm index 5926183..006257e 100755 --- a/qemu/gen-vm +++ b/qemu/gen-vm @@ -11,7 +11,7 @@ # ---------------- # # Note that for Jammy you need the cloud-init as well as -# cloud-image-utils and for focal a good generic call would be: +# cloud-image-utils and for jammy a good generic call would be: # # RELEASE=jammy VM_NAME=stephen ./gen-vm # diff --git a/qemu/run-vm b/qemu/run-vm index 3ccc0ef..3b5c85f 100755 --- a/qemu/run-vm +++ b/qemu/run-vm @@ -14,20 +14,19 @@ IMAGES=${IMAGES:-../images} SSH_PORT=${SSH_PORT:-2222} KVM=${KVM:-enable} -if [ ${ARCH} == "amd64" ]; then - QARCH="x86_64" -elif [ ${ARCH} == "arm64" ]; then - QARCH="aarch64" -else - echo "Error: No ARCH mapping exists for ${ARCH}! Exiting."; exit -1 -fi - if [ ${KVM} == "enable" ]; then KVM=",accel=kvm" else KVM="" fi +if [ ${FILESYSTEM} == "none" ]; then + FILESYSTEM_ARGS="" +else + FILESYSTEM_ARGS="-virtfs local,id=hostfs,path=${FILESYSTEM},security_model=mapped,mount_tag=hostfs" +fi + + if [ ${ARCH} == "amd64" ]; then QARCH="x86_64" QARCH_ARGS="-machine q35${KVM}" @@ -42,8 +41,7 @@ qemu-system-${QARCH} \ ${QARCH_ARGS} \ -smp cpus=${VCPUS} \ -m ${VMEM} \ + ${FILESYSTEM_ARGS} \ -nographic \ - -drive if=virtio,format=qcow2,file=${IMAGES}/${VM_NAME}-backing.qcow2 \ + -drive if=virtio,format=qcow2,file=${IMAGES}/${VM_NAME}.qcow2 \ -nic user,id=user0,model=virtio-net-pci,hostfwd=tcp::${SSH_PORT}-:22 - -