Add arch switch for qemu
@@ -118,9 +118,8 @@ garden-apt-get $rootfs update
# needed dependencies
sed -i 's/testing/bookworm/g' /etc/apt/sources.list
rm /etc/apt/apt.conf.d/default-testing
-dpkg --add-architecture arm64
apt-get update
-apt-get -y install procps libc6:arm64 iproute2 rsync openssh-client qemu-system-arm qemu-system-x86
+apt-get -y install procps iproute2 rsync openssh-client qemu-system-arm qemu-system-x86
# Find unit tests in activated features
for t in $(find $featureDir/*/test/ -maxdepth 1 -type f -executable -exec basename {} \; | grep -v .disable | sort | uniq); do
@@ -230,7 +229,14 @@ for t in $(find $featureDir/*/test/ -maxdepth 1 -type f -executable -exec basena
fi
done
# Start new generated image for unit tests
- qemu-system-x86_64 -display none -daemonize -pidfile /tmp/qemu.pid -m 1024M -device virtio-net-pci,netdev=net0,mac=02:9f:ec:22:f8:89 -netdev user,id=net0,hostfwd=tcp::2223-:22,hostname=garden /tmp/test.raw
+ qemuArch=$(uname -m)
+ if [ "$qemuArch" = x86_64 ]; then
+ echo "Starting VM for ${qemuArch}"
+ qemu-system-${qemuArch} -display none -daemonize -pidfile /tmp/qemu.pid -m 1024M -device virtio-net-pci,netdev=net0,mac=02:9f:ec:22:f8:89 -netdev user,id=net0,hostfwd=tcp::2223-:22,hostname=garden /tmp/test.raw
+ elif [ "$qemuArch" = aarch64 ]; then
+ echo "Starting VM for ${qemuArch}"
+ qemu-system-${qemuArch} -display none -daemonize -cpu cortex-a72 -machine virt -pidfile /tmp/qemu.pid -m 1024M -device virtio-net-pci,netdev=net0,mac=02:9f:ec:22:f8:89 -netdev user,id=net0,hostfwd=tcp::2223-:22,hostname=garden /tmp/test.raw
+ fi
# Wait for SSH in VM to be present
# Default: tcp/2223
