[sheepdog] [PATCH 1/2] test: consoliate test 035 to test more bugs

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Sep 4 06:02:02 CEST 2012


At Tue,  4 Sep 2012 00:39:00 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> - also add two helpers: _simulate_mahcine_done and _cleanup_machine_simulation
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  tests/035       | 25 ++++++++++---------------
>  tests/035.out   | 20 ++++++++++----------
>  tests/common.rc | 20 ++++++++++++++++++++
>  3 files changed, 40 insertions(+), 25 deletions(-)
> 
> diff --git a/tests/035 b/tests/035
> index 501f959..7e2ef98 100755
> --- a/tests/035
> +++ b/tests/035
> @@ -17,33 +17,28 @@ trap "_uninit; exit \$status" 0 1 2 3 15
>  
>  _uninit()
>  {
> -	iptables -D INPUT -p tcp --sport 7001 -j DROP
> -	iptables -D INPUT -p tcp --dport 7001 -j DROP
> +	for i in `seq 1 4`; do
> +		_cleanup_machine_simulation $i
> +	done
>  }
>  
>  _cleanup
>  
> -for i in `seq 0 1 2`; do
> -    _start_sheep $i
> +for i in `seq 0 5`; do
> +	_start_sheep $i
>  done
>  
> -_wait_for_sheep 3
> +_wait_for_sheep 6
>  
>  $COLLIE cluster format -c 3 -m unsafe
>  
>  $COLLIE vdi create test 40M
> -(
> -dd if=/dev/urandom | $COLLIE vdi write test
> -) &
> +dd if=/dev/urandom | $COLLIE vdi write test &
>  
>  sleep 3
> -# Simulate machine(127.0.0.1:7001) down
> -iptables -A INPUT -p tcp --sport 7001 -j DROP
> -iptables -A INPUT -p tcp --dport 7001 -j DROP
> -
> -sleep 1
> -# Trigger the confchg
> -_kill_sheep 1
> +for i in `seq 1 4`; do
> +	_simulate_machine_down $i
> +done

Should we call _wait_for_sheep_recovery after _simulate_machine_down?
I've encountered no object error with this patch.

Thanks,

Kazutaka



More information about the sheepdog mailing list