From patchwork Thu Sep 7 08:19:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 111865 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp475841qge; Thu, 7 Sep 2017 01:19:17 -0700 (PDT) X-Received: by 10.98.163.153 with SMTP id q25mr1863957pfl.183.1504772357052; Thu, 07 Sep 2017 01:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504772357; cv=none; d=google.com; s=arc-20160816; b=uwzGqnvqxzyeEGrj9aBevVtlZRFWXKv8yrb6IEDJaAxAJ/sZDEvT2rcx8xnzlafjKE pIQ9T8H+djCmMPhNcZ+n3ZMTya03JBFxhlM0r7nSYb+A0qLAZWbLkjEHdgixXCt6jetb 6p9qJwaRweiMtreIzSg8ntEkE9T+IFTM1CoPDAY12kJD9VxZ6OmXH2g3Ck+CpdtI7Lmi UYeObnXUI/YmyfywEHC0rjqpLT9M5lSBnZD+mXOemrgKn9g02bfIyJ4qIWSAX4Uh1f2q byHA0/rZvTAFp3xuUgEuJA3tM9cFtH2CC/7O3oUjU6r0hMCFHMim0aoZH+2GWtjGb0B1 /8ww== 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=O7LcEQohiIvlpsMakXkBDm+bpNpdGSHwQCIbyrWTGM/NnDN5EbgsrE41rlGXkfeZRw imEivmo74kanx0wXKTHAUGTo4Y/A619gOvSaid3V2qs4AdWC98WZkBH01IRQeJKb1Y3w dPlkIm+uUpeOpZzVKGbSHsGZWRCOjkoWAvi5I2S2wOEiFIog76scHtCZP/qVDj+b7N2a UjlEMrR+M8c1S1YihcpCKAiUIfnVz4rZzPiIQBZmsU3HwwHoOZJY21RJYjNXN2HaJA+K nVDlmOroEiOzAG+v9LNQ9uRd2SujvCkW6raHkuLuG9hLZnvLQAMaVPDUOuQIaAuL0Z8Z D25A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CnTc+ZP8; 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 43si1587258plb.617.2017.09.07.01.19.16; Thu, 07 Sep 2017 01:19:17 -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=CnTc+ZP8; 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 S1754421AbdIGITM (ORCPT + 26 others); Thu, 7 Sep 2017 04:19:12 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:33519 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752778AbdIGITK (ORCPT ); Thu, 7 Sep 2017 04:19:10 -0400 Received: by mail-pf0-f170.google.com with SMTP id y68so16714816pfd.0 for ; Thu, 07 Sep 2017 01:19:10 -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=CnTc+ZP8Jduxh7num8OiQOQ7UkTdDybY5uJnHBll2hwyrPJR6PunuFo+UaMj22GXKs 3DcdQPSZZQEixACJC0xxhj0Trtx9Q6KHoZlGi9dpKP6y0MfdOH53jEnb59rp+SK0/stw MDMpYm66K/A9mq7ciG9dVPs2bJMNMMZ1FKbwA= 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=YgAv2yGHdDryWEp+YQN9mgnrShZcobD6tpxcysMlgqBy3Px973K/wnQi10GHibuxAm kGObVuLXCu6olHpohTu8PlpKJiVgd+2LK4AaOSjiHpkcW8RESWnz9DbToV2VdElI7Ydl 42HCf6kWuXK7pzrQfydKUyT/H/oXlyz5Ylu/hlKN2tMfnVRrTPAqbTv6N4pfnJ8HLWyT zkpS3UM6iOcAA+WEfMmu44czNdIVHye0p+NTXJ0N+UVR7Qhb6AMjssGDUYKxfxjCxWUL qqlWNJFxL/My5kfLp3eW92h9hV5DSjDYACpt/Gxx9o9V5V50LW3qUB4EGYKWlg6I5O/5 PPzg== X-Gm-Message-State: AHPjjUg4P9/KczOz/NakAZwSS2NgADB5C2FW5Aew0h19hdvCjrS8PoQA 0qpA3RfYX5YO+ppK X-Google-Smtp-Source: ADKCNb7sRQzb+1FzZw20I0USDU5V5uMVdkbCq5x54opbVAgDu7DimSyd6YHzpW3IEabXOOPuCN59sg== X-Received: by 10.99.186.15 with SMTP id k15mr1866893pgf.402.1504772350075; Thu, 07 Sep 2017 01:19:10 -0700 (PDT) Received: from localhost.localdomain ([122.175.18.215]) by smtp.gmail.com with ESMTPSA id i63sm2580522pge.12.2017.09.07.01.19.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Sep 2017 01:19:09 -0700 (PDT) From: naresh.kamboju@linaro.org To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org, daniel@iogearbox.net Cc: linux-kernel@vger.kernel.org, davem@davemloft.net Subject: [PATCH v2 1/2] selftests: bpf: test_kmod.sh: check if module is present in the path before insert Date: Thu, 7 Sep 2017 13:49:01 +0530 Message-Id: <1504772342-21878-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 Acked-by: Daniel Borkmann 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