From: Martin Doucha <mdoucha@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] Taint check: Use TFAIL instead of TBROK in fork_testrun()
Date: Wed, 19 Aug 2020 13:04:06 +0200 [thread overview]
Message-ID: <20200819110406.25099-1-mdoucha@suse.cz> (raw)
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
doc/test-writing-guidelines.txt | 6 +++---
lib/tst_test.c | 6 ++++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index b2265a778..252e91ffc 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -1567,9 +1567,9 @@ the test.
LTP library will then automatically check kernel taint at the end of testing.
If '.all_filesystems' is set in struct tst_test, taint check will be performed
-after each file system and testing may be aborted early by 'TBROK'. You can
-optionally also call 'tst_taint_check()' during 'run()', which returns 0 or
-the tainted flags set in '/proc/sys/kernel/tainted' as specified earlier.
+after each file system and taint will abort testing early with 'TFAIL'. You
+can optionally also call 'tst_taint_check()' during 'run()', which returns 0
+or the tainted flags set in '/proc/sys/kernel/tainted' as specified earlier.
Depending on your kernel version, not all tainted-flags will be supported.
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 3a37f61ca..28f8843cf 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1282,8 +1282,10 @@ static int fork_testrun(void)
alarm(0);
SAFE_SIGNAL(SIGINT, SIG_DFL);
- if (tst_test->taint_check && tst_taint_check())
- tst_brk(TBROK, "Kernel is now tainted.");
+ if (tst_test->taint_check && tst_taint_check()) {
+ tst_res(TFAIL, "Kernel is now tainted.");
+ return TFAIL;
+ }
if (WIFEXITED(status) && WEXITSTATUS(status))
return WEXITSTATUS(status);
--
2.28.0
next reply other threads:[~2020-08-19 11:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 11:04 Martin Doucha [this message]
2020-08-21 9:42 ` [LTP] [PATCH] Taint check: Use TFAIL instead of TBROK in fork_testrun() Jan Stancek
2020-08-24 17:41 ` Petr Vorel
2020-08-25 7:27 ` Li Wang
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=20200819110406.25099-1-mdoucha@suse.cz \
--to=mdoucha@suse.cz \
--cc=ltp@lists.linux.it \
/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