Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1817095ybl; Thu, 15 Aug 2019 01:35:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWbhfgGtFhH0C3B9C6qtGXg8thXpT4j+q7q2kxwwrWh7qnZpduS3Cwgh6K5a54iF4TdxD0 X-Received: by 2002:a17:902:40e:: with SMTP id 14mr3419069ple.323.1565858112587; Thu, 15 Aug 2019 01:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565858112; cv=none; d=google.com; s=arc-20160816; b=BqgndiC9Rb2HaQHStbiN/VbC6C4hRyNp++YycFJrfgyM4MfScvY6VREAkj8BDdeg74 MuSB4E1vYdYyCVke2gFCmoVrTle7vrMFhTerLFKwIzulR6HOXuma0JvhkF9mZ4LUkQOc So4CTxa5v+KtTkzmGeGlioi36gU9Q28WGRUY7MSRcObDTv4ELc6Qd1oWGusnyuw0Cpyh /jtlU8a5Gykydzw7KHkojVV1J15htaWyVkt1Q5GNMzIpK8v26daKbjtf8rseKA5ch8WA gkCu5F382MuP+T7YaYd1kWwKBFn+Wyib0QsZQlf+RSCD/MGp8DRuhv20pNC3KTcdHX/t J9Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CnRbLL/LwcVbEhMPr3jh4hj3/IFBTWKQ7hQtkYbtm+Q=; b=tXJ+aHS5owa2h2hWtVc8ySJtFMC8t+zkduietSRh7P9BFUpQihwOKr7o53X/QhjiDN VlBPxLBsctX6XJ4LkFH2NHtDs3w2BKsdNHBnMxYph+YReDrQ/02nSAUFEn/7fJJpqPME toDWD+1qkY1l30UsDip5mc2AwQqE5KS7cxHeY/8WYiYLWuT5xVEX9YNkS0lJ7kOtbkYN L7TX847fkgq2bkod5tqg19MTJ4uF55z62pq4kayuj2fD34rqAjojlRHOFLqkZwvlKFHa MLMWL89YAytRbyYXcM37wLY1AwiHVWo1gNwJYhX2dp3L8ua0bpqzX955nDbiwj5otfFW 7Row== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pqEb3j5B; 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 w4si1590743plq.1.2019.08.15.01.34.57; Thu, 15 Aug 2019 01:35:12 -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=pqEb3j5B; 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 S1730703AbfHOH6L (ORCPT + 99 others); Thu, 15 Aug 2019 03:58:11 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:40737 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730382AbfHOH6L (ORCPT ); Thu, 15 Aug 2019 03:58:11 -0400 Received: by mail-lf1-f67.google.com with SMTP id b17so1084591lff.7 for ; Thu, 15 Aug 2019 00:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CnRbLL/LwcVbEhMPr3jh4hj3/IFBTWKQ7hQtkYbtm+Q=; b=pqEb3j5BXKs3Sa7gN2Wbkf6RpXszqoFScxLyvNGkR11jYA9kGdfZXG+HlUdgQKNnWG q5ejtmml9Bar7HZ2m4nlqH/1j8wQ56NxmQLyYuXCAUx+UoO5Pkij4DM0QKdXYuuplshD ddaVz0LpMwJg+x8PZh3wxZ2SgP9x3kWZbv/QjJFUFf08rAMip5CtECO0QYH8bRlUTloR t8QHj4YJHhwVt+wD9d2aERGbsMu4xYYoVYwToRTLf6vK5O/U3t4bPcBqR7O2Fkdq7paQ 2GaFJ7ild8BjYuMdvsgqBS2/XEVm/9RyIOnye/VsSMrcyaUXjJprtVKSnNiRofmPmMm+ jDDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CnRbLL/LwcVbEhMPr3jh4hj3/IFBTWKQ7hQtkYbtm+Q=; b=W/7K8CENuli2TQpyq0odYJiMxzdiMzTB7c68y6kuNvLgkxM8PXZHQQ8wer9hJo5Zpx 6DwbDDvJ8t+T5+oQnJ073haXXsSM5WSBNUq4oJjivlOalapVQzHph3G/s4xbO1r+9sCO kp8RHetVQz1u/L9JXaVFakkEy/jGhWQnhE0SB7nD2ooAr1zP55JQ5yYGSJAvbhutHYZg zt4inNYdYVtM4ICuqs/GPmXkY7Yyd9MulTNKcILn0UGHpM654ykWohpR9of2X2D0Qg0B 4Ck11IBEfno9RiPYB2W4ISyy3MJHePZDVVD+LbrzPUKRk2ezn9B7FV2evUUUZ5FLqJAC 7RSg== X-Gm-Message-State: APjAAAXMnabVJ60jX+VxqUK4zYFMywA51E9htyC+m+FVNVleyop9imEw nc3to22UMzeXwNfKrDCSmqlm5zhPLA5E2wQkwwAHBg== X-Received: by 2002:a19:4c57:: with SMTP id z84mr1736285lfa.87.1565855889359; Thu, 15 Aug 2019 00:58:09 -0700 (PDT) MIME-Version: 1.0 References: <20190814214948.5571-1-anders.roxell@linaro.org> In-Reply-To: From: Anders Roxell Date: Thu, 15 Aug 2019 09:57:58 +0200 Message-ID: Subject: Re: [PATCH] selftests: net: tcp_fastopen_backup_key.sh: fix shellcheck issue To: Tim.Bird@sony.com Cc: David Miller , Shuah Khan , Networking , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Aug 2019 at 01:35, wrote: > > > > > -----Original Message----- > > From: Anders Roxell > > > > When running tcp_fastopen_backup_key.sh the following issue was seen in > > a busybox environment. > > ./tcp_fastopen_backup_key.sh: line 33: [: -ne: unary operator expected > > > > Shellcheck showed the following issue. > > $ shellcheck tools/testing/selftests/net/tcp_fastopen_backup_key.sh > > > > In tools/testing/selftests/net/tcp_fastopen_backup_key.sh line 33: > > if [ $val -ne 0 ]; then > > ^-- SC2086: Double quote to prevent globbing and word splitting. > > > > Rework to add double quotes around the variable 'val' that shellcheck > > recommends. > > > > Signed-off-by: Anders Roxell > > --- > > tools/testing/selftests/net/tcp_fastopen_backup_key.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/testing/selftests/net/tcp_fastopen_backup_key.sh > > b/tools/testing/selftests/net/tcp_fastopen_backup_key.sh > > index 41476399e184..ba5ec3eb314e 100755 > > --- a/tools/testing/selftests/net/tcp_fastopen_backup_key.sh > > +++ b/tools/testing/selftests/net/tcp_fastopen_backup_key.sh > > @@ -30,7 +30,7 @@ do_test() { > > ip netns exec "${NETNS}" ./tcp_fastopen_backup_key "$1" > > val=$(ip netns exec "${NETNS}" nstat -az | \ > > grep TcpExtTCPFastOpenPassiveFail | awk '{print $2}') > > - if [ $val -ne 0 ]; then > > + if [ "$val" -ne 0 ]; then > > Did you test this in the failing environment? I thought I did that but the environment wasn't exactly the same. =/ > > With a busybox shell, I get: > $ [ "" -ne 0 ] > sh: bad number > > You might need to explicitly check for empty string here, or switch to a string comparison instead: > if [ "$val" != 0 ]; then I'll do that instead. Sending out a v2 shortly. Cheers, Anders > > -- Tim > > > echo "FAIL: TcpExtTCPFastOpenPassiveFail non-zero" > > return 1 > > fi > > -- > > 2.20.1 >