From patchwork Tue Nov 7 16:35:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 118198 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4192293qgn; Tue, 7 Nov 2017 08:36:12 -0800 (PST) X-Google-Smtp-Source: ABhQp+SJjluoX++mxySCp0ZiTsPlauJgJDZVGbs6IxTmgLhptBRy9mbxDffGEtWnWDS8cUwwrcgf X-Received: by 10.98.34.130 with SMTP id p2mr21220444pfj.108.1510072572680; Tue, 07 Nov 2017 08:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510072572; cv=none; d=google.com; s=arc-20160816; b=vl7sfylU3KSdQ9ZdkhuBxTYWgP7kUDv/d2V6ikt0TNgTtFtg8j468fAvKb6+PvGQri tbZMFmtKCvEjCXuhsf8m600YwgXVYyLgMO9hA4iarGdsEjUxJxSmZhbVx569+iOoKAHf IHJ4E3fyStgGF7e0bTQXbhjJWIBP80yLcHpywZHLeIUZdaSPXDWr8DNBGnAnIDaQI9KZ lICRcT9+o4vot2tjY3E8i26Rd5dtf2NjevjHj7Qsk1n2yfedg+e9OoeRpVrWvu3oovaa QMqJG/wB0k90CSqpeAPOW5y1fE/MXttnDjZaf29c5XKE+Gw5yFniYzsOFDvEVzMMaGZy 6aXg== 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=E6kOHTvlMec3BSyxHbLk/wli254J9yTfYeIoa4UnntE=; b=A/8yutUhsX7ljMpUl1rarGZBGMh1ar7g5LYazN6lM/WCq8QqU3lPPbILKwfC2hwtEB sdREpNOlgPQdhCRtrv8V2vulacnEmNUMj3MS80MczY+bgeihOXbIGiKIwu41WHUwGM1L CFWrYhqZxB4zO/lWqGDxYP0X0ic3qXfeAv1NB1EZhMK9pbA0duJtykX9NpneIdp/Tu2H xc3R3k0VtGqQVp6o+nfU+K8qnVDucnYE0zzF4G/JBOSA16EibdfUjluc3F42fsI/kelY 0ypJfofcHjO28JLnQqKAHTPU7D1GlMr0ur54m6PnhUuRmxswlOA2Hw60lD6gKNSHHDsI LVEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VNDsJUuK; 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 q61si1565578plb.119.2017.11.07.08.36.12; Tue, 07 Nov 2017 08:36:12 -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=VNDsJUuK; 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 S1758164AbdKGQgK (ORCPT + 7 others); Tue, 7 Nov 2017 11:36:10 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:52085 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758143AbdKGQgH (ORCPT ); Tue, 7 Nov 2017 11:36:07 -0500 Received: by mail-pf0-f194.google.com with SMTP id n14so10700227pfh.8 for ; Tue, 07 Nov 2017 08:36:07 -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=E6kOHTvlMec3BSyxHbLk/wli254J9yTfYeIoa4UnntE=; b=VNDsJUuKhTMnvOHsewzbsfVE4OErjHb5BU15FVvHHaTm8vwtEzTs/44zsub7PSLPJp dQT2a4XRonSgRdfb5+v7cyO7JXsbCTAXIftIvVDNCJtymcEzG6qAtjIuWyqvPbTkHi4I iLKHrX88Lb8ui6uqNTtZGUGGn2hcLqYixupTA= 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=E6kOHTvlMec3BSyxHbLk/wli254J9yTfYeIoa4UnntE=; b=qTAwBLEkNRYVxxhSiypH9aE9mIcYRWzOzbie7YehUYhR4ecdvGYCxIdt9FxeR+DtLa YZ1QhPlwQ5UAvKO3Nmvyk681x+1IqU1GzmbA6ahNnvIweVqMX1ZV0Fj9lDkcTmoItRst Hhyk8pa5fXJEurUy/PHonYDaC4eY5zcbgW930rpc6iMzkZyM2YJNv4tFAkAhU+f9DIIm emVW4FANuq+nyo5Cmt1GE7NCDPYeDEpYcn15wWPD/q6xphOpnM3YZCJMs/nH2enm6VF+ LQv2YUZzu39EvSB8ugWkzvNlnYL8SJnhH30HAMpl0FsXH8afqSbTgyqk7xAv9HK/P1U6 rjsw== X-Gm-Message-State: AMCzsaXVXN5ekat6gZywwRdRaa8u9UbaLAx29guhjYuJ6TjgUFWDRBLy j0K7tTyay6I5psp+2u9y8134fA== X-Received: by 10.98.64.6 with SMTP id n6mr21145530pfa.129.1510072567011; Tue, 07 Nov 2017 08:36:07 -0800 (PST) Received: from localhost.localdomain ([122.175.18.187]) by smtp.gmail.com with ESMTPSA id u76sm4201843pfk.181.2017.11.07.08.36.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 08:36:05 -0800 (PST) From: naresh.kamboju@linaro.org To: shuahkh@osg.samsung.com, shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: daniel@iogearbox.net, alexei.starovoitov@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] selftests: bpf: test_kmod.sh: check the module path before insmod Date: Tue, 7 Nov 2017 22:05:52 +0530 Message-Id: <1510072553-7753-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 From: Naresh Kamboju test_kmod.sh reported false failure when module not present. Instead check test_bpf.ko is present in the path before loading it. Signed-off-by: Naresh Kamboju --- tools/testing/selftests/bpf/test_kmod.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.14.2 diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index 6d58cca8e235..2e5a1049e2f2 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