summaryrefslogtreecommitdiffstats
path: root/tests/boot-serial-test.c
Commit message (Collapse)AuthorAgeFilesLines
* hw/s390x: Allow to configure the consoles with the "-serial" parameterThomas Huth2018-04-301-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The consoles ("sclpconsole" and "sclplmconsole") can only be configured with "-device" and "-chardev" so far. Other machines use the convenience option "-serial" to configure the default consoles, even for virtual consoles like spapr-vty on the pseries machine. So let's support this option on s390x, too. This way we can easily enable the serial console here again with "-nodefaults", for example: qemu-system-s390x -no-shutdown -nographic -nodefaults -serial mon:stdio ... which is way shorter than typing: qemu-system-s390x -no-shutdown -nographic -nodefaults \ -chardev stdio,id=c1,mux=on -device sclpconsole,chardev=c1 \ -mon chardev=c1 The -serial parameter can also be used if you only want to see the QEMU monitor on stdio without using -nodefaults, but not the console output. That's something that is pretty impossible with the current code today: qemu-system-s390x -no-shutdown -nographic -serial none While we're at it, this patch also maps the second -serial option to the "sclplmconsole", so that there is now an easy way to configure this second console on s390x, too, for example: qemu-system-s390x -no-shutdown -nographic -serial null -serial mon:stdio Additionally, the new code is also smaller than the old one and we have less s390x-specific code in vl.c :-) I've also checked that migration still works as expected by migrating a guest with console output back and forth between a qemu-system-s390x that has this patch and an instance without this patch. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1524754794-28005-1-git-send-email-thuth@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* tests/boot-serial: Test the sam460ex boardThomas Huth2018-04-101-0/+2
| | | | | | | | | We've got a U-Boot firmware for this board in our repository, and the firmware prints some output to the serial console, so we can check this board in the boot-serial tester, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests/boot-serial: Check the 40p machine, tooThomas Huth2018-03-181-2/+4
| | | | | | | | | | | The "40p" machine is using the Open Hack'Ware BIOS, just like the "prep" machine, so we can test it accordingly with the boot-serial tester, too. While we're at it, also change the strings that we are using for the "prep" machine, so that this test now also checks some CLI parameters. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests/boot-serial-test: Fix problem with timeout due to dropped charactersThomas Huth2018-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | Commit 92b540dac9fc3a5 introduce a counter to handle the timeouts in a better way. But in case ccnt reaches 512, the current read character is ignored - and if that character is part of the string that we are looking for, the test fails to match the string. Almost all of the tests look for a string within the first 512 bytes of firmware output, so the problem never triggered there. But the hppa test that has been added recently looks for a longer string at the very end of a long output, thus there's a chance that we miss a character there so that the test fails unexpectedly. Fix it by *not* reading and dropping a character if the counter reaches 512. Fixes: 92b540dac9fc3a572c7342edd0b073000f5a6abf Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 1518761564-9899-1-git-send-email-thuth@redhat.com [PMM: added initializer for nbd to silence false-positive warning from OpenBSD 6 compiler] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* tests/boot-serial-test: Add support for the aarch64 virt machineWei Huang2018-02-141-0/+9
| | | | | | | | | | This patch adds a small binary kernel to test aarch64 virt machine's UART. Signed-off-by: Wei Huang <wei@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [thuth: Fixed contextual conflicts with the hppa and sdhci patches] Signed-off-by: Thomas Huth <thuth@redhat.com>
* tests/boot-serial: Add tests for PowerPC Mac machinesThomas Huth2018-02-141-0/+3
| | | | | | | | | OpenBIOS prints out the CPU type on these machine types, so we can use this string to test whether the CPU detection is working correctly. Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* tests/boot-serial: Enable the boot-serial test on SPARC machines, tooThomas Huth2018-02-141-0/+4
| | | | | | | | | | OpenBIOS prints out the name of the detected CPU here, so looking for this string is a nice test to verify that the CPU detection is still working correctly. Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* tests: Enable boot-serial-test for hppaRichard Henderson2018-02-041-0/+1
| | | | | Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* tests/boot-serial-test: fix powernv supportCédric Le Goater2018-01-161-1/+1
| | | | | | | | Recent commit introduced the firmware image skiboot 5.9 which has a different first line ouput. Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests/boot-serial-test: Add support for the raspi2 machineThomas Huth2018-01-161-0/+9
| | | | | | | | | The raspi2 machine supports loading firmware images, so we can easily load a small test sequence as raw binary blob here to test the UART. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1512031988-32490-8-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests/boot-serial-test: Add a test for the moxiesim machineThomas Huth2018-01-161-0/+8
| | | | | | | | | | Now that moxiesim supports the -bios parameter, we can check this machine in the boot-serial tester, too, by supplying a mini bios that only writes 'T' characters to the UART. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1512031988-32490-7-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests/boot-serial-test: Add tests for microblaze boardsThomas Huth2018-01-161-0/+20
| | | | | | | | | This adds two simple TCG + UART tests for the microblaze boards, one in big endian mode, and one in little endian mode. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1512031988-32490-5-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests/boot-serial-test: Add support for the mcf5208evb boardThomas Huth2017-12-211-0/+10
| | | | | | | | | | We can output a character quite easily here with some few lines of assembly that we provide as a mini-kernel for this board. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1512031988-32490-4-git-send-email-thuth@redhat.com> [lv: add boot-serial-test in check-qtest-m68k] Signed-off-by: Laurent Vivier <laurent@vivier.eu>
* tests/boot-serial-test: Add code to allow to specify our own kernel or biosThomas Huth2017-12-211-12/+42
| | | | | | | | | | | | | | QEMU only ships with some few firmware images, i.e. we can currently run the boot-serial test only on a very limited set of machines. But writing some characters to the default UART of a machine can often be done with some few lines of assembly, so we add the possibility to the boot-serial tester to use its own mini-kernels or mini-firmwares. We write such images then into a file that we can load with the "-kernel" or "-bios" parameter when we launch QEMU. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1512031988-32490-3-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests/boot-serial-test: Make sure that we check the timeout regularlyThomas Huth2017-12-211-2/+3
| | | | | | | | | | | | If the guest continuesly writes characters to the UART, we never leave the inner while loop and thus never check whether we've reached the timeout value. So if we fail to find the expected string in the UART output, the test just hangs and never finishs. Use a counter to regularly break out of the while loop to check the timeout. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1512031988-32490-2-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* libqtest: Add qtest_[v]startf()Eric Blake2017-10-201-8/+4Star
| | | | | | | | | | | | | | | | | | | | | We have several callers that were formatting the argument strings themselves; consolidate this effort by adding new convenience functions directly in libqtest, and update some call-sites that can benefit from it. Note that the new functions qtest_startf() and qtest_vstartf() behave more like qtest_init() (the caller must assign global_qtest after the fact, rather than getting it implicitly set). This helps us prepare for future patches that get rid of the global variable, by explicitly highlighting which tests still depend on it now. Signed-off-by: Eric Blake <eblake@redhat.com> [thuth: Dropped the hunks that do not apply cleanly to qemu master yet and added the missing g_free(args) in qtest_vstartf()] Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1508336428-20511-2-git-send-email-thuth@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* boot-serial-test: prefer tcg acceleratorCornelia Huck2017-08-221-1/+5
| | | | | | | | | | Prefer to use the tcg accelarator if it is available: This is our only real smoke test for tcg, and fast enough to use it for that. Fixes: 480bc11e6 ("boot-serial-test: fallback to kvm accelerator") Reported-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* boot-serial-test: fallback to kvm acceleratorCornelia Huck2017-08-111-2/+3
| | | | | | | | | | Currently, at least x86_64 and s390x support building with --disable-tcg. Instead of forcing tcg (which causes the test to fail on such builds), allow to use kvm as well. Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* boot-serial-test: use -no-shutdownChristian Borntraeger2017-03-241-2/+2
| | | | | | | | | | | | | a qemu with an empty s390 guest will exit very quickly. This races against the testsuite reading from the console pipe leading to intermittent test suite failures. Using -no-shutdown will keep the guest running. Fixes: 864111f422ba (vl: exit qemu on guest panic if -no-shutdown is not set) Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1490361570-288658-1-git-send-email-borntraeger@de.ibm.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* powernv: Don't test POWER9 CPU yetDavid Gibson2017-03-031-1/+1
| | | | | | | | | | | | | | A couple of tests for the work-in-progress 'powernv' machine type attempt to test on POWER9 CPUs. However the POWER9 CPU support is incomplete and this doesn't really work. In particular the firmware image we have currently assumes the presence of the SDR1 register, which no longer exists on POWER9. We only got away with this so far, because of a different bug which added SDR1 to POWER9 even though it shouldn't be there. For now, remove POWER9 testing of powernv, POWER8 testing will do for now until the POWER9 support is more complete. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* boot-serial-test: Add a test for the powernv machineThomas Huth2016-11-151-0/+1
| | | | | | | | | | | | | The new powernv machine ships with a firmware that outputs some text to the serial console, so we can automatically test this machine type in the boot-serial tester, too. And to get some (very limited) test coverage for the new POWER9 CPU emulation, too, this test is also started with "-cpu POWER9". Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: Check serial output of firmware boot of some machinesThomas Huth2016-09-071-0/+110
Some of the machines that we have got a firmware image for write some output to the serial console while booting up. We can use this output to make sure that the machine is basically working, so this adds a test that checks the output of these machines for some well-known "magic" strings. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>