From patchwork Tue Feb 6 21:07:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 127097 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3279618ljc; Tue, 6 Feb 2018 13:07:36 -0800 (PST) X-Google-Smtp-Source: AH8x224XxiTwZzbKsmsjI+33SENZN/gHHy+x8Y6IJkF+HPTL44Mn9h3MBQQEnjTe6uTWETgNbLnw X-Received: by 2002:a17:902:b082:: with SMTP id p2-v6mr3640302plr.314.1517951256651; Tue, 06 Feb 2018 13:07:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517951256; cv=none; d=google.com; s=arc-20160816; b=J/le4yUiTAp30GdAGrLXUftw6whcyGhDZD9db4bpn1kIUYNOmJijaDXyy00DoLnYBs 6Bnxdf00o/WKA+BUdaZPYq2bg3CvxuNPr+lkhmrjnV1vrk1EYnEo+GXd/i289tbTdVl4 0HWZlIw56aB1lU5OhkJkyp3uIz0+gVSjwIkqTopVrNfkE+btBS/X1OGhTMWVzuhGwdB0 U2DoyN88xXIOCljv4yDgxtFLrGhlBySl3dzV/Iu0y/xNBqfU44XevaAcLGOftGj+TQv2 vHM3+qj4dUyBUJC+fhzQvM7qNRHUAPhBYmozi55Q4YTYjGmtzCdw8n8XgqYDFypVnBdZ zjsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=f4OXOrGEpPu4nJWBrJm/0LmyLWpSxfdUz5hv+3+AGkY=; b=bzLti5T+YObP/7BALFqo3lwJNjKqHKIjT39zBf8CfPMqk1EfotvKc+Jra5xX0RpXDC jSWmhCIoPalz+RtAmtibDptfBUp4d+1KIVA3HSQXRAxzGf+eVRR//wbamfxRd0v9YU25 b9um6QtYajrZS5sn0qg4XzzrkinD37I8d3OAKzFy8+nbTDIuRNvPlI5Y/AX1FmgalGdy hr2WSlSbCU9lXBy240d5ipmvO43Qgyb1ldYlIxpsCJHyYyGV0PfDxi7xzuoZMJZPq/iC bHP6kXpPXe/sI3hlK4WkKxqLI7rPMZkevTEVyQzhUPnuFOyK6vHEacj0UyUknXg2JgEL isRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iUx1Vmdc; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 v80si373074pfj.80.2018.02.06.13.07.36; Tue, 06 Feb 2018 13:07:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-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=iUx1Vmdc; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 S1754035AbeBFVHd (ORCPT + 8 others); Tue, 6 Feb 2018 16:07:33 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44282 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754020AbeBFVHb (ORCPT ); Tue, 6 Feb 2018 16:07:31 -0500 Received: by mail-pl0-f68.google.com with SMTP id f8so2042417plk.11 for ; Tue, 06 Feb 2018 13:07:31 -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; bh=f4OXOrGEpPu4nJWBrJm/0LmyLWpSxfdUz5hv+3+AGkY=; b=iUx1Vmdc8SL53juEB4a7J/KNkzuW61AYuu27Y22dEO/mfIlsp8zFL5Fwq27geGvUz3 mYzmn6ux+Zjjhivkr91JbouT4I+wk/V9Zy4RlgFiYYKwNp138jNvgsLsTeikPD95OOiA VboxEKAczdyrW/5x25ZCncJ9xnHX4ICKalhc4= 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; bh=f4OXOrGEpPu4nJWBrJm/0LmyLWpSxfdUz5hv+3+AGkY=; b=CO3Dmvy3ywMDrrqXfNqQBEYTVPgDm5GWwl0NZVS2ILLxEDnmCm++Qefv356899qaKS rh9LGpYlK3qQqT4CV/kEwK53yN6YtYS/7FYDSG6zv5geucWjXox0Si235QS4mtuvBuR1 5w3OJZfuQtBpUqEZvXFfB9xlkQptkB+QjOdvNMoIpR6rCuS9hOUwpxqi0SndoTcNueli hiI5H/FlZoLBpRjh7MwzW0W0slidkC8QXgk1S31irsQ/6r/SX0/xskCArO0tIvOAjPoD QHsIlDZVtxTAIQDnVOifogS2NmdEXzUqJADvSWULqhMTLGOo8JNZ+hR5xdkOa0KlWuU5 Kdqg== X-Gm-Message-State: APf1xPCPjVCblEHnMj4sq0JeoUYEQXJpgzhSMacQNIDhCDSe4nHd0uVU BmkULrxZmHSl6k8CqkV62Y2/FA== X-Received: by 2002:a17:902:6bc3:: with SMTP id m3-v6mr3607421plt.442.1517951250471; Tue, 06 Feb 2018 13:07:30 -0800 (PST) Received: from localhost.localdomain ([183.82.210.238]) by smtp.gmail.com with ESMTPSA id e88sm5518528pfl.80.2018.02.06.13.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Feb 2018 13:07:28 -0800 (PST) From: Naresh Kamboju To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: shuah@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, alexei.starovoitov@gmail.com, ast@kernel.org Subject: [PATCH] selftests: bpf: test_kmod.sh: check the module path before insmod Date: Wed, 7 Feb 2018 02:37:23 +0530 Message-Id: <1517951243-10003-1-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org test_kmod.sh reported false failure when module not present. Check test_bpf.ko is present in the path before loading it. Stop using "insmod $SRC_TREE/lib/test_bpf.ko" instead use "modprobe test_bpf" Signed-off-by: Naresh Kamboju --- tools/testing/selftests/bpf/test_kmod.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index ed4774d..54177b1 100755 --- a/tools/testing/selftests/bpf/test_kmod.sh +++ b/tools/testing/selftests/bpf/test_kmod.sh @@ -1,8 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -SRC_TREE=../../../../ - test_run() { sysctl -w net.core.bpf_jit_enable=$1 2>&1 > /dev/null @@ -10,8 +8,13 @@ test_run() echo "[ JIT enabled:$1 hardened:$2 ]" dmesg -C - insmod $SRC_TREE/lib/test_bpf.ko 2> /dev/null - if [ $? -ne 0 ]; then + # 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 rmmod test_bpf 2> /dev/null