* [LTP] [PATCH] cgroup_fj/cgroup_fj_stress.sh: Fix failures on cgroup unmounted case
@ 2015-12-14 7:57 Guangwen Feng
2015-12-14 10:07 ` Cedric Hnyda
0 siblings, 1 reply; 2+ messages in thread
From: Guangwen Feng @ 2015-12-14 7:57 UTC (permalink / raw)
To: ltp
Test fails when cgroup subsystem is not mounted beforehand because of
the misused "mounted" in setup(), which doesn't represent the current
mount status exactly but the mount status before the test, so fix this.
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
---
testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh | 3 ---
testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh | 7 +++++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh
index 88cf735..3b53b63 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh
@@ -194,9 +194,6 @@ if [ $mount_times -ne 1 ]; then
setup;
$TESTROOT/cgroup_fj_proc &
pid=$!
- if [ $mounted -ne 1 ]; then
- mount_cgroup;
- fi
mkdir_subgroup;
if [ "$subsystem" == "cpuset" ]; then
if [ "$exist_cpuset" != "" ]; then
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh
index c035498..8daf8d6 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_utility.sh
@@ -430,15 +430,18 @@ setup()
if [ "$mount_point" == "" ]; then
mounted=0
+ mounted_now=0
mount_point=/dev/cgroup
+ else
+ mounted_now=1
fi
- if [ -e $mount_point ] && [ $mounted -ne 1 ]; then
+ if [ -e $mount_point ] && [ $mounted_now -ne 1 ]; then
rm -rf $mount_point
cleanup
fi
- if [ $mounted -ne 1 ]; then
+ if [ $mounted_now -ne 1 ]; then
do_mkdir 1 1 $mount_point
mount_cgroup
fi
--
1.8.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-14 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-14 7:57 [LTP] [PATCH] cgroup_fj/cgroup_fj_stress.sh: Fix failures on cgroup unmounted case Guangwen Feng
2015-12-14 10:07 ` Cedric Hnyda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox