From patchwork Tue Sep 5 09:54:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 111642 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp2609483qge; Tue, 5 Sep 2017 02:54:56 -0700 (PDT) X-Received: by 10.99.114.76 with SMTP id c12mr3332200pgn.221.1504605296653; Tue, 05 Sep 2017 02:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504605296; cv=none; d=google.com; s=arc-20160816; b=VM8OBUPHZi6biTLcnHkYqu5gfJc4ZJn7y92bCOSet0B2nbYNXLfE7z72K8f5Kb19nN PYZoVCLMxCMMGnHpJDrm45cC+EaC7BVEQMn21sQmtcS/V2PXMF54Ku4S5XRY9gQgLXQP OPE4sL2JdhcGEb1pnsXRQIpsYSHmCPVF2mbHgOyMWZgHf/adbgMq1utiz2LHkayLA6Pq GzmSYaskNcUAFNP+QYBP1sluMej7GGhwDahlpUWhuR5mZ+1kZFM/tWMdAm+M6jMwSSHv 60VuMhmULI2YrtCtQVzyX6BTYX693l0Sx/EXYTuyzw8JrBv8fPhx8yidcqIvxEJVuXIO 5gxw== 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=1rQVBNzh7jyK8OIS1nAx/RUHLbvkpUm5gDODm+cuvZY=; b=oYcCGTQnecY7mSfsyubv4M8vv5QjG97+4tHwkiuxW/QVqe2JVUprQdbGCEYLmZdai/ FTeI/u9cBzULausg5Uzfl3tvogZ2xCuCsKSoObPerhBSel7evHfpd/YujSeUDFBMhfeN vLcIMe2Mvo6tOgNkO6PPYnHGlbdSjqnF2L+wmTDjgDRw2CnsugBsgQXadoBkt8jlG29i ctVNLFJvXqYbkVkXnW4YnA3ewWPWhzgL3bQmNgVGZsjbo+M0/kY0nuLYWvpO8Qh7Ia79 P0cNGMY6rGbn1FFvNBqrWIHdLQDvcOslq8puEqKIQY4hd8keXQj0vMxQlkIdqk2Bkb4f iASw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BIRcoESi; 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 v1si71305plb.573.2017.09.05.02.54.56; Tue, 05 Sep 2017 02:54:56 -0700 (PDT) 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=BIRcoESi; 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 S1751330AbdIEJyu (ORCPT + 26 others); Tue, 5 Sep 2017 05:54:50 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:35360 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750773AbdIEJys (ORCPT ); Tue, 5 Sep 2017 05:54:48 -0400 Received: by mail-pg0-f42.google.com with SMTP id 188so5028589pgb.2 for ; Tue, 05 Sep 2017 02:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=1rQVBNzh7jyK8OIS1nAx/RUHLbvkpUm5gDODm+cuvZY=; b=BIRcoESiU6vG+er7V/pxgS9k8xSj6E/hiviQoXppMmhvJK5RtLHPMduraIf43bj5l+ sGAwt6z1WTi51J8eNAJPorYqCdSgT3nQuQH4/aQ+T2RNDFkR18m6Cx1YdP1PNStY0VxM sDXPh3luHBPVqvPutZlLklezfg87bbLeXBuLc= 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=1rQVBNzh7jyK8OIS1nAx/RUHLbvkpUm5gDODm+cuvZY=; b=RwJomGJnB+2TYohnSVvAuwV5lqBJsSLMFh5rWGV3T0iLyM5SGAlIrVxw3BCBe9+QL8 H8WdE4h9DHX0fh8vjJFu0CAJTKzsDwYLrjzvfAhRFYpFGUmIoBF5jIjDfawxKoSs5TMR igKKx0ib+uPLj8OLbqjPIzxUMyvWPiAWSRMD532RfIvKsZwcdsctB6xi3SivhtnAJJej VqsXDR2vymuGLw1USfd/zaUxxNmL3QlK7do4klOsvyHHFerOrvsLGABXO4Fockxa9kcB +OBS/gg+N4cYBxtuBGDkzUcX1rZTm+02SYXtU19I4pCU2CBrZ3+VrvBqBSxVnUyJGrW4 6jsQ== X-Gm-Message-State: AHPjjUggatjvEx8TXlNgzNUr5KP3LSmdDV/EeBWlhycymrZkBkvBvz92 ZpVtYCK+XX++G7rB X-Google-Smtp-Source: ADKCNb7veulvCW88+XQOmAYLGJ5B8DhSUA0FQZVa/FoZD6tFOERd8EJ2o/Cegp8MkvixPRkfhC7rnA== X-Received: by 10.99.110.69 with SMTP id j66mr3493662pgc.323.1504605287672; Tue, 05 Sep 2017 02:54:47 -0700 (PDT) Received: from localhost.localdomain ([122.175.16.214]) by smtp.gmail.com with ESMTPSA id 69sm276558pfh.187.2017.09.05.02.54.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 02:54:47 -0700 (PDT) From: naresh.kamboju@linaro.org To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: fathi.boudra@linaro.org, linux-kernel@vger.kernel.org, milosz.wasilewski@linaro.org Subject: [PATCH 1/2] selftests: bpf: test_kmod.sh: check if module is present in the path before insert Date: Tue, 5 Sep 2017 15:24:40 +0530 Message-Id: <1504605281-30018-1-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Naresh Kamboju The test script works when kernel source and build module test_bpf.ko present on the machine. This patch will check if module is present in the path. Signed-off-by: Naresh Kamboju --- tools/testing/selftests/bpf/test_kmod.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.13.0 diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index 6d58cca8e235..a53eb1cb54ef 100755 --- a/tools/testing/selftests/bpf/test_kmod.sh +++ b/tools/testing/selftests/bpf/test_kmod.sh @@ -9,9 +9,11 @@ test_run() echo "[ JIT enabled:$1 hardened:$2 ]" dmesg -C - insmod $SRC_TREE/lib/test_bpf.ko 2> /dev/null - if [ $? -ne 0 ]; then - rc=1 + if [ -f $SRC_TREE/lib/test_bpf.ko ]; then + insmod $SRC_TREE/lib/test_bpf.ko 2> /dev/null + if [ $? -ne 0 ]; then + rc=1 + fi fi rmmod test_bpf 2> /dev/null dmesg | grep FAIL