diff mbox series

[ndctl,1/2] ndctl/test: Fix region selection in align.sh

Message ID 20200521005848.7272-1-vishal.l.verma@intel.com (mailing list archive)
State Accepted
Commit ef3aebda9cfcb1450986ee18d96e0947f7bc1ab1
Headers show
Series [ndctl,1/2] ndctl/test: Fix region selection in align.sh | expand

Commit Message

Verma, Vishal L May 21, 2020, 12:58 a.m. UTC
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 <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 test/align.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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