[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/30] tests/cdrom-test: Test that -cdrom parameter i
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 22/30] tests/cdrom-test: Test that -cdrom parameter is working |
Date: |
Fri, 8 Jun 2018 13:47:25 -0400 |
From: Thomas Huth <address@hidden>
Commit 1454509726719e0933c800 recently broke the "-cdrom" parameter
on a couple of boards without us noticing it immediately. Thus let's
add a test which checks that "-cdrom" can at least be used to start
QEMU with certain machine types.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Hervé Poussineau <address@hidden>
Acked-By: Mark Cave-Ayland <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: John Snow <address@hidden>
---
tests/cdrom-test.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c
index 5bbf322789..7a1fce5dfb 100644
--- a/tests/cdrom-test.c
+++ b/tests/cdrom-test.c
@@ -13,6 +13,7 @@
#include "qemu/osdep.h"
#include "libqtest.h"
#include "boot-sector.h"
+#include "qapi/qmp/qdict.h"
static char isoimage[] = "cdrom-boot-iso-XXXXXX";
@@ -89,6 +90,32 @@ cleanup:
return ret;
}
+/**
+ * Check that at least the -cdrom parameter is basically working, i.e. we can
+ * see the filename of the ISO image in the output of "info block" afterwards
+ */
+static void test_cdrom_param(gconstpointer data)
+{
+ QTestState *qts;
+ char *resp;
+
+ qts = qtest_startf("-M %s -cdrom %s", (const char *)data, isoimage);
+ resp = qtest_hmp(qts, "info block");
+ g_assert(strstr(resp, isoimage) != 0);
+ g_free(resp);
+ qtest_quit(qts);
+}
+
+static void add_cdrom_param_tests(const char **machines)
+{
+ while (*machines) {
+ char *testname = g_strdup_printf("cdrom/param/%s", *machines);
+ qtest_add_data_func(testname, *machines, test_cdrom_param);
+ g_free(testname);
+ machines++;
+ }
+}
+
static void test_cdboot(gconstpointer data)
{
QTestState *qts;
@@ -154,6 +181,37 @@ int main(int argc, char **argv)
add_x86_tests();
} else if (g_str_equal(arch, "s390x")) {
add_s390x_tests();
+ } else if (g_str_equal(arch, "ppc64")) {
+ const char *ppcmachines[] = {
+ "pseries", "mac99", "g3beige", "40p", "prep", NULL
+ };
+ add_cdrom_param_tests(ppcmachines);
+ } else if (g_str_equal(arch, "sparc")) {
+ const char *sparcmachines[] = {
+ "LX", "SPARCClassic", "SPARCbook", "SS-10", "SS-20", "SS-4",
+ "SS-5", "SS-600MP", "Voyager", "leon3_generic", NULL
+ };
+ add_cdrom_param_tests(sparcmachines);
+ } else if (g_str_equal(arch, "sparc64")) {
+ const char *sparc64machines[] = {
+ "niagara", "sun4u", "sun4v", NULL
+ };
+ add_cdrom_param_tests(sparc64machines);
+ } else if (!strncmp(arch, "mips64", 6)) {
+ const char *mips64machines[] = {
+ "magnum", "malta", "mips", "pica61", NULL
+ };
+ add_cdrom_param_tests(mips64machines);
+ } else if (g_str_equal(arch, "arm") || g_str_equal(arch, "aarch64")) {
+ const char *armmachines[] = {
+ "realview-eb", "realview-eb-mpcore", "realview-pb-a8",
+ "realview-pbx-a9", "versatileab", "versatilepb", "vexpress-a15",
+ "vexpress-a9", "virt", NULL
+ };
+ add_cdrom_param_tests(armmachines);
+ } else {
+ const char *nonemachine[] = { "none", NULL };
+ add_cdrom_param_tests(nonemachine);
}
ret = g_test_run();
--
2.14.3
- [Qemu-devel] [PULL 16/30] ahci: fix spacing damage on ahci_mem_write, (continued)
- [Qemu-devel] [PULL 16/30] ahci: fix spacing damage on ahci_mem_write, John Snow, 2018/06/08
- [Qemu-devel] [PULL 26/30] ide: push end_transfer_func out of start_transfer callback, rename callback, John Snow, 2018/06/08
- [Qemu-devel] [PULL 27/30] ide: call ide_cmd_done from ide_transfer_stop, John Snow, 2018/06/08
- [Qemu-devel] [PULL 04/30] ahci: add port register enumeration, John Snow, 2018/06/08
- [Qemu-devel] [PULL 10/30] ahci: make port write traces more descriptive, John Snow, 2018/06/08
- [Qemu-devel] [PULL 07/30] ahci: fix spacing damage on ahci_port_write, John Snow, 2018/06/08
- [Qemu-devel] [PULL 20/30] tests/boot-sector: Add magic bytes to s390x boot code header, John Snow, 2018/06/08
- [Qemu-devel] [PULL 23/30] MAINTAINERS: Add the cdrom-test to John's section, John Snow, 2018/06/08
- [Qemu-devel] [PULL 19/30] ahci: make ahci_mem_write traces more descriptive, John Snow, 2018/06/08
- [Qemu-devel] [PULL 28/30] ide: make ide_transfer_stop idempotent, John Snow, 2018/06/08
- [Qemu-devel] [PULL 22/30] tests/cdrom-test: Test that -cdrom parameter is working,
John Snow <=
- [Qemu-devel] [PULL 21/30] tests/cdrom-test: Test booting from CD-ROM ISO image file, John Snow, 2018/06/08
- [Qemu-devel] [PULL 25/30] ahci: move PIO Setup FIS before transfer, fix it for ATAPI commands, John Snow, 2018/06/08
- [Qemu-devel] [PULL 30/30] ide: introduce ide_transfer_start_norecurse, John Snow, 2018/06/08
- [Qemu-devel] [PULL 29/30] atapi: call ide_set_irq before ide_transfer_start, John Snow, 2018/06/08
- [Qemu-devel] [PULL 24/30] libqos/ahci: track sector size, John Snow, 2018/06/08
- Re: [Qemu-devel] [PULL 00/30] Ide patches, Peter Maydell, 2018/06/11