diff mbox

[ndctl] ndctl, test: fix sector-mode.sh to work with label support

Message ID 20180523173846.7923-1-vishal.l.verma@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Verma, Vishal L May 23, 2018, 5:38 p.m. UTC
The nfit_test.1 grew support for the label DSMs. Fix sector-mode.sh to
emulate labelless mode by zeroing the labels at the start, and supplying
--no-autolabel to create-namespace commands.

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 test/sector-mode.sh | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Dan Williams May 23, 2018, 5:41 p.m. UTC | #1
On Wed, May 23, 2018 at 10:38 AM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> The nfit_test.1 grew support for the label DSMs. Fix sector-mode.sh to
> emulate labelless mode by zeroing the labels at the start, and supplying
> --no-autolabel to create-namespace commands.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

Looks good to me:

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
diff mbox

Patch

diff --git a/test/sector-mode.sh b/test/sector-mode.sh
index ee364eb..54b16a5 100755
--- a/test/sector-mode.sh
+++ b/test/sector-mode.sh
@@ -32,11 +32,7 @@  $NDCTL zero-labels $BUS all
 $NDCTL enable-region $BUS all
 
 $NDCTL disable-region $BUS1 all
-if $NDCTL zero-labels $BUS1 all; then
-	echo "DIMMs on $BUS1 support labels, skip..."
-	$NDCTL enable-region $BUS1 all
-	false
-fi
+$NDCTL zero-labels $BUS1 all
 $NDCTL enable-region $BUS1 all
 
 rc=1
@@ -44,9 +40,9 @@  query=". | sort_by(.size) | reverse | .[0].dev"
 NAMESPACE=$($NDCTL list $BUS1 -N | jq -r "$query")
 REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r ".dev")
 echo 0 > /sys/bus/nd/devices/$REGION/read_only
-$NDCTL create-namespace -e $NAMESPACE -m sector -f -l 4K
-$NDCTL create-namespace -e $NAMESPACE -m dax -f -a 4K
-$NDCTL create-namespace -e $NAMESPACE -m sector -f -l 4K
+$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
+$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m dax -f -a 4K
+$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
 
 $NDCTL disable-region $BUS all
 $NDCTL disable-region $BUS1 all