Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp772599ybc; Sat, 16 Nov 2019 08:25:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwgdOePoqAY9AxAIgIRsQaJxe3GIRXhNziwGPjf7+dtdlZK8tUkBcO7BAH59CXTk02J4E30 X-Received: by 2002:a17:906:57c3:: with SMTP id u3mr5312920ejr.254.1573921531903; Sat, 16 Nov 2019 08:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921531; cv=none; d=google.com; s=arc-20160816; b=wbchkXaFfFMBABeVfegRJ7v/Gvr1c3sdfGJFnq9KjtdDNMPwzG026wBSPJtoJkG3Nr +mryVY4a7XBWvyH2SQWh2IhhatWe2tY0iREZ0LVnbpDA+I8jQF6vmSFYrCYjuBDahpji qoMgjCDM+S77nj1TIrvnouBIF87pQzVZTMOedLY4eyBA/JfYGmcb0xbO5u7XxgdjIFYk T1W/1NrAJls5Qd3nkSCvEJ5vv8Ca2nxDT07o8p4RPP0wkcFlJoi5XqTMNDWI9ceJzmk7 egNQMNtmIKxe2yCdMmhI4aBIwm/+ZOBnM1pBLHpZohByNvtA1CdWncjA6OIZ6LFbiOhD hyrQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PRQzhwKdhaPkMDENBRMy3bZjVnTOUFQQcM1miC2UeMY=; b=vxPjHIQMFWHPsxaaFz+UDQWSMQFrtkYH7UTkXa/cnP2ICLxtGkWtZoQx6XBHrxvRT3 Jut5wM8DFksP9DchjwX47+jX9NXLCYXIyArhWtZweFO8KesSDp7haJ+tx3BR86RMgSVs Px4TiO6xMLEiJAH8QNPbbK1yUodu/ZCdBCY0xUV6CXQp8qJAuLwqjVdmdlMSYtu/f4UV VnNkS0RfmwZuDWdlgtSnGaJvtsY5qD5XaoidM3oCJ+8WnOTEcWDtfpkorJGXw0gOXXhU 55YT+BGEAJR6Bk5dRwKHto1XS0CT6fYKITMD+/EcaqLTntfb/eZeebCa0eGziGqVLOfY /IHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DBsb5JGL; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si8779442ejb.357.2019.11.16.08.25.07; Sat, 16 Nov 2019 08:25:31 -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=DBsb5JGL; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731838AbfKPQWm (ORCPT + 99 others); Sat, 16 Nov 2019 11:22:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:47088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728614AbfKPPnM (ORCPT ); Sat, 16 Nov 2019 10:43:12 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C92C52072D; Sat, 16 Nov 2019 15:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918992; bh=XR5WvofJzj0e2g0fbgE8Wpx6sS5fNscbX+8F20oWjZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DBsb5JGL9l6T+mNo9dPTIdP0v56UCCxHCRSwg2U+XtzSbSV4vYs9AL3BQkporfnXB 9G0CX3/graOZk6G8NEuntMxU2oVcXjk5JC6+LYneGwKXBZh7YEiUGoIDdcfcUTctJ2 JSk75SJQc8d69aQpRIMRwq2cQK0RUWQ303D6bFUM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Quentin Monnet , Jakub Kicinski , Alexei Starovoitov , Sasha Levin , linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 096/237] selftests/bpf: fix return value comparison for tests in test_libbpf.sh Date: Sat, 16 Nov 2019 10:38:51 -0500 Message-Id: <20191116154113.7417-96-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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