summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/cgroup/test_cpuset_prs.sh
AgeCommit message (Collapse)AuthorFilesLines
2022-11-22kselftest/cgroup: Add cleanup() to test_cpuset_prs.shKamalesh Babulal1-1/+16
Install a cleanup function using the trap command for signals EXIT, SIGINT, SIGQUIT and SIGABRT. The cleanup function will perform: 1. Online the CPUs that were made offline during the test. 2. Removing the cgroups created. 3. Restoring the original /sys/kernel/debug/sched/verbose value, currently it's left turned on, irrespective of the original configuration value. the test performs steps 1 and 2, on the successful runs, but not during all of the failed runs. With the cleanup(), the system will perform all three steps during failed/passed test runs. Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Acked-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2022-11-15kselftest/cgroup: Fix gathering number of CPUsBreno Leitao1-1/+1
test_cpuset_prs.sh is failing with the following error: test_cpuset_prs.sh: line 29: [[: 8 57%: syntax error in expression (error token is "57%") This is happening because `lscpu | grep "^CPU(s)"` returns two lines in some systems (such as Debian unstable): # lscpu | grep "^CPU(s)" CPU(s): 8 CPU(s) scaling MHz: 55% This is a simple fix that discard the second line. Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2022-09-04kselftest/cgroup: Add cpuset v2 partition root state testWaiman Long1-0/+674
Add a test script test_cpuset_prs.sh with a helper program wait_inotify for exercising the cpuset v2 partition root state code. Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>