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 From patchwork Tue Sep 5 09:54:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 111643 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp2609600qge; Tue, 5 Sep 2017 02:55:03 -0700 (PDT) X-Received: by 10.84.233.10 with SMTP id j10mr3758612plk.134.1504605303519; Tue, 05 Sep 2017 02:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504605303; cv=none; d=google.com; s=arc-20160816; b=cf0LSq1+ixQWqmHz6dTaR8ExuJX20Y0aPs1BtpfHZK1M3U8bZ7PbnVTY+0T/wFbdYO 9FymToJHxBGbdqEcgCGArByOXwFCT9sjcVAokqNOz7XkHrcFCzq3lh4YbXloET1uJ1sL 8UEq7US2obb+xfMGxkT6khYbGfvLQqm0hoN+r5987J/Swn4c+3NUUWj3Tlme7+BNDkQ+ wPL7ab+tYD7PoemV5vVrlWZAyH5n3kSdSr+wOJuzix3mZ08mLqYpwDi+7uvh0uE8jNWg VY0kYmuAJiEYGocP8sSQOvO515dyfYPczSnl9orOIc9eGCYvaenJe3K1yGKPI/bQ7aCv 1jtA== 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=sWcSfEG3Qt0lVgPa7kLYmnV2sGOfr9heC/FVusXFQw4=; b=ALX+GQNYi9Fl7t+x7JREOFieA1oDS6DO4IPbIxFlumaQie2tLwYRISnKpPNnnLeY7Z mQAaF7eiOkiG2T9utZaXNvlmzzDqs2OkGlZ3CzSZdNI13ipY0pAVJDMO/PsH5JJz6g3Y S5tbNfuVe1rn9bjBP5oQcYXsaPtPLyfMsnZhXQvb2KSX2q4tlTlQYDAruE5Cb12BPdfj C2JvTCreq9Mw/IpW8+v8GCQBYvLuFUtwH36FYCAkDUGGTN6QPR7efipp2kDsPhqk+LMN ozwMGmQVFa0k+tp7mvXa8DGCvR5ndbhY4ZvC/swv+8wLyxvr8qIjXYcS2EhkBE9vRtRj LmLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRaEKJah; 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 f1si64158plo.757.2017.09.05.02.55.03; Tue, 05 Sep 2017 02:55:03 -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=HRaEKJah; 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 S1751456AbdIEJy5 (ORCPT + 26 others); Tue, 5 Sep 2017 05:54:57 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:35369 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbdIEJyu (ORCPT ); Tue, 5 Sep 2017 05:54:50 -0400 Received: by mail-pg0-f48.google.com with SMTP id 188so5028837pgb.2 for ; Tue, 05 Sep 2017 02:54:50 -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:in-reply-to:references; bh=sWcSfEG3Qt0lVgPa7kLYmnV2sGOfr9heC/FVusXFQw4=; b=HRaEKJahj9ZTgxeULjLnNEGu4rlje9cuN0/gEa0KDpYGacSJRwQ88Uj8KU3vYtv+42 3iGzpiSP165fLv16PeCfarG+zUtvb9NqvAmNhCBFTy+hZO9aqiAMyBfSw0DaZgEJmZ+1 opVILoy1HWY9JvocGmXnkZwHalNoA6HAT+OEQ= 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=sWcSfEG3Qt0lVgPa7kLYmnV2sGOfr9heC/FVusXFQw4=; b=h3L0Q8bDgeDrgZyIuLBtwzNR3rBPh/xRkKGBxi1Fehd87xddc4JB9jbFJS9FQvVlvx OrmZilyATiZrqIghFJxPbaGO5027ZPQSJ3iEOctEdqO6ae0GomC0wWjEjtesiPtsEkOz Xmcb48MYrQZNJ/JK2uedC5sXv5QGMjTTpugKW8qjnzbUMCTrd1rPLFPBfeWYTyBgFaMJ SPGXr8vNRjG+do+b9s6JQe4Gpny/wERah+RcvdTVX+p9B3ZdHclD/IwhKb+yukxlYSFB QhQOkoKYZRA6Xc+xaIVHi9brASIvi2FvXGtPfreM349l66ZR1jhj8i1iDzIKorio0gIT qrkg== X-Gm-Message-State: AHPjjUjZ+Z7roFRaYnVDv2AWZFYBtkSe98L02oSepOFQ8tPq6fhurM5Y aQCiMRvMiXh794fo X-Google-Smtp-Source: ADKCNb7KLd5SrtBaOfxeeklqWm0gwrESdUiuN1vIyzynScLun9Cm+piAn1TVUKz6ZUV5JDD0QccTXA== X-Received: by 10.98.21.150 with SMTP id 144mr3197245pfv.188.1504605290178; Tue, 05 Sep 2017 02:54:50 -0700 (PDT) Received: from localhost.localdomain ([122.175.16.214]) by smtp.gmail.com with ESMTPSA id 69sm276558pfh.187.2017.09.05.02.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 02:54:49 -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 2/2] selftests: bpf: test_kmod.sh: use modprobe on target device Date: Tue, 5 Sep 2017 15:24:41 +0530 Message-Id: <1504605281-30018-2-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504605281-30018-1-git-send-email-naresh.kamboju@linaro.org> References: <1504605281-30018-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.13.0 diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index a53eb1cb54ef..4a827b4c4b60 100755 --- a/tools/testing/selftests/bpf/test_kmod.sh +++ b/tools/testing/selftests/bpf/test_kmod.sh @@ -13,6 +13,16 @@ test_run() insmod $SRC_TREE/lib/test_bpf.ko 2> /dev/null if [ $? -ne 0 ]; then rc=1 + elif + # Use modprobe dry run to check for missing test_bpf module + if ! /sbin/modprobe -q -n test_bpf; then + echo "test_bpf: [SKIP]" + fi + if /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