From: yong yiran <yong.yiran(a)zte.com.cn>
'sys/types.h' included in 'cs_prctl_test.c' is duplicated.
Remove all but the first include of sys/types.h from cs_prctl_test.c.
'sys/wait.h' include in 'cs_prctl_test.c' is duplicated.
Remove all but the first include of sys/wait.h from cs_prctl_test.c.
Reported-by: Zeal Robot <zealci(a)zte.com.cn>
Signed-off-by: yong yiran <yong.yiran(a)zte.com.cn>
---
tools/testing/selftests/sched/cs_prctl_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/sched/cs_prctl_test.c b/tools/testing/selftests/sched/cs_prctl_test.c
index 63fe6521c56d..7db9cf822dc7 100644
--- a/tools/testing/selftests/sched/cs_prctl_test.c
+++ b/tools/testing/selftests/sched/cs_prctl_test.c
@@ -25,8 +25,6 @@
#include <sys/types.h>
#include <sched.h>
#include <sys/prctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
#include <unistd.h>
#include <time.h>
#include <stdio.h>
--
2.25.1
Hi Alexey,
When lkp team run kernel selftests, we found after these series of patches, testcase mqueue: mq_perf_tests
in kselftest failed with following message.
If you confirm and fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot lkp(a)intel.com
```
# selftests: mqueue: mq_perf_tests
#
# Initial system state:
# Using queue path: /mq_perf_tests
# RLIMIT_MSGQUEUE(soft): 819200
# RLIMIT_MSGQUEUE(hard): 819200
# Maximum Message Size: 8192
# Maximum Queue Size: 10
# Nice value: 0
#
# Adjusted system state for testing:
# RLIMIT_MSGQUEUE(soft): (unlimited)
# RLIMIT_MSGQUEUE(hard): (unlimited)
# Maximum Message Size: 16777216
# Maximum Queue Size: 65530
# Nice value: -20
# Continuous mode: (disabled)
# CPUs to pin: 3
# ./mq_perf_tests: mq_open() at 296: Too many open files
not ok 2 selftests: mqueue: mq_perf_tests # exit=1
```
Test env:
rootfs: debian-10
gcc version: 9
------
Thanks
Ma Xinjian
There are several test cases in the vm directory are still using
exit 0 when they need to be skipped. Use kselftest framework skip
code instead so it can help us to distinguish the return status.
Criterion to filter out what should be fixed in vm directory:
grep -r "exit 0" -B1 | grep -i skip
This change might cause some false-positives if people are running
these test scripts directly and only checking their return codes,
which will change from 0 to 4. However I think the impact should be
small as most of our scripts here are already using this skip code.
And there will be no such issue if running them with the kselftest
framework.
Signed-off-by: Po-Hsu Lin <po-hsu.lin(a)canonical.com>
---
tools/testing/selftests/vm/charge_reserved_hugetlb.sh | 5 ++++-
tools/testing/selftests/vm/hugetlb_reparenting_test.sh | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/vm/charge_reserved_hugetlb.sh b/tools/testing/selftests/vm/charge_reserved_hugetlb.sh
index 18d3368..fe8fcfb 100644
--- a/tools/testing/selftests/vm/charge_reserved_hugetlb.sh
+++ b/tools/testing/selftests/vm/charge_reserved_hugetlb.sh
@@ -1,11 +1,14 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
set -e
if [[ $(id -u) -ne 0 ]]; then
echo "This test must be run as root. Skipping..."
- exit 0
+ exit $ksft_skip
fi
fault_limit_file=limit_in_bytes
diff --git a/tools/testing/selftests/vm/hugetlb_reparenting_test.sh b/tools/testing/selftests/vm/hugetlb_reparenting_test.sh
index d11d1fe..4a9a3af 100644
--- a/tools/testing/selftests/vm/hugetlb_reparenting_test.sh
+++ b/tools/testing/selftests/vm/hugetlb_reparenting_test.sh
@@ -1,11 +1,14 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
set -e
if [[ $(id -u) -ne 0 ]]; then
echo "This test must be run as root. Skipping..."
- exit 0
+ exit $ksft_skip
fi
usage_file=usage_in_bytes
--
2.7.4