Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6018051ybc; Wed, 27 Nov 2019 13:29:53 -0800 (PST) X-Google-Smtp-Source: APXvYqy1yzaH5B1iEPfpbK3Ls3S62fBZfQaq0mgCBfrIAZQ4NAk7eF1exAAlIcoltWE+k5v4+2si X-Received: by 2002:a17:906:70d4:: with SMTP id g20mr741323ejk.319.1574890193605; Wed, 27 Nov 2019 13:29:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890193; cv=none; d=google.com; s=arc-20160816; b=o0vQFweDxdGlERxKocKlJnIEQVSSIdu5NoNLg2veOadCurzzp3q4Qw/f9vAsAxLK/m huNDNGUCFxsOxeuUqD7jHwAZORMxZABU0KZzDvDv7bMK6WwP+hQHA7NVcPh++4nsc5T5 ayY0SAgaoaNTbQZ/yIwuWf7G8zKSezGvGLdEGp19ADsl38q27fPdgkD0WFGWhh0ZLfmC LXwB5qiB+TGhAOM1Dz7CctgyAqfXJVD39Ugq68RWAjjs7LzkRRs3BcwEvzMPipLDUYKq Wuo4k8foNzgaHmwjKoqnCQyBNKSd4iz33SDRL55dyfylJ+wo5YmGAtJX60/W92DRb4ot eefg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PRQzhwKdhaPkMDENBRMy3bZjVnTOUFQQcM1miC2UeMY=; b=0ScdejWWrCh9BDOVXvnirCqrG6LiOPQMFNwNyNvSXgzInqbOkYjkHcd8pnhuncx9Ft zxL2SM6ZCkKJPpjFkrBghGA4ObkYEcaGnZF00gvIJmJicSkkS2RALoiZcPeuBISlz4Ab ak3lVIpHtWW5wR2eSZPSb4pxIBYhbRY8OASpKspKwjPiJljcjnPzy1q4VqbbYyPN/iYZ M8r42M7s0A+lwTro+R2k0grN2gz0z4qqKLLhHatFWz6KrUFszYWES94OCsf9dnOkGSqX b4BtzrnZad8+IgIjARcQ/LOPcFWdTK1cM5CjpJmqUqHyAU0wQox6LSiR3wLU/n/Qo2v+ UZwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Pw+nP5LS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 27si12439837eji.207.2019.11.27.13.29.30; Wed, 27 Nov 2019 13:29:53 -0800 (PST) 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=@kernel.org header.s=default header.b=Pw+nP5LS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731473AbfK0U7v (ORCPT + 99 others); Wed, 27 Nov 2019 15:59:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:51400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731463AbfK0U7r (ORCPT ); Wed, 27 Nov 2019 15:59:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6ECDE20678; Wed, 27 Nov 2019 20:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888386; bh=XR5WvofJzj0e2g0fbgE8Wpx6sS5fNscbX+8F20oWjZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pw+nP5LSek+5ZJs5aMQRfnTtzGypL5ZrXbiQwkJbGa/nduK22pwZLAlgCDddhcbM3 8lRLsbGeLJ5pPbPFxlBS7nY658/Rd833yW1P/xYbJXQtpgoyXDi53SoccDsHGDR2FR HYnfJ4cgyOm33XcDqXr1xp45kVQVgyhp2lkgjikE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quentin Monnet , Jakub Kicinski , Alexei Starovoitov , Sasha Levin Subject: [PATCH 4.19 115/306] selftests/bpf: fix return value comparison for tests in test_libbpf.sh Date: Wed, 27 Nov 2019 21:29:25 +0100 Message-Id: <20191127203123.587919103@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quentin Monnet [ Upstream commit c5fa5d602221362f8341ecd9e32d83194abf5bd9 ] The return value for each test in test_libbpf.sh is compared with if (( $? == 0 )) ; then ... This works well with bash, but not with dash, that /bin/sh is aliased to on some systems (such as Ubuntu). Let's replace this comparison by something that works on both shells. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_libbpf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_libbpf.sh b/tools/testing/selftests/bpf/test_libbpf.sh index 8b1bc96d8e0cc..2989b2e2d856d 100755 --- a/tools/testing/selftests/bpf/test_libbpf.sh +++ b/tools/testing/selftests/bpf/test_libbpf.sh @@ -6,7 +6,7 @@ export TESTNAME=test_libbpf # Determine selftest success via shell exit code exit_handler() { - if (( $? == 0 )); then + if [ $? -eq 0 ]; then echo "selftests: $TESTNAME [PASS]"; else echo "$TESTNAME: failed at file $LAST_LOADED" 1>&2 -- 2.20.1