anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

Blame SOURCES/0074-ndctl-test-Move-sector-mode-to-a-different-region.patch

e0018b
From b787320498508192f1e04ac38d39da4eb3ca26e9 Mon Sep 17 00:00:00 2001
e0018b
From: Dan Williams <dan.j.williams@intel.com>
e0018b
Date: Wed, 5 Jan 2022 13:32:10 -0800
e0018b
Subject: [PATCH 074/217] ndctl/test: Move sector-mode to a different region
e0018b
e0018b
Previously the largest region on the nfit_test.1 bus belonged to a BLK-mode
e0018b
region. With the removal of BLK-mode support update the test to instead
e0018b
find a suitable PMEM region to perform the checkout.
e0018b
e0018b
Link: https://lore.kernel.org/r/164141833068.3990253.15694496866707006837.stgit@dwillia2-desk3.amr.corp.intel.com
e0018b
Tested-by: Alison Schofield <alison.schofield@intel.com>
e0018b
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
e0018b
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
e0018b
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
e0018b
---
e0018b
 test/sector-mode.sh | 8 ++++----
e0018b
 1 file changed, 4 insertions(+), 4 deletions(-)
e0018b
e0018b
diff --git a/test/sector-mode.sh b/test/sector-mode.sh
e0018b
index 439ef33..f70b0f1 100755
e0018b
--- a/test/sector-mode.sh
e0018b
+++ b/test/sector-mode.sh
e0018b
@@ -19,11 +19,11 @@ reset
e0018b
 reset1
e0018b
 
e0018b
 rc=1
e0018b
-query=". | sort_by(.size) | reverse | .[0].dev"
e0018b
-NAMESPACE=$($NDCTL list -b $NFIT_TEST_BUS1 -N | jq -r "$query")
e0018b
-REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r "(.[]) | .dev")
e0018b
+query=". | sort_by(.available_size) | reverse | .[0].dev"
e0018b
+REGION=$($NDCTL list -R -b $NFIT_TEST_BUS1 | jq -r "$query")
e0018b
 echo 0 > /sys/bus/nd/devices/$REGION/read_only
e0018b
-$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
e0018b
+echo $ALIGN_SIZE > /sys/bus/nd/devices/$REGION/align
e0018b
+NAMESPACE=$($NDCTL create-namespace --no-autolabel -r $REGION -m sector -f -l 4K | jq -r ".dev")
e0018b
 $NDCTL create-namespace --no-autolabel -e $NAMESPACE -m dax -f -a $ALIGN_SIZE
e0018b
 $NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
e0018b
 
e0018b
-- 
e0018b
2.27.0
e0018b