public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/2] tst_test: Don't print hints if failed to acquire
Date: Wed, 29 May 2024 19:51:08 +0200	[thread overview]
Message-ID: <ZldrDNzrnXcI9XJ7@yuki> (raw)
In-Reply-To: <20240527202858.350200-2-pvorel@suse.cz>

Hi!
This is a great catch but I do not think that it should be limited to
the device init. We should distable the hints during the whole library
setup and only enable them once we actually start running the test.

I guess that we need:

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 190e8da2a..47d0ecf7d 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -61,6 +61,7 @@ static int mntpoint_mounted;
 static int ovl_mounted;
 static struct timespec tst_start_time; /* valid only for test pid */
 static int tdebug;
+static int show_failure_hints;

 struct results {
        int passed;
@@ -883,7 +884,8 @@ static void do_exit(int ret)

                if (results->broken) {
                        ret |= TBROK;
-                       print_failure_hints();
+                       if (show_failure_hints)
+                               print_failure_hints();
                }

                fprintf(stderr, "\nSummary:\n");
@@ -1740,6 +1742,8 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
        if (tst_test->test_variants)
                test_variants = tst_test->test_variants;

+       show_failure_hints = 1;
+
        for (tst_variant = 0; tst_variant < test_variants; tst_variant++) {
                if (tst_test->all_filesystems)
                        ret |= run_tcases_per_fs();



-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-05-29 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 20:28 [LTP] [PATCH 1/2] tst_device: Print info about acquiring device Petr Vorel
2024-05-27 20:28 ` [LTP] [PATCH 2/2] tst_test: Don't print hints if failed to acquire Petr Vorel
2024-05-29 17:51   ` Cyril Hrubis [this message]
2024-05-30 14:49     ` Petr Vorel
2024-05-28  6:03 ` [LTP] [PATCH 1/2] tst_device: Print info about acquiring device Andrea Cervesato via ltp
2024-05-28  7:50   ` Wei Gao via ltp
2024-05-29 15:34 ` Cyril Hrubis

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=ZldrDNzrnXcI9XJ7@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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