Skip to content

Commit 1c2124e

Browse files
captain5050acmel
authored andcommitted
perf test shell script: Fix test for python being disabled
"grep -cv" can exit with an error code that causes the "set -e" to abort the script. Switch to using the grep exit code in the if condition to avoid this. Signed-off-by: Ian Rogers <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Ross Zwisler <[email protected]> Cc: Shirisha G <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a734c7f commit 1c2124e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/perf/tests/shell/script.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ test_db()
3636
echo "DB test"
3737

3838
# Check if python script is supported
39-
libpython=$(perf version --build-options | grep python | grep -cv OFF)
40-
if [ "${libpython}" != "1" ] ; then
39+
if perf version --build-options | grep python | grep -q OFF ; then
4140
echo "SKIP: python scripting is not supported"
4241
err=2
4342
return

0 commit comments

Comments
 (0)