Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754596AbdIGITT (ORCPT ); Thu, 7 Sep 2017 04:19:19 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:34404 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754477AbdIGITN (ORCPT ); Thu, 7 Sep 2017 04:19:13 -0400 X-Google-Smtp-Source: ADKCNb7EHrlUavcF/6hJbzBozrUU6EYOCQzIn/Xgs9p/0jUPTf4wFrmY8QodcwNDMSqYCX4eL/IfVQ== From: naresh.kamboju@linaro.org To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org, daniel@iogearbox.net Cc: linux-kernel@vger.kernel.org, davem@davemloft.net Subject: [PATCH v2 2/2] selftests: bpf: test_kmod.sh: use modprobe on target device Date: Thu, 7 Sep 2017 13:49:02 +0530 Message-Id: <1504772342-21878-2-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504772342-21878-1-git-send-email-naresh.kamboju@linaro.org> References: <1504772342-21878-1-git-send-email-naresh.kamboju@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 38 From: Naresh Kamboju on ARM and ARM64 devices kernel source tree is not available so insmod "$SRC_TREE/lib/test_bpf.ko" is not working. on these target devices the test_bpf.ko is installed under /lib/modules/`uname -r`/kernel/lib/ so use modprobe dry run to check for missing test_bpf.ko module and insert for testing. Signed-off-by: Naresh Kamboju --- tools/testing/selftests/bpf/test_kmod.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index a53eb1cb54ef..eab9a970d742 100755 --- a/tools/testing/selftests/bpf/test_kmod.sh +++ b/tools/testing/selftests/bpf/test_kmod.sh @@ -14,6 +14,16 @@ test_run() if [ $? -ne 0 ]; then rc=1 fi + else + # Use modprobe dry run to check for missing test_bpf module + if ! /sbin/modprobe -q -n test_bpf; then + echo "test_bpf: [SKIP]" + elif /sbin/modprobe -q test_bpf; then + echo "test_bpf: ok" + else + echo "test_bpf: [FAIL]" + rc=1 + fi fi rmmod test_bpf 2> /dev/null dmesg | grep FAIL -- 2.13.0