Linux Test Project
 help / color / mirror / Atom feed
From: Li Wang <li.wang@linux.dev>
To: Cyril Hrubis <chrubis@suse.cz>, pvorel@suse.cz, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: tst_test: tst_reinit() abort when already initialized
Date: Thu, 7 May 2026 17:02:21 +0800	[thread overview]
Message-ID: <afxVF3S-m9zDuZnF@linux.dev> (raw)
In-Reply-To: <afxQIR7bdmlJmCIr@linux.dev>

> > I guess that we also need to revert:

I look into Petr's patch, seems we can go another way to replace
the checkpoint method.

How about this:

--- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c
+++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c
@@ -34,10 +34,7 @@ static void run(void)
        file = SAFE_MMAP(NULL, MMAPSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
        SAFE_CLOSE(fd);

-       tst_reinit();
-       TST_CHECKPOINT_WAIT(0);
-       /* keep running until ima_violations.sh open and close file */
-       TST_CHECKPOINT_WAKE_AND_WAIT(0);
+       raise(SIGSTOP);

        tst_res(TPASS, "test completed");
 }
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
index d7dcd077b..e772cf53b 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
@@ -156,6 +156,14 @@ test2()
        validate $num_violations $count $search
 }

+wait_process_stopped()
+{
+       while true; do
+               [ "$(awk '{print $3}' /proc/$1/stat 2>/dev/null)" = "T" ] && break
+               usleep 100000
+       done
+}
+
 test3()
 {
        local pid
@@ -173,13 +181,13 @@ test3()
        ima_mmap -f $FILE &
        pid=$!

-       # wait for violations appear in logs
-       TST_CHECKPOINT_WAKE_AND_WAIT 0
+       wait_process_stopped $pid

        open_file_read
        close_file_read

-       TST_CHECKPOINT_WAKE 0
+       kill -CONT $pid
+       wait $pid

        validate $num_violations $count $search


-- 
Regards,
Li Wang

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

  reply	other threads:[~2026-05-07  9:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30  9:19 [LTP] [PATCH] lib: tst_test: tst_reinit() abort when already initialized Cyril Hrubis
2026-04-30 10:19 ` Andrea Cervesato via ltp
2026-04-30 10:34 ` Li Wang
2026-04-30 12:53   ` Cyril Hrubis
2026-05-07  1:00     ` Li Wang
2026-05-07  6:58       ` Cyril Hrubis
2026-05-07  8:41         ` Li Wang
2026-05-07  9:02           ` Li Wang [this message]
2026-05-07  9:08             ` Cyril Hrubis
2026-05-07  9:13               ` Li Wang
2026-04-30 11:38 ` [LTP] " linuxtestproject.agent

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=afxVF3S-m9zDuZnF@linux.dev \
    --to=li.wang@linux.dev \
    --cc=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