Blob Blame Raw
From 3f51f5d57b5a4c5de484db56175c58e1825d6aa9 Mon Sep 17 00:00:00 2001
Message-Id: <3f51f5d57b5a4c5de484db56175c58e1825d6aa9.1387288155.git.minovotn@redhat.com>
In-Reply-To: <527da6c2ce2c09d0183aa8595fc95f136f61b6df.1387288155.git.minovotn@redhat.com>
References: <527da6c2ce2c09d0183aa8595fc95f136f61b6df.1387288155.git.minovotn@redhat.com>
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Thu, 12 Dec 2013 16:21:28 +0100
Subject: [PATCH 8/8] qtest: Use -display none by default
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <1386865288-1575-9-git-send-email-stefanha@redhat.com>
Patchwork-id: 56262
O-Subject: [RHEL7 qemu-kvm PATCH 8/8] qtest: Use -display none by default
Bugzilla: 1003773
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>

From: Andreas Färber <afaerber@suse.de>

This avoids each test needing to add it to suppress windows popping up.

[Commit 7ceeedd016facf8d58e14a0d1417fa7225d71072 ("blockdev-test: add
test case for drive_add duplicate IDs") and commit
43cd209803d6cffb1e1a028c9ff2fd0ff4fce954 ("qdev-monitor-test: add
device_add leak test cases") added qtest tests without specifying
-display none.

As a result, "make check" now tries to use graphics (GTK or SDL).  Since
graphics are not used by the test and inappropriate for headless "make
check" runs, add the missing -display none.

This fixes "make check" in the QEMU buildbot.
-- Stefan]

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 2ad645d2854746b55ddfd1d8e951f689cca5d78f)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Conflicts:
	tests/boot-order-test.c
	tests/endianness-test.c
	tests/qom-test.c

qom-test.c and endianness-test.c do not exist in RHEL.

boot-order-test.c is slightly older but the conflict is simple to
resolve.
---
 tests/boot-order-test.c | 2 +-
 tests/fw_cfg-test.c     | 3 +--
 tests/hd-geo-test.c     | 2 +-
 tests/i440fx-test.c     | 2 +-
 tests/libqtest.c        | 1 +
 tests/m48t59-test.c     | 2 +-
 tests/rtc-test.c        | 2 +-
 tests/tmp105-test.c     | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 tests/boot-order-test.c | 2 +-
 tests/fw_cfg-test.c     | 3 +--
 tests/hd-geo-test.c     | 2 +-
 tests/i440fx-test.c     | 2 +-
 tests/libqtest.c        | 1 +
 tests/m48t59-test.c     | 2 +-
 tests/rtc-test.c        | 2 +-
 tests/tmp105-test.c     | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c
index a35e9f7..f386600 100644
--- a/tests/boot-order-test.c
+++ b/tests/boot-order-test.c
@@ -32,7 +32,7 @@ static void test_pc_with_args(const char *test_args,
                               uint8_t boot1, uint8_t boot2,
                               uint8_t reboot1, uint8_t reboot2)
 {
-    char *args = g_strdup_printf("-nodefaults -display none %s", test_args);
+    char *args = g_strdup_printf("-nodefaults %s", test_args);
 
     qtest_start(args);
     test_pc_cmos(boot1, boot2);
diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c
index c284c4d..3428dca 100644
--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -126,8 +126,7 @@ int main(int argc, char **argv)
     g_test_add_func("/fw_cfg/numa", test_fw_cfg_numa);
     g_test_add_func("/fw_cfg/boot_menu", test_fw_cfg_boot_menu);
 
-    cmdline = g_strdup_printf("-display none "
-                              "-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8 ");
+    cmdline = g_strdup_printf("-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8 ");
     s = qtest_start(cmdline);
     g_free(cmdline);
 
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index b72042e..c84d1e7 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -171,7 +171,7 @@ static int setup_common(char *argv[], int argv_sz)
 {
     memset(cur_ide, 0, sizeof(cur_ide));
     return append_arg(0, argv, argv_sz,
-                      g_strdup("-nodefaults -display none"));
+                      g_strdup("-nodefaults"));
 }
 
 static void setup_mbr(int img_idx, MBRcontents mbr)
diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index 08ce820..65c786c 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -265,7 +265,7 @@ int main(int argc, char **argv)
 
     data.num_cpus = 1;
 
-    cmdline = g_strdup_printf("-display none -smp %d", data.num_cpus);
+    cmdline = g_strdup_printf("-smp %d", data.num_cpus);
     s = qtest_start(cmdline);
     g_free(cmdline);
 
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 83424c3..359d571 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -135,6 +135,7 @@ QTestState *qtest_init(const char *extra_args)
                                   "-qmp unix:%s,nowait "
                                   "-pidfile %s "
                                   "-machine accel=qtest "
+                                  "-display none "
                                   "%s", qemu_binary, s->socket_path,
                                   s->qmp_socket_path, pid_file,
                                   extra_args ?: "");
diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c
index 4081a5f..6abc4c8 100644
--- a/tests/m48t59-test.c
+++ b/tests/m48t59-test.c
@@ -249,7 +249,7 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
 
-    s = qtest_start("-display none -rtc clock=vm");
+    s = qtest_start("-rtc clock=vm");
 
     qtest_add_func("/rtc/bcd/check-time", bcd_check_time);
     qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index 3395d7f..f1b123f 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -552,7 +552,7 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
 
-    s = qtest_start("-display none -rtc clock=vm");
+    s = qtest_start("-rtc clock=vm");
     qtest_irq_intercept_in(s, "ioapic");
 
     qtest_add_func("/rtc/check-time/bcd", bcd_check_time);
diff --git a/tests/tmp105-test.c b/tests/tmp105-test.c
index fecd6dc..5ac48e2 100644
--- a/tests/tmp105-test.c
+++ b/tests/tmp105-test.c
@@ -59,7 +59,7 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
 
-    s = qtest_start("-display none -machine n800");
+    s = qtest_start("-machine n800");
     i2c = omap_i2c_create(OMAP2_I2C_1_BASE);
     addr = N8X0_ADDR;
 
-- 
1.7.11.7