From patchwork Tue Nov 7 16:35:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 835370 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="dGo1e8o5"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWZnj0lWCz9rvt for ; Wed, 8 Nov 2017 03:36:41 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758174AbdKGQgQ (ORCPT ); Tue, 7 Nov 2017 11:36:16 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:54489 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758165AbdKGQgM (ORCPT ); Tue, 7 Nov 2017 11:36:12 -0500 Received: by mail-pg0-f65.google.com with SMTP id l24so11444769pgu.11 for ; Tue, 07 Nov 2017 08:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3wLX3PC/sql/wE5CZPq4BwpKX+nVMZ4tk8nIkz2Co4E=; b=dGo1e8o5QbKZpNSgizAPKAZdV/VAZzjmiP2Mc1rqy6DMhqdeL/v5ftYEeIC0/dwbPc VbYIwmylgc/la3HkUWXtdOCSicPYQzKsM3EylHpX5Y9K4q4yO/L8afGzJMuWoUhy8Niy H9PnTefpC+s5eQB2VcKIKiKn7bK/Ubb3WlCMo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3wLX3PC/sql/wE5CZPq4BwpKX+nVMZ4tk8nIkz2Co4E=; b=Avu/JOd70UBnG3PNfs9eeyCqs0PemHRQj2DyipHeucKjl4a2BzbYPPxtjhNYUetx1L 5nfpMtmmab7Y95Z7uilLUtJ8vS3qZ9aBqEP8tnThZd4PNhItZ3/y9YP9EogrYtZiuBb7 NOD8DlbHr71u8xnkN9NchAIsqWCmzNzNJ/4BdU0DvD9eN/8qqTPbwxZrzGcFDm3+nzDY T0QHnTKJEYvmsag09GP22/5YD93TUOIDYief1Lxj7qabw4/PTTmHixnhRC7J2bfMV00D 0RCPk49vBELoj9sND4wWg46/EzM99QwbeQSGGCfHE6g5JER3Nb7AExer9yM11WqSaJ4C DSGQ== X-Gm-Message-State: AMCzsaUz3dUsx16PRNbAmR9hJH8XdBsyGLjEKmmJ1T6dJBZNVatSJEHn +IA/V6hUqN4u9ELT6hewHoL14w== X-Google-Smtp-Source: ABhQp+TmbN+kUR2/Df+HMaTvNnYNmSbuTQHmm6TK2XsJkYf1kNTxjGbZNqyw8onvYBbnxJ6oR4yViA== X-Received: by 10.84.253.144 with SMTP id a16mr18314854plm.177.1510072571638; Tue, 07 Nov 2017 08:36:11 -0800 (PST) Received: from localhost.localdomain ([122.175.18.187]) by smtp.gmail.com with ESMTPSA id u76sm4201843pfk.181.2017.11.07.08.36.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 08:36:10 -0800 (PST) From: naresh.kamboju@linaro.org To: shuahkh@osg.samsung.com, shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: daniel@iogearbox.net, alexei.starovoitov@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] selftests: bpf: test_kmod.sh: use modprobe on target device Date: Tue, 7 Nov 2017 22:05:53 +0530 Message-Id: <1510072553-7753-2-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510072553-7753-1-git-send-email-naresh.kamboju@linaro.org> References: <1510072553-7753-1-git-send-email-naresh.kamboju@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 2e5a1049e2f2..4757ca7d163c 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