From 54cca8ac88f46fd928b196f2d054858de7eb91b1 Mon Sep 17 00:00:00 2001 From: Gregor Haas Date: Sat, 13 Jan 2024 17:05:29 -0800 Subject: [PATCH] randomize qemu port for tests --- .github/workflows/test-system.yml | 1 + mkutils/plat/generic/run.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-system.yml b/.github/workflows/test-system.yml index 364a3388d..f7a8b6678 100644 --- a/.github/workflows/test-system.yml +++ b/.github/workflows/test-system.yml @@ -34,6 +34,7 @@ jobs: # Launch QEMU export KEYSTONE_PLATFORM=${{ matrix.platform }} export KEYSTONE_BITS=${{ matrix.bits }} + export QEMU_PORT=$(( RANDOM + 1024 )) export LD_LIBRARY_PATH=build-${{ matrix.platform }}${{ matrix.bits }}/buildroot.build/host/lib screen -L -dmS qemu bash -c "make run 2>&1 | tee run.log" diff --git a/mkutils/plat/generic/run.mk b/mkutils/plat/generic/run.mk index 45db1bb5e..f1c113f58 100644 --- a/mkutils/plat/generic/run.mk +++ b/mkutils/plat/generic/run.mk @@ -17,7 +17,7 @@ QEMU_FLAGS := -m $(QEMU_MEM) -smp $(QEMU_SMP) -nographic \ -drive file=$(BUILDROOT_BUILDDIR)/images/rootfs.ext2,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -append "console=ttyS0 ro root=/dev/vda" \ - -netdev user,id=net0,net=192.168.100.1/24,dhcpstart=192.168.100.128,hostfwd=tcp::9821-:22 \ + -netdev user,id=net0,net=192.168.100.1/24,dhcpstart=192.168.100.128,hostfwd=tcp::$(QEMU_PORT)-:22 \ -device virtio-net-device,netdev=net0 \ -device virtio-rng-pci \