Re: [PATCH 2/2] nfit, test: cleanup test scripts

2018-06-19 Thread Masayoshi Mizuma


On 06/19/2018 12:36 AM, Verma, Vishal L wrote:
> On Thu, 2018-06-14 at 15:43 -0400, Masayoshi Mizuma wrote:
>> From: Masayoshi Mizuma 
>>
>> Cleanup some test scripts by using helper functions.
>>
>> Signed-off-by: Masayoshi Mizuma 
>> ---
>>  test/blk-exhaust.sh   | 21 ++--
>>  test/btt-check.sh | 52 ++-
>>  test/btt-errors.sh|  7 +++---
>>  test/btt-pad-compat.sh| 36 ---
>>  test/clear.sh | 25 +++
>>  test/create.sh| 26 +---
>>  test/daxdev-errors.sh | 29 --
>>  test/firmware-update.sh   | 25 +--
>>  test/inject-error.sh  | 24 --
>>  test/label-compat.sh  | 17 +
>>  test/multi-dax.sh | 23 ++---
>>  test/pmem-errors.sh   | 19 +-
>>  test/rescan-partitions.sh | 22 -
>>  test/sector-mode.sh   | 22 ++---
>>  14 files changed, 135 insertions(+), 213 deletions(-)
>>
>>
> [..]
> 
>> diff --git a/test/sector-mode.sh b/test/sector-mode.sh
>> index d507788..3576b70 100755
>> --- a/test/sector-mode.sh
>> +++ b/test/sector-mode.sh
>> @@ -11,10 +11,6 @@
>>  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>>  # General Public License for more details.
>>  
>> -NDCTL="../ndctl/ndctl"
>> -BUS="-b nfit_test.0"
>> -BUS1="-b nfit_test.1"
>> -TEST=$0
>>  rc=77
>>  
>>  . ./common
>> @@ -24,25 +20,23 @@ trap 'err $LINENO' ERR
>>  
>>  # setup (reset nfit_test dimms)
>>  modprobe nfit_test
>> -$NDCTL disable-region $BUS all
>> -$NDCTL zero-labels $BUS all
>> -$NDCTL enable-region $BUS all
>> +$NDCTL disable-region $NFIT_TEST_BUS0 all
>> +$NDCTL zero-labels $NFIT_TEST_BUS0 all
>> +$NDCTL enable-region $NFIT_TEST_BUS0 all
>>  
>> -$NDCTL disable-region $BUS1 all
>> -$NDCTL zero-labels $BUS1 all
>> -$NDCTL enable-region $BUS1 all
>> +$NDCTL disable-region $NFIT_TEST_BUS1 all
>> +$NDCTL zero-labels $NFIT_TEST_BUS1 all
>> +$NDCTL enable-region $NFIT_TEST_BUS1 all
> 
> In all six instances above, missing the '-b' before $NFIT_TEST_BUS*

Thank you for picking it up!

> 
>>  
>>  rc=1
>>  query=". | sort_by(.size) | reverse | .[0].dev"
>> -NAMESPACE=$($NDCTL list $BUS1 -N | jq -r "$query")
>> +NAMESPACE=$($NDCTL list $NFIT_TEST_BUS1 -N | jq -r "$query")
> 
> Also here..

Thanks! I'll fix the patch.

- Masa

> 
>>  REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r ".dev")
>>  echo 0 > /sys/bus/nd/devices/$REGION/read_only
>>  $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
>> -modprobe -r nfit_test
>> +_cleanup
>>  
>>  exit 0
> 
> Other than these, the patches look good. Thanks for these cleanups!
> 
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [PATCH 2/2] nfit, test: cleanup test scripts

2018-06-18 Thread Verma, Vishal L
On Thu, 2018-06-14 at 15:43 -0400, Masayoshi Mizuma wrote:
> From: Masayoshi Mizuma 
> 
> Cleanup some test scripts by using helper functions.
> 
> Signed-off-by: Masayoshi Mizuma 
> ---
>  test/blk-exhaust.sh   | 21 ++--
>  test/btt-check.sh | 52 ++-
>  test/btt-errors.sh|  7 +++---
>  test/btt-pad-compat.sh| 36 ---
>  test/clear.sh | 25 +++
>  test/create.sh| 26 +---
>  test/daxdev-errors.sh | 29 --
>  test/firmware-update.sh   | 25 +--
>  test/inject-error.sh  | 24 --
>  test/label-compat.sh  | 17 +
>  test/multi-dax.sh | 23 ++---
>  test/pmem-errors.sh   | 19 +-
>  test/rescan-partitions.sh | 22 -
>  test/sector-mode.sh   | 22 ++---
>  14 files changed, 135 insertions(+), 213 deletions(-)
> 
> 
[..]

> diff --git a/test/sector-mode.sh b/test/sector-mode.sh
> index d507788..3576b70 100755
> --- a/test/sector-mode.sh
> +++ b/test/sector-mode.sh
> @@ -11,10 +11,6 @@
>  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>  # General Public License for more details.
>  
> -NDCTL="../ndctl/ndctl"
> -BUS="-b nfit_test.0"
> -BUS1="-b nfit_test.1"
> -TEST=$0
>  rc=77
>  
>  . ./common
> @@ -24,25 +20,23 @@ trap 'err $LINENO' ERR
>  
>  # setup (reset nfit_test dimms)
>  modprobe nfit_test
> -$NDCTL disable-region $BUS all
> -$NDCTL zero-labels $BUS all
> -$NDCTL enable-region $BUS all
> +$NDCTL disable-region $NFIT_TEST_BUS0 all
> +$NDCTL zero-labels $NFIT_TEST_BUS0 all
> +$NDCTL enable-region $NFIT_TEST_BUS0 all
>  
> -$NDCTL disable-region $BUS1 all
> -$NDCTL zero-labels $BUS1 all
> -$NDCTL enable-region $BUS1 all
> +$NDCTL disable-region $NFIT_TEST_BUS1 all
> +$NDCTL zero-labels $NFIT_TEST_BUS1 all
> +$NDCTL enable-region $NFIT_TEST_BUS1 all

In all six instances above, missing the '-b' before $NFIT_TEST_BUS*

>  
>  rc=1
>  query=". | sort_by(.size) | reverse | .[0].dev"
> -NAMESPACE=$($NDCTL list $BUS1 -N | jq -r "$query")
> +NAMESPACE=$($NDCTL list $NFIT_TEST_BUS1 -N | jq -r "$query")

Also here..

>  REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r ".dev")
>  echo 0 > /sys/bus/nd/devices/$REGION/read_only
>  $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
> -modprobe -r nfit_test
> +_cleanup
>  
>  exit 0

Other than these, the patches look good. Thanks for these cleanups!
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm