qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests: Ensure TAP version is printed before other messages
@ 2023-02-27 17:40 Richard W.M. Jones
  2023-02-27 17:44 ` Daniel P. Berrangé
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Richard W.M. Jones @ 2023-02-27 17:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: alxndr, pbonzini, bsd, stefanha, thuth, darren.kenny, Qiuhao.Li,
	fam, lvivier, berrange

These two tests were failing with this error:

  stderr:
  TAP parsing error: version number must be on the first line
  [...]
  Unknown TAP version. The first line MUST be `TAP version <int>`. Assuming version 12.

This can be fixed by ensuring we always call g_test_init first in the
body of main.

Thanks: Daniel Berrange, for diagnosing the problem
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
 tests/qtest/fuzz-lsi53c895a-test.c | 4 ++--
 tests/qtest/rtl8139-test.c         | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c
index a9254b455d..2012bd54b7 100644
--- a/tests/qtest/fuzz-lsi53c895a-test.c
+++ b/tests/qtest/fuzz-lsi53c895a-test.c
@@ -112,12 +112,12 @@ static void test_lsi_do_dma_empty_queue(void)
 
 int main(int argc, char **argv)
 {
+    g_test_init(&argc, &argv, NULL);
+
     if (!qtest_has_device("lsi53c895a")) {
         return 0;
     }
 
-    g_test_init(&argc, &argv, NULL);
-
     qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
                    test_lsi_do_dma_empty_queue);
 
diff --git a/tests/qtest/rtl8139-test.c b/tests/qtest/rtl8139-test.c
index 1beb83805c..4bd240e9ee 100644
--- a/tests/qtest/rtl8139-test.c
+++ b/tests/qtest/rtl8139-test.c
@@ -207,9 +207,10 @@ int main(int argc, char **argv)
         verbosity_level = atoi(v_env);
     }
 
-    qtest_start("-device rtl8139");
-
     g_test_init(&argc, &argv, NULL);
+
+    qtest_start("-device rtl8139");
+
     qtest_add_func("/rtl8139/nop", nop);
     qtest_add_func("/rtl8139/timer", test_init);
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-01 11:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 17:40 [PATCH] tests: Ensure TAP version is printed before other messages Richard W.M. Jones
2023-02-27 17:44 ` Daniel P. Berrangé
2023-02-27 17:46 ` Darren Kenny
2023-02-27 19:57 ` Alexander Bulekov
2023-02-27 22:01 ` Philippe Mathieu-Daudé
2023-02-28 15:37 ` Alex Bennée
2023-02-28 20:30 ` Thomas Huth
2023-03-01 10:52   ` Richard W.M. Jones
2023-03-01 10:56     ` Thomas Huth
2023-03-01 11:00     ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).