[PATCH 07/13] mem/thp01: Add proper runtime support
Cyril Hrubis <[email protected]>
| Newsgroups | gmane.linux.ltp |
|---|---|
| Message-ID | <[email protected]> |
The test was executed with -I 120 in all instances. It's cleaner to define the min_runtime in the test and loop the test function until it's exhausted. One of the bonuses we get from this conversion is that the TPASS message is printed once at the end of the test and we do not flood the logs. Signed-off-by: Cyril Hrubis <[email protected]> --- runtest/cve | 2 +- runtest/mm | 2 +- testcases/kernel/mem/thp/thp01.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/runtest/cve b/runtest/cve index 789e16aac..ca9994868 100644 --- a/runtest/cve +++ b/runtest/cve @@ -1,5 +1,5 @@ # Tests which check for vulnerabilities by CVE number -cve-2011-0999 thp01 -I 120 +cve-2011-0999 thp01 cve-2011-2183 ksm05 cve-2011-2496 vma03 cve-2012-0957 uname04 diff --git a/runtest/mm b/runtest/mm index 98ec0a4c4..c9d460c41 100644 --- a/runtest/mm +++ b/runtest/mm @@ -77,7 +77,7 @@ oom05 oom05 swapping01 swapping01 -i 5 -thp01 thp01 -I 120 +thp01 thp01 thp02 thp02 thp03 thp03 thp04 thp04 diff --git a/testcases/kernel/mem/thp/thp01.c b/testcases/kernel/mem/thp/thp01.c index 91c08cb1b..ab34a15fe 100644 --- a/testcases/kernel/mem/thp/thp01.c +++ b/testcases/kernel/mem/thp/thp01.c @@ -93,8 +93,14 @@ static void thp_test(void) exit(0); } tst_reap_children(); +} + +static void run(void) +{ + while (tst_remaining_runtime()) + thp_test(); - tst_res(TPASS, "system didn't crash."); + tst_res(TPASS, "System didn't crash"); } static void setup(void) @@ -134,9 +140,10 @@ static void cleanup(void) static struct tst_test test = { .needs_root = 1, .forks_child = 1, + .min_runtime = 120, .setup = setup, .cleanup = cleanup, - .test_all = thp_test, + .test_all = run, .tags = (const struct tst_tag[]) { {"linux-git", "a7d6e4ecdb76"}, {"CVE", "2011-0999"}, -- 2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp