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 From patchwork Thu Sep 7 08:19:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 111866 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp475926qge; Thu, 7 Sep 2017 01:19:23 -0700 (PDT) X-Received: by 10.99.3.74 with SMTP id 71mr1842509pgd.401.1504772363185; Thu, 07 Sep 2017 01:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504772363; cv=none; d=google.com; s=arc-20160816; b=jSh3ZrAC8JDMahWjd0nOjM7L0JEiEoDWuxy1qMPZOCcR5F4DvCoZS50C5V62m94Ug9 hAMbWW9tm0hDmIrG1nnoIAK6ZHFtcwEe2ig9LOkgdnZEOgNpumz/anWhkVEmd3pAqrGM S2T0mz7FpN+sMoAup8YHdBUIiCK3txV5dWMOqihLXVmrIu5zXzlerSAxUi2j2uV7ui8W sZZF9EII0sQ3CsAqt9kGpKIFHZ7dfS3fAfZE+aAdF8fwkDBD1yeETIr1uCrAnp0ljL+i mZFKqh+yyaLCkgDmEkyq3gMMPadgRWfsBUKF+jCArACcNLOqki2XMBysGI86PXpP17Tv RFkw== 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=b5+OLp8ylfli132jo7SJofVU536YsR3/8FUSLMIOl+8=; b=DQ7on1DGCpr6FMD6RqjghD/FDDiGkdV1n6HElsFn1eQHRuUef80UGJ6TZJWZrVWohA k2/c3n/5DEQwhLwxjHRuKZ7JngIcFNW3iwwHzura8K1r4h218gGln8yEYkyIz83JBMXW CTA+LwEvxZJox8hyMzB4lY5qqcADxEt/MGgBDirbDEXYjVJWRu6JIUtL5XdS40LeNzmn CuXOLGh2FiBUXdqWEyuLC7lFrW1utMzpMznw2PM3yuHCtCxiklO7HGrEQbglM/L/CFyw L49tQwJ9meOSRulU5BmFVHSdlsHdwPMOBcfy8aHk4X8EZdKjhBm8Xv5O6M9WHKiOT2IX w9qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KjqkXAFG; 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.22; Thu, 07 Sep 2017 01:19:23 -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=KjqkXAFG; 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 S1754597AbdIGITT (ORCPT + 26 others); Thu, 7 Sep 2017 04:19:19 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:34404 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754477AbdIGITN (ORCPT ); Thu, 7 Sep 2017 04:19:13 -0400 Received: by mail-pg0-f53.google.com with SMTP id q68so3822254pgq.1 for ; Thu, 07 Sep 2017 01:19:13 -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=b5+OLp8ylfli132jo7SJofVU536YsR3/8FUSLMIOl+8=; b=KjqkXAFGmza9hY0H4Cf9VFk65w1QZj8zTvmNb0CxXoFCYEi10V0lp4Es4cDjhqkjgD LspL53J3EPzbiWr/pKSUykHoQmorYSs5Pn/L7Mx0R2uW7zkgG0aQ/pzKSjCun+acse1D SrwHoM9k5pIOf9k5HP9q7nQwNx7aDFi3Z/gNg= 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=b5+OLp8ylfli132jo7SJofVU536YsR3/8FUSLMIOl+8=; b=uDDcmEIiHjUL9ri5n+ZRBmkwTpAmANJ8RzpC7Xrk1crSl7hLevn948cl00+lwLNIMT rPLQAiobTHmqaGUfWYwycdjrsaAMh/Tuy1gKlfeAV1Ei5XqBGNDfsqRo/UghSVUvCtiB kkM1KoYxmEDvwp65P1///r11/wFW+qhl+InzIEsWS0oLOVLyiSccxVNy0OOyJ9mvkCvY oO9vGqSOoG9LrNBjTCRP5O3jHeyTrQq5vw83grwYWMaSL9zixTTFNeYNu4kghUN0UgAg oTQdmjGUPTPa1BkPbJKNamXP2JrFeH2P9iLEw0levrSFWoKUjIyf7inL/1xtEdc0y7t9 KTfQ== X-Gm-Message-State: AHPjjUhXcjVJxB3n0jtqY7r1aDGkGymkZUvvNOlt/0XMPvs3qoCqrVyS 9odz3LUf9NqDhY6wBW8rXw== X-Google-Smtp-Source: ADKCNb7EHrlUavcF/6hJbzBozrUU6EYOCQzIn/Xgs9p/0jUPTf4wFrmY8QodcwNDMSqYCX4eL/IfVQ== X-Received: by 10.99.125.25 with SMTP id y25mr1899146pgc.45.1504772352787; Thu, 07 Sep 2017 01:19:12 -0700 (PDT) Received: from localhost.localdomain ([122.175.18.215]) by smtp.gmail.com with ESMTPSA id i63sm2580522pge.12.2017.09.07.01.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Sep 2017 01:19:12 -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 2/2] selftests: bpf: test_kmod.sh: use modprobe on target device Date: Thu, 7 Sep 2017 13:49:02 +0530 Message-Id: <1504772342-21878-2-git-send-email-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504772342-21878-1-git-send-email-naresh.kamboju@linaro.org> References: <1504772342-21878-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 Acked-by: Daniel Borkmann diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index a53eb1cb54ef..eab9a970d742 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