public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] mlock05: add log details about the success/failure
@ 2024-07-24 13:05 Filippo Storniolo
  2024-07-24 15:14 ` Cyril Hrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Filippo Storniolo @ 2024-07-24 13:05 UTC (permalink / raw)
  To: ltp, f.storniolo95; +Cc: Filippo Storniolo

In some testing environments, such as those related to safety
critical requirements, more detailed logs are needed when
the executed test passes or fails.
This format already exists in other LTP tests, such as
kernel/security/kallsyms/kallsyms.c

Signed-off-by: Filippo Storniolo <fstornio@redhat.com>
---
 testcases/kernel/syscalls/mlock/mlock05.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/mlock/mlock05.c b/testcases/kernel/syscalls/mlock/mlock05.c
index 8e805736d..8b217beb5 100644
--- a/testcases/kernel/syscalls/mlock/mlock05.c
+++ b/testcases/kernel/syscalls/mlock/mlock05.c
@@ -102,8 +102,15 @@ static void verify_mlock(void)
 	Rss *= 1024;
 	Locked *= 1024;
 
-	TST_EXP_EQ_LU(Rss, MMAPLEN);
-	TST_EXP_EQ_LU(Locked, MMAPLEN);
+	if (Rss == MMAPLEN)
+		tst_res(TPASS, "Pre-faulted %lu bytes and expected %lu", Rss, MMAPLEN);
+	else
+		tst_res(TFAIL, "Pre-faulted %lu bytes but expected %lu", Rss, MMAPLEN);
+
+	if (Locked == MMAPLEN)
+		tst_res(TPASS, "Locked %lu bytes and expected %lu", Locked, MMAPLEN);
+	else
+		tst_res(TFAIL, "Locked %lu bytes but expected %lu", Locked, MMAPLEN);
 
 	SAFE_MUNLOCK(buf, MMAPLEN);
 	SAFE_MUNMAP(buf, MMAPLEN);
-- 
2.44.0


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

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

end of thread, other threads:[~2024-07-30  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 13:05 [LTP] [PATCH] mlock05: add log details about the success/failure Filippo Storniolo
2024-07-24 15:14 ` Cyril Hrubis
2024-07-29 15:43   ` Filippo Storniolo
2024-07-30  7:36     ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox