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: 118199 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4192386qgn; Tue, 7 Nov 2017 08:36:17 -0800 (PST) X-Google-Smtp-Source: ABhQp+REkMEMPYUk5jKdvBCg9tvUrEkvM6Cc3YeISBeSvu/ZPM/nPVnhisMk0Ahdors293wd/U4n X-Received: by 10.84.128.70 with SMTP id 64mr19049444pla.329.1510072577458; Tue, 07 Nov 2017 08:36:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510072577; cv=none; d=google.com; s=arc-20160816; b=IzdwSOxGrjnaCtUKoROGcoM8kuscYkmG9XQWgKrzZkimKp6kexmRbYGZ9BgdNzGwvv nWjcpOrKR+nV5nSET1AIIQw7UgUX6gliCaaXuUW36UJT8BAnr5c+Xs22fVaP7jlbAnLB 2Y2jCO0nqUXNQM0+r/cuQ1ld9guJAHffAgnC3rGtm+tzi5vqzox1ddTCJzub9OZywL2T MuWimxt1s02XtnlktI7cCJufb3pxyR3b0wR/lMFIV46InXuWhBKPvhuArmgo5l8+sq2h lR2RMpwuPECT5zoHcKgIjtAVGt2OIKfGhizXRMydl0U9nPS98F9ngjWwJg7l8Kn9mBvB +A4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3wLX3PC/sql/wE5CZPq4BwpKX+nVMZ4tk8nIkz2Co4E=; b=IPHYRPF7A1o5QBl+8SIwp1+E4YENWc3IA6Nim1H60wgWnlxdOunx6QFJVYq+M7W3CR vhD5GdLpHtPGJ1rjES4n/GRyhevFI4FrwUgw5o7x9b9Fm/1kjRRoqTO8OJvLVpoC4tzH 1ya26q1z7xszo8qtrrX6J5yCSAj6QtlTb/THjK60DptkOVAAwsCJg7R6sepEyy6/DbHj KCu97alM79gKy82HdtRTs7HDhPxJRiu8jSKqdc8ODkTxmVEd2Z+CQ9Kmy3rf4OzrjEM0 XhMgZxwCWYxRtDib7u4uQxeDw7F9Aa14hYNbHN4u1+O/mex4zErX/TKBwBMTK4w+XjgN /7Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dGo1e8o5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q61si1565578plb.119.2017.11.07.08.36.17; Tue, 07 Nov 2017 08:36:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dGo1e8o5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758185AbdKGQgQ (ORCPT + 26 others); Tue, 7 Nov 2017 11:36:16 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:48449 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758143AbdKGQgM (ORCPT ); Tue, 7 Nov 2017 11:36:12 -0500 Received: by mail-pg0-f65.google.com with SMTP id v78so11455702pgb.5 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=bIkIgwaiXpz7cgP3gm6gLX5GmG13wN4DeUL9tOZPkZfYEZzh+UWNU/1cutQBYkbCNL /SrzGOeCryw6n2YjaR5b9BFCT3NpIUSn5mpOc1ujdTpDKwbW0DLGNI3Xy2EGoi5t1IFK DuPRG0RDFnjxkLVhl/aR6KPoXWiYvSFEYLN0xn8ZJw+nFYL8Y5cAJ8SZNIpXlHs3t0UL g67NEjuAIQRNIk+q/DNxfugKDledP4wPMWi8JvAR2dXEJhLxHdw/cDf09yv4+NHdRL/k 1u3nqC/oGjAmxKGf9r+dwqcQUWb1Of5KUTRsncwZpJqcer77ZDB62EoYBTXx5J4Nf3mc 2H/A== X-Gm-Message-State: AMCzsaVJVN8LarV3MHSW2ccaAwxLkYBISHB0MZwknz9kpXgifmei2+hY em7ITHyyaxKas1XC+KSjs94Huw== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) -- 2.14.2 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