diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 275e764..9b63b63 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -194,9 +194,19 @@ jobs: -end EOF - - name: Start a VM + - name: Install the test VM run: | - qemu-system-x86_64 -name "Anaconda" -boot d -m 4096 -cpu qemu64 -display none -cdrom test.iso -smp 2 -drive file=disk.qcow2 -serial telnet:localhost:4321,server,nowait & + qemu-system-x86_64 -name "Anaconda" -boot d -m 4096 -cpu qemu64 -display none -cdrom test.iso -smp 2 -drive file=disk.qcow2 -serial telnet:localhost:4321,server,nowait &; QEMU_PID=$! + echo "PID: $QEMU_PID" + timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done" + (nc localhost 4321 | tee vm.stdout) & + timeout 30m wait $QEMU_PID + + - name: Start the test VM + run: | + qemu-system-x86_64 -name "Anaconda" -boot c -m 4096 -cpu qemu64 -display none -smp 2 -drive file=disk.qcow2 -serial telnet:localhost:4321,server,nowait &; export QEMU_PID=$! + echo "PID: $QEMU_PID" timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done" (nc localhost 4321 | tee vm.stdout) & timeout 30m bash -c "while ! (grep 'login:' vm.stdout); do sleep 1; done" + echo "VM ready for tests" \ No newline at end of file