[LTP] [PATCH v3 3/7] cgroup_regression_test.sh: Remove obselte test_6
Yang Xu
xuyang2018.jy@fujitsu.com
Fri Dec 16 06:01:59 CET 2022
test_6 is a test case when kernel version is less than 3.0.
Since the oldest supported kernel version is 3.0, so the case
is useless. Remove it.
Also rename test9 to test6. modify TST_CNT.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
.../kernel/controllers/cgroup/.gitignore | 1 -
.../cgroup/cgroup_regression_6_1.sh | 4 +-
.../cgroup/cgroup_regression_6_2.c | 36 ------------
...ession_9_2.sh => cgroup_regression_6_2.sh} | 0
.../cgroup/cgroup_regression_9_1.sh | 12 ----
.../cgroup/cgroup_regression_test.sh | 56 ++++---------------
6 files changed, 12 insertions(+), 97 deletions(-)
delete mode 100644 testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c
rename testcases/kernel/controllers/cgroup/{cgroup_regression_9_2.sh => cgroup_regression_6_2.sh} (100%)
delete mode 100755 testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh
diff --git a/testcases/kernel/controllers/cgroup/.gitignore b/testcases/kernel/controllers/cgroup/.gitignore
index 012aedcca..8deae77da 100644
--- a/testcases/kernel/controllers/cgroup/.gitignore
+++ b/testcases/kernel/controllers/cgroup/.gitignore
@@ -1,5 +1,4 @@
/cgroup_regression_fork_processes
/cgroup_regression_getdelays
-/cgroup_regression_6_2
/cgroup_core01
/cgroup_core02
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh
index 822d630a5..d5a3fa933 100755
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh
@@ -6,7 +6,7 @@
trap exit USR1
while true; do
- mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1
- rmdir cgroup/[1-9]* > /dev/null 2>&1
+ mount -t cgroup xxx cgroup/ > /dev/null 2>&1
+ cat cgroup/release_agent > /dev/null 2>&1
umount cgroup/ > /dev/null 2>&1
done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c b/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c
deleted file mode 100644
index b79b93730..000000000
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c
+++ /dev/null
@@ -1,36 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (c) 2009 FUJITSU LIMITED
- * Author: Li Zefan <lizf@cn.fujitsu.com>
- */
-
-#define _GNU_SOURCE
-
-#include <sched.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "test.h"
-
-#define DEFAULT_USEC 30000
-
-int foo(void __attribute__ ((unused)) * arg)
-{
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- int usec;
-
- if (argc == 2)
- usec = atoi(argv[1]);
- else
- usec = DEFAULT_USEC;
-
- while (1) {
- usleep(usec);
- ltp_clone_quick(CLONE_NEWNS, foo, NULL);
- }
-
- tst_exit();
-}
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.sh
similarity index 100%
rename from testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh
rename to testcases/kernel/controllers/cgroup/cgroup_regression_6_2.sh
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh
deleted file mode 100755
index d5a3fa933..000000000
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2009 FUJITSU LIMITED
-# Author: Li Zefan <lizf@cn.fujitsu.com>
-
-trap exit USR1
-
-while true; do
- mount -t cgroup xxx cgroup/ > /dev/null 2>&1
- cat cgroup/release_agent > /dev/null 2>&1
- umount cgroup/ > /dev/null 2>&1
-done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
index 436145788..c241a5c4f 100755
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
@@ -7,7 +7,7 @@
TST_TESTFUNC=test
TST_SETUP=do_setup
TST_CLEANUP=do_cleanup
-TST_CNT=9
+TST_CNT=8
TST_NEEDS_ROOT=1
TST_NEEDS_TMPDIR=1
TST_NEEDS_CMDS="awk dmesg find mountpoint rmdir"
@@ -244,38 +244,26 @@ test5()
}
#---------------------------------------------------------------------------
-# Bug: There was a race between cgroup_clone and umount
-# Kernel: 2.6.24 - 2.6.28, 2.6.29-rcX
-# Links: http://lkml.org/lkml/2008/12/24/124
-# Fix: commit 7b574b7b0124ed344911f5d581e9bc2d83bbeb19
+# Bug: When running 2 concurrent mount/umount threads, lockdep warning
+# may be triggered, it's a false positive, and it's VFS' issue but
+# not cgroup.
+# Kernel: 2.6.24 - 2.6.29-rcX
+# Links: http://lkml.org/lkml/2009/1/4/352
+# Fix: commit ada723dcd681e2dffd7d73345cc8fda0eb0df9bd
#---------------------------------------------------------------------------
test6()
{
- if tst_kvcmp -ge "3.0"; then
- tst_res TCONF "CONFIG_CGROUP_NS is NOT supported in Kernels >= 3.0"
- return
- fi
-
- if ! grep -q -w "ns" /proc/cgroups; then
- tst_res TCONF "CONFIG_CGROUP_NS is NOT enabled"
- return
- fi
-
cgroup_regression_6_1.sh &
local pid1=$!
- cgroup_regression_6_2 &
+ cgroup_regression_6_2.sh &
local pid2=$!
- tst_res TINFO "run test for 30 sec"
sleep 30
- kill -USR1 $pid1
- kill -TERM $pid2
+ kill -USR1 $pid1 $pid2
wait $pid1 2>/dev/null
wait $pid2 2>/dev/null
- mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1
- rmdir cgroup/[1-9]* > /dev/null 2>&1
- tst_umount $PWD/cgroup
+ umount cgroup/ 2> /dev/null
check_kernel_bug
}
@@ -396,29 +384,5 @@ test8()
check_kernel_bug
}
-#---------------------------------------------------------------------------
-# Bug: When running 2 concurrent mount/umount threads, lockdep warning
-# may be triggered, it's a false positive, and it's VFS' issue but
-# not cgroup.
-# Kernel: 2.6.24 - 2.6.29-rcX
-# Links: http://lkml.org/lkml/2009/1/4/352
-# Fix: commit ada723dcd681e2dffd7d73345cc8fda0eb0df9bd
-#---------------------------------------------------------------------------
-test9()
-{
- cgroup_regression_9_1.sh &
- local pid1=$!
- cgroup_regression_9_2.sh &
- local pid2=$!
-
- sleep 30
- kill -USR1 $pid1 $pid2
- wait $pid1 2>/dev/null
- wait $pid2 2>/dev/null
-
- umount cgroup/ 2> /dev/null
- check_kernel_bug
-}
-
. cgroup_lib.sh
tst_run
--
2.27.0
More information about the ltp
mailing list