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: 835369 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="VNDsJUuK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWZn84Bfxz9rvt for ; Wed, 8 Nov 2017 03:36:12 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758164AbdKGQgK (ORCPT ); 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-Google-Smtp-Source: ABhQp+TtBc7NOPkYMFQ3QD5/Et6JR371Y/Z7SnsU/dETW8SGCUNVdoMiH5OllH6YYNGFh/TdzI+w6g== 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(-) 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