Return-Path: From: Wang Mingyu Date: Tue, 21 May 2019 04:06:42 -0700 Message-ID: <1558436802-7323-4-git-send-email-wangmy@cn.fujitsu.com> In-Reply-To: <1558436802-7323-1-git-send-email-wangmy@cn.fujitsu.com> References: <1558436802-7323-1-git-send-email-wangmy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Fuego] [PATCH] Add a general mechanism to check that a module is available and insertable, for test_precheck. List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org eg. function test_pre_check { assert_has_module atmtcp } Signed-off-by: Wang Mingyu --- scripts/functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/functions.sh b/scripts/functions.sh index 2270f4f..1b7b198 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -1045,6 +1045,13 @@ function assert_has_program { assert_define ${progVar} "Missing '$1' program on target board" } +# check for a module on the target, and send message if the module is not available +# $1 has the module that is required on the target board +function assert_has_module { + moduleName=$1 + cmd "modprobe $moduleName" || abort_job "$moduleName is not available. Make sure you use the correct module name for this test/benchmark." +} + # check if the path is an absolute path or a relative path # $1 - the path to check function is_abs_path { -- 1.8.3.1