]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.17.12/selftests-intel_pstate-return-kselftest-skip-code-for-skipped-tests.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.17.12 / selftests-intel_pstate-return-kselftest-skip-code-for-skipped-tests.patch
CommitLineData
722b7c48
GKH
1From foo@baz Sat Jul 28 10:14:30 CEST 2018
2From: "Shuah Khan (Samsung OSG)" <shuah@kernel.org>
3Date: Thu, 3 May 2018 17:09:40 -0600
4Subject: selftests: intel_pstate: return Kselftest Skip code for skipped tests
5
6From: "Shuah Khan (Samsung OSG)" <shuah@kernel.org>
7
8[ Upstream commit 5c30a038fb8ec8cdff011e6b5d5d51eb415381d4 ]
9
10When intel_pstate test is skipped because of unmet dependencies and/or
11unsupported configuration, it returns 0 which is treated as a pass
12by the Kselftest framework. This leads to false positive result even
13when the test could not be run.
14
15Change it to return kselftest skip code when a test gets skipped to
16clearly report that the test could not be run.
17
18Kselftest framework SKIP code is 4 and the framework prints appropriate
19messages to indicate that the test is skipped.
20
21Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
22Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 tools/testing/selftests/intel_pstate/run.sh | 5 ++++-
26 1 file changed, 4 insertions(+), 1 deletion(-)
27
28--- a/tools/testing/selftests/intel_pstate/run.sh
29+++ b/tools/testing/selftests/intel_pstate/run.sh
30@@ -30,9 +30,12 @@
31
32 EVALUATE_ONLY=0
33
34+# Kselftest framework requirement - SKIP code is 4.
35+ksft_skip=4
36+
37 if ! uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ | grep -q x86; then
38 echo "$0 # Skipped: Test can only run on x86 architectures."
39- exit 0
40+ exit $ksft_skip
41 fi
42
43 max_cpus=$(($(nproc)-1))