blob: c2ef899cc5aa7a98aea42cc53a15445253730b19 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 5a77e2bdc083f4f842a8ba7c2db1a7ac6e5f0664 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 31 May 2017 21:26:05 -0400
4Subject: [PATCH] Add periodic output for long time test.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005
6This is needed in context of having scripts running ltp tests and
7waiting with a timeout for the output of the tests.
8
9Signed-off-by: Tudor Florea <tudor.florea@enea.com>
10Upstream-Status: Pending
11
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012Signed-off-by: Dengke Du <dengke.du@windriver.com>
13---
14 .../kernel/controllers/memcg/stress/memcg_stress_test.sh | 11 ++++++++---
15 1 file changed, 8 insertions(+), 3 deletions(-)
16
17diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
18index af1a708..084e628 100755
19--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
20+++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
21@@ -37,7 +37,8 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022 exit 0
23 fi
24
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025-RUN_TIME=$(( 15 * 60 ))
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026+ONE_MINUTE=60
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027+RUN_TIME=15
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028
29 cleanup()
30 {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050031@@ -62,7 +63,7 @@ do_mount()
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032 # $1 - Number of cgroups
33 # $2 - Allocated how much memory in one process? in MB
34 # $3 - The interval to touch memory in a process
35-# $4 - How long does this test run ? in second
36+# $4 - How long does this test run ? in minutes
37 run_stress()
38 {
39 do_mount;
Brad Bishopd7bf8c12018-02-25 22:55:05 -050040@@ -81,7 +82,11 @@ run_stress()
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050041 eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null
42 done
43
44- sleep $4
45+ for i in $(seq 0 $(($4-1)))
46+ do
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047+ eval echo "Started $i min ago. Still alive... "
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048+ sleep $ONE_MINUTE
49+ done
50
51 for i in $(seq 0 $(($1-1)))
52 do
Brad Bishopd7bf8c12018-02-25 22:55:05 -050053--
542.8.1
55