Wire the VmArchitecture story all the way to the user-facing entry
points so an arm64 smoke run is a single env flip.
Example (`example_iot_vm_setup`):
* New `--arch {x86-64|aarch64}` flag (default x86-64) backed by a
`CliArch` enum that converts cleanly to `VmArchitecture`.
* Preflight and cloud-image bootstrap now call the `_for_arch`
variants, and the `VirtualMachineSpec.architecture` field gets
the real value instead of `Default::default()`.
Smoke script (`iot/scripts/smoke-a3.sh`):
* Reads `ARCH=x86-64|aarch64` from env (default x86-64).
* When `ARCH=aarch64`, `rustup target add aarch64-unknown-linux-gnu`
+ `cargo build --target ...` produces an arm64 agent binary;
otherwise the existing host-target build path is kept.
* Threads `--arch` to the example.
* Extends the phase-4 initial-status timeout (60s → 300s) and the
phase-5 post-reboot wait (240s → 900s) under TCG, which runs
3-5× slower than native KVM.
New `smoke-a3-arm.sh` wrapper: exports `ARCH=aarch64` and a separate
`VM_NAME` / NATS container name so an arm smoke run can coexist with
an x86 one on the same host without stepping on libvirt state.
Topology side (`KvmVirtualMachineHost::ensure_vm`): `wait_for_ip`
timeout is now arch-derived — 300s for x86_64, 900s for aarch64 —
because first-boot cloud-init under TCG routinely needs 8-12 min
on a constrained worker.
22 lines
766 B
Bash
Executable File
22 lines
766 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Convenience wrapper: run the end-to-end smoke test against an
|
|
# aarch64 guest (qemu-system-aarch64 TCG when the host is x86_64,
|
|
# native KVM when the host is already arm64).
|
|
#
|
|
# This is exactly equivalent to:
|
|
# ARCH=aarch64 VM_NAME=iot-smoke-vm-arm ./smoke-a3.sh
|
|
# with the VM name defaulted so it can live alongside an x86-64
|
|
# smoke run on the same host without clobbering libvirt state.
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
export ARCH=aarch64
|
|
export VM_NAME="${VM_NAME:-iot-smoke-vm-arm}"
|
|
export DEVICE_ID="${DEVICE_ID:-$VM_NAME}"
|
|
export NATS_CONTAINER="${NATS_CONTAINER:-iot-smoke-nats-a3-arm}"
|
|
export NATS_NET_NAME="${NATS_NET_NAME:-iot-smoke-net-a3-arm}"
|
|
|
|
exec "$SCRIPT_DIR/smoke-a3.sh" "$@"
|