[LTP] [RFC PATCH 9/9] testcases: cpuset: Check if "getconf" is available

Mylène Josserand mylene.josserand@bootlin.com
Mon Apr 23 11:46:39 CEST 2018


The "getconf" binary is used by cpuset_regression_test.sh
and may not be installed in the system. The test will fail
but it is a misconfiguration so let's use "tst_check_cmds"
to check if this binary is available and return a TCONF error
if not.

Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
---
 testcases/kernel/controllers/cpuset/cpuset_regression_test.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh b/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
index 4a104a3ad..96a57955c 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
@@ -34,6 +34,8 @@ setup()
 		tst_brkm TCONF "Test must be run with kernel 3.18.0 or newer"
 	fi
 
+	tst_check_cmds "getconf"
+
 	local cpu_num=$(getconf _NPROCESSORS_ONLN)
 	if [ $cpu_num -lt 2 ]; then
 		tst_brkm TCONF "We need 2 cpus at least to have test"
-- 
2.11.0



More information about the ltp mailing list