From patchwork Thu May 21 00:58:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 11561967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C50C31391 for ; Thu, 21 May 2020 00:59:05 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADD0D20758 for ; Thu, 21 May 2020 00:59:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADD0D20758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E80A511F8CED5; Wed, 20 May 2020 17:55:37 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=vishal.l.verma@intel.com; receiver= Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5C31111F57C2F for ; Wed, 20 May 2020 17:55:35 -0700 (PDT) IronPort-SDR: 5ylKkWX00cuD/Yk14xe9bPvdjKVnKaVdm0DFKkuJJQIrNvpkRVIUSzXZHtFvbPh3RjI/LaamhS XuuRdQemTt3w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2020 17:59:02 -0700 IronPort-SDR: F4sLWZrTrwH79kwqJ9zWwpkllvpSCPofXCQhpkir5v+pNNDjWFkCstwj3uow9RYdZ6FFkbBi+v ohQWsz5J6V1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,416,1583222400"; d="scan'208";a="440250133" Received: from vverma7-mobl4.lm.intel.com ([10.251.149.210]) by orsmga005.jf.intel.com with ESMTP; 20 May 2020 17:59:01 -0700 From: Vishal Verma To: Cc: Dan Williams , Vishal Verma Subject: [ndctl PATCH 1/2] ndctl/test: Fix region selection in align.sh Date: Wed, 20 May 2020 18:58:47 -0600 Message-Id: <20200521005848.7272-1-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Message-ID-Hash: VCN5VV3TOZCMCOMN5URDU4M2ARRLGL7T X-Message-ID-Hash: VCN5VV3TOZCMCOMN5URDU4M2ARRLGL7T X-MailFrom: vishal.l.verma@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Fix the region filtering/selection for the align.sh test. The current jq filter falls over if two regions match the criteria because array elements got flattened to the top level. Cc: Dan Williams Signed-off-by: Vishal Verma --- test/align.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/align.sh b/test/align.sh index 0129255..81d1fbc 100755 --- a/test/align.sh +++ b/test/align.sh @@ -34,7 +34,7 @@ is_aligned() { set -e trap 'err $LINENO cleanup' ERR -region=$($NDCTL list -R -b ACPI.NFIT | jq -r '.[] | [select(.available_size == .size)] | .[0].dev') +region=$($NDCTL list -R -b ACPI.NFIT | jq -r '[.[] | select(.available_size == .size)][0] | .dev') if [ "x$region" = "xnull" ]; then unset $region