[sheepdog] [PATCH v2] func/test: fix some test scripts when using multi disk

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Aug 14 07:50:14 CEST 2014


At Thu, 14 Aug 2014 10:12:26 +0800,
Ruoyu wrote:
> 
> check script allows -md option to use multi disk for functional test.
> But it seems some test suites are not compatible with it. This patch
> fixes the problem.
> 
> Test suites 010, 027, 032, 033 and 042 are involved.
> 
> Signed-off-by: Ruoyu <liangry at ucweb.com>
> ---
> v2:
>  - add 027 to patch
> ---
>  tests/functional/010           | 6 ++++--
>  tests/functional/027           | 2 +-
>  tests/functional/032           | 9 ++++++---
>  tests/functional/032.out       | 6 ------
>  tests/functional/033           | 9 ++++++---
>  tests/functional/033.out       | 6 ------
>  tests/functional/042           | 3 ++-
>  tests/functional/common.filter | 5 +++++
>  8 files changed, 24 insertions(+), 22 deletions(-)

On my environment, this patch couldn't applied. Below is an error
message:

Applying: func/test: fix some test scripts when using multi disk
error: patch failed: tests/functional/032:36
error: tests/functional/032: patch does not apply
...

Is your tree a little bit old (yes, it is hard to think...). But the
36th line:
_wait_for_sheep 8
in tests/functional/032 seems to be missing.

Could you rebase it on the latest master?

Thanks,
Hitoshi

> 
> diff --git a/tests/functional/010 b/tests/functional/010
> index 580140c..ea2ec82 100755
> --- a/tests/functional/010
> +++ b/tests/functional/010
> @@ -34,7 +34,8 @@ done
>  $DOG cluster recover enable
>  _wait_for_sheep_recovery 0
>  $DOG cluster info | head -6 | _filter_cluster_info
> -ls $STORE/*/obj/* | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/* 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort
>  
>  $DOG cluster recover disable
>  for i in 3 4; do
> @@ -52,5 +53,6 @@ done
>  $DOG cluster recover enable
>  _wait_for_sheep_recovery 0
>  $DOG cluster info | head -6 | _filter_cluster_info
> -ls $STORE/*/obj/* | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/* 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort
>  $DOG vdi read test 0 32m | md5sum
> diff --git a/tests/functional/027 b/tests/functional/027
> index 5fae5a1..c620bca 100755
> --- a/tests/functional/027
> +++ b/tests/functional/027
> @@ -19,4 +19,4 @@ _kill_sheep 1
>  
>  _wait_for_sheep_recovery 0
>  
> -find $STORE -name '80fd32fc00000000' | _filter_store | sort
> +find $STORE -name '80fd32fc00000000' | _filter_store | _filter_md_store | sort
> diff --git a/tests/functional/032 b/tests/functional/032
> index d902a30..a64b5c5 100755
> --- a/tests/functional/032
> +++ b/tests/functional/032
> @@ -36,10 +36,13 @@ done
>  
>  _wait_for_sheep_recovery 0
>  
> -ls $STORE/*/obj/807c2b2500000000 | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/807c2b2500000000 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort
>  for i in `seq 0 24`; do
> -    ls $STORE/*/obj/007c2b25000000`printf "%02x" $i` | _filter_store | sort
> +    ls $STORE/*/{obj,d[0-9]*}/007c2b25000000`printf "%02x" $i` 2> /dev/null | \
> +		_filter_store | _filter_md_store | sort
>  done
> -ls $STORE/*/obj/.stale | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/.stale 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort -u
>  
>  $DOG vdi read test | md5sum
> diff --git a/tests/functional/032.out b/tests/functional/032.out
> index 29a47e1..34a312e 100644
> --- a/tests/functional/032.out
> +++ b/tests/functional/032.out
> @@ -158,12 +158,6 @@ STORE/5/obj/007c2b2500000018
>  STORE/6/obj/007c2b2500000018
>  STORE/7/obj/007c2b2500000018
>  
> -
> -
> -
> -
> -
> -
>  STORE/0/obj/.stale:
>  STORE/1/obj/.stale:
>  STORE/2/obj/.stale:
> diff --git a/tests/functional/033 b/tests/functional/033
> index c352370..a35081e 100755
> --- a/tests/functional/033
> +++ b/tests/functional/033
> @@ -47,10 +47,13 @@ done
>  
>  _wait_for_sheep_recovery 0
>  
> -ls $STORE/*/obj/807c2b2500000000 | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/807c2b2500000000 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort
>  for i in `seq 0 24`; do
> -    ls $STORE/*/obj/007c2b25000000`printf "%02x" $i` | _filter_store | sort
> +    ls $STORE/*/{obj,d[0-9]*}/007c2b25000000`printf "%02x" $i` 2> /dev/null | \
> +		_filter_store | _filter_md_store | sort
>  done
> -ls $STORE/*/obj/.stale | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/.stale 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort -u
>  
>  $DOG vdi read test | md5sum
> diff --git a/tests/functional/033.out b/tests/functional/033.out
> index 88b6c7c..ceae3a4 100644
> --- a/tests/functional/033.out
> +++ b/tests/functional/033.out
> @@ -80,12 +80,6 @@ STORE/1/obj/007c2b2500000018
>  STORE/5/obj/007c2b2500000018
>  STORE/6/obj/007c2b2500000018
>  
> -
> -
> -
> -
> -
> -
>  STORE/0/obj/.stale:
>  STORE/1/obj/.stale:
>  STORE/2/obj/.stale:
> diff --git a/tests/functional/042 b/tests/functional/042
> index 54e8a33..fdafa54 100755
> --- a/tests/functional/042
> +++ b/tests/functional/042
> @@ -46,4 +46,5 @@ for i in `seq 0 3`; do
>      $DOG node list -p 700$i
>  done
>  _node_info
> -ls $STORE/*/obj/* | _filter_store | sort
> +ls $STORE/*/{obj,d[0-9]*}/* 2> /dev/null | \
> +	_filter_store | _filter_md_store | sort
> diff --git a/tests/functional/common.filter b/tests/functional/common.filter
> index 2c62ef2..2fcc05d 100644
> --- a/tests/functional/common.filter
> +++ b/tests/functional/common.filter
> @@ -163,6 +163,11 @@ _filter_store()
>      sed -e "s|$STORE|STORE|g"
>  }
>  
> +_filter_md_store()
> +{
> +    sed -e "s|/d[0-9]*/|/obj/|g"
> +}
> +
>  _filter_info()
>  {
>  	awk '{if ($2 ~ /^[0-9.]+$/) {$2="MASKED";$6="MASKED";$8="MASTERD"};print $0}'
> -- 
> 1.8.3.2
> 
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list