qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>
Subject: [PULL 03/27] tests/qtest/bios-tables-test: Make the test less verbose by default
Date: Tue, 31 Jan 2023 11:11:41 +0100	[thread overview]
Message-ID: <20230131101205.1499867-4-thuth@redhat.com> (raw)
In-Reply-To: <20230131101205.1499867-1-thuth@redhat.com>

We are facing the issues that our test logs in the gitlab CI are
too big (and thus cut off). The bios-tables-test is one of the few
qtests that prints many lines of output by default when running with
V=1, so it contributes to this problem. Almost all other qtests are
silent with V=1 and only print debug messages with V=2 and higher.
Thus let's change the bios-tables-test to behave more like the
other tests and only print the debug messages with V=2 (or higher).

Message-Id: <20230118125132.1694469-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/bios-tables-test.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 8608408213..355d0c3d56 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -24,7 +24,7 @@
  * You will also notice that tests/qtest/bios-tables-test-allowed-diff.h lists
  * a bunch of files. This is your hint that you need to do the below:
  * 4. Run
- *      make check V=1
+ *      make check V=2
  * this will produce a bunch of warnings about differences
  * beween actual and expected ACPI tables. If you have IASL installed,
  * they will also be disassembled so you can look at the disassembled
@@ -108,6 +108,8 @@ static const char *iasl = CONFIG_IASL;
 static const char *iasl;
 #endif
 
+static int verbosity_level;
+
 static bool compare_signature(const AcpiSdtTable *sdt, const char *signature)
 {
    return !memcmp(sdt->aml, signature, 4);
@@ -368,7 +370,7 @@ static GArray *load_expected_aml(test_data *data)
     gsize aml_len;
 
     GArray *exp_tables = g_array_new(false, true, sizeof(AcpiSdtTable));
-    if (getenv("V")) {
+    if (verbosity_level >= 2) {
         fputc('\n', stderr);
     }
     for (i = 0; i < data->tables->len; ++i) {
@@ -383,7 +385,7 @@ static GArray *load_expected_aml(test_data *data)
 try_again:
         aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
                                    sdt->aml, ext);
-        if (getenv("V")) {
+        if (verbosity_level >= 2) {
             fprintf(stderr, "Looking for expected file '%s'\n", aml_file);
         }
         if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
@@ -395,7 +397,7 @@ try_again:
             goto try_again;
         }
         g_assert(exp_sdt.aml_file);
-        if (getenv("V")) {
+        if (verbosity_level >= 2) {
             fprintf(stderr, "Using expected file '%s'\n", aml_file);
         }
         ret = g_file_get_contents(aml_file, (gchar **)&exp_sdt.aml,
@@ -503,7 +505,7 @@ static void test_acpi_asl(test_data *data)
                         exp_sdt->aml, sdt->asl_file, sdt->aml_file,
                         exp_sdt->asl_file, exp_sdt->aml_file);
                 fflush(stderr);
-                if (getenv("V")) {
+                if (verbosity_level >= 1) {
                     const char *diff_env = getenv("DIFF");
                     const char *diff_cmd = diff_env ? diff_env : "diff -U 16";
                     char *diff = g_strdup_printf("%s %s %s", diff_cmd,
@@ -1974,8 +1976,13 @@ int main(int argc, char *argv[])
     const char *arch = qtest_get_arch();
     const bool has_kvm = qtest_has_accel("kvm");
     const bool has_tcg = qtest_has_accel("tcg");
+    char *v_env = getenv("V");
     int ret;
 
+    if (v_env) {
+        verbosity_level = atoi(v_env);
+    }
+
     g_test_init(&argc, &argv, NULL);
 
     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
-- 
2.31.1



  parent reply	other threads:[~2023-01-31 10:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 10:11 [PULL 00/27] qtest and misc patches Thomas Huth
2023-01-31 10:11 ` [PULL 01/27] tests/qtest: netdev: test stream and dgram backends Thomas Huth
2023-01-31 10:11 ` [PULL 02/27] tests/qtest/qom-test: Stop spamming the test log Thomas Huth
2023-01-31 10:11 ` Thomas Huth [this message]
2023-01-31 10:11 ` [PULL 04/27] hw/misc/sifive_u_otp: Remove the deprecated OTP config with '-drive if=none' Thomas Huth
2023-01-31 10:11 ` [PULL 05/27] configs/targets/nios2-softmmu: Add TARGET_NEED_FDT=y to the nios2 config Thomas Huth
2023-01-31 10:11 ` [PULL 06/27] travis.yml: Use the libfdt from the distro instead of the submodule Thomas Huth
2023-01-31 10:11 ` [PULL 07/27] travis.yml: Remove the generic addons section Thomas Huth
2023-01-31 10:11 ` [PULL 08/27] tests/docker/dockerfiles: Add libfdt to the i386 and to the riscv64 container Thomas Huth
2023-01-31 10:11 ` [PULL 09/27] qemu/bswap: Replace bswapXX() by compiler __builtin_bswap() Thomas Huth
2023-01-31 10:11 ` [PULL 10/27] qemu/bswap: Replace bswapXXs() " Thomas Huth
2023-01-31 10:11 ` [PULL 11/27] qemu/bswap: Remove <byteswap.h> dependency Thomas Huth
2023-01-31 10:11 ` [PULL 12/27] qemu/bswap: Use compiler __builtin_bswap() on Haiku Thomas Huth
2023-01-31 10:11 ` [PULL 13/27] qemu/bswap: Use compiler __builtin_bswap() on FreeBSD Thomas Huth
2023-01-31 10:11 ` [PULL 14/27] qemu/bswap: Use compiler __builtin_bswap() on NetBSD Thomas Huth
2023-01-31 10:11 ` [PULL 15/27] MAINTAINERS: Abort HAXM maintenance Thomas Huth
2023-01-31 10:11 ` [PULL 16/27] docs/about/deprecated: Mark HAXM in QEMU as deprecated Thomas Huth
2023-01-31 10:11 ` [PULL 17/27] tests/tcg: Do not build/run TCG tests if TCG is disabled Thomas Huth
2023-01-31 10:11 ` [PULL 18/27] tests/qtest/vnc-display-test: Suppress build warnings on Windows Thomas Huth
2023-01-31 10:11 ` [PULL 19/27] tests/qtest/vnc-display-test: Use the 'none' machine Thomas Huth
2023-01-31 10:11 ` [PULL 20/27] tests/qtest/vnc-display-test: Disable on Darwin Thomas Huth
2023-01-31 10:11 ` [PULL 21/27] tests/qtest/boot-serial-test: Constify tests[] array Thomas Huth
2023-01-31 10:12 ` [PULL 22/27] docs/s390x/pcidevices: document pci devices on s390x Thomas Huth
2023-01-31 10:12 ` [PULL 23/27] qapi, audio: add query-audiodev command Thomas Huth
2023-01-31 10:12 ` [PULL 24/27] qapi, audio: Make introspection reflect build configuration more closely Thomas Huth
2023-01-31 10:12 ` [PULL 25/27] gitlab-ci.d/buildtest: Remove ppc-softmmu from the clang-system job Thomas Huth
2023-01-31 10:12 ` [PULL 26/27] tests/qtest/display-vga-test: Add proper checks if a device is available Thomas Huth
2023-01-31 10:12 ` [PULL 27/27] gitlab-ci.d/buildtest: Merge the --without-default-* jobs Thomas Huth
2023-02-02 18:00 ` [PULL 00/27] qtest and misc patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131101205.1499867-4-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).