From patchwork Tue Aug 9 17:11:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 12939790 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DCF7C19F2D for ; Tue, 9 Aug 2022 17:14:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245231AbiHIROP (ORCPT ); Tue, 9 Aug 2022 13:14:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245266AbiHIROO (ORCPT ); Tue, 9 Aug 2022 13:14:14 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A1724F18; Tue, 9 Aug 2022 10:14:13 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E7AF432007E8; Tue, 9 Aug 2022 13:14:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 09 Aug 2022 13:14:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1660065251; x=1660151651; bh=J4 gpiV71j0xKQ3FtJFMd2wIZaka/D1TIWpUk5i2bNWw=; b=jESG/Hpr8Q121hxrB7 3p8jpraFEzmRUnx2scQOkcwk3Hp0JYaxPri4/XMj87PA6yEk8ULRV0T4uOVy7/NP SZNPo4+ah1TQDk9k1+P3OFfi0GDbWYzZmghufnz/LSQQERvNY79QAoOUR+4N3xqJ 5NXDgbyID59kBDlTQqi4uK2zoRtdiwQaFDQ8k0tjyxejjBYGCj0Q07K8hytZpl6Q tAiOtO9T44q0KCyFK5jygSzMhVHeDz7CEhEhxW8pv9LcK4uVtpkSHl6KfY8m0J0j ixKlPKP3nWYQd7Va7i+MJRpCALwnE2dODHbkH5B8dRTolYV5Rtqt0+zHC4Kf6WWO qaEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1660065251; x=1660151651; bh=J4gpiV71j0xKQ 3FtJFMd2wIZaka/D1TIWpUk5i2bNWw=; b=FThzYY0uIS5SIPv8vCNy7LkRFdpGH ASVbigxf79HR/4oAFlHi69N9DNwRbDJCddqG+vhslB5l14f5jxiuNNeZMnZt/87n yb2iLjdKgG+ThhIQGj/ni7ZQbb99QvKHqSKxGrzvilyj7echnAFQQ0xP4LDMl9zS pXdraZbyBPAiwNM4fIx5hXEw8Zv8vFJkqBirUEXeEcPONp8Cen7OommedeAFqAnk E4iTZ+tsxov0uNnwQX3n3NSgm3qthsSbapFxQ9FtRAXgDJGTDa+w8UHG/DCi1MHz O4QclSCbQq+T1Opdg5hXrVYaLmVE/29fIgJdJAzWZGjZ/6bZbiF1DqVdg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdegtddgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcu oegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefgfefggeejhfduie ekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Aug 2022 13:14:09 -0400 (EDT) From: Daniel Xu To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kpsingh@kernel.org Cc: Daniel Xu , linux-kernel@vger.kernel.org Subject: [PATCH bpf-next 2/2] selftests/bpf: Fix vmtest.sh getopts optstring Date: Tue, 9 Aug 2022 11:11:10 -0600 Message-Id: <0f93b56198328b6b4da7b4cf4662d05c3edb5fd2.1660064925.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.37.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Before, you could see the following errors: ``` $ ./vmtest.sh -j ./vmtest.sh: option requires an argument -- j ./vmtest.sh: line 357: OPTARG: unbound variable $ ./vmtest.sh -z ./vmtest.sh: illegal option -- z ./vmtest.sh: line 357: OPTARG: unbound variable ``` Fix by adding ':' as first character of optstring. Reason is that getopts requires ':' as the first character for OPTARG to be set in the `?` and `:` error cases. Signed-off-by: Daniel Xu Acked-by: Daniel Müller --- tools/testing/selftests/bpf/vmtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/vmtest.sh b/tools/testing/selftests/bpf/vmtest.sh index 976ef7585b33..a29aa05ebb3e 100755 --- a/tools/testing/selftests/bpf/vmtest.sh +++ b/tools/testing/selftests/bpf/vmtest.sh @@ -333,7 +333,7 @@ main() local exit_command="poweroff -f" local debug_shell="no" - while getopts 'hskid:j:' opt; do + while getopts ':hskid:j:' opt; do case ${opt} in i) update_image="yes"