[sheepdog] [PATCH 2/2] tests/functional: add 069 for testing vdi creation during session timeout

Liu Yuan namei.unix at gmail.com
Tue Jul 2 08:58:09 CEST 2013


On Mon, Jul 01, 2013 at 11:31:57PM -0700, Kai Zhang wrote:
> Signed-off-by: Kai Zhang <kyle at zelin.io>
> ---
>  tests/functional/069       |   34 ++++++++++++++++++++++++++++++++++
>  tests/functional/069.out   |    5 +++++
>  tests/functional/common.rc |    1 +
>  tests/functional/group     |    1 +
>  4 files changed, 41 insertions(+)
>  create mode 100755 tests/functional/069
>  create mode 100644 tests/functional/069.out
> 
> diff --git a/tests/functional/069 b/tests/functional/069
> new file mode 100755
> index 0000000..45fbb13
> --- /dev/null
> +++ b/tests/functional/069
> @@ -0,0 +1,34 @@
> +#!/bin/bash
> +
> +# Test collie vdi create during session timeout
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1        # failure is the default!
> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./common.filter
> +
> +_cleanup
> +
> +for i in 0 1 2; do
> +    _start_sheep $i
> +done
> +
> +_wait_for_sheep 3
> +
> +$COLLIE cluster format
> +sleep 1
> +
> +_kill_zk_session 0
> +
> +$COLLIE vdi create test1 10M &
> +$COLLIE vdi create test2 10M
> +
> +_wait_for_sheep 3 0
> +
> +$COLLIE vdi list | _filter_short_date
> diff --git a/tests/functional/069.out b/tests/functional/069.out
> new file mode 100644
> index 0000000..f02c87a
> --- /dev/null
> +++ b/tests/functional/069.out
> @@ -0,0 +1,5 @@
> +QA output created by 069
> +using backend plain store
> +  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
> +  test1        0   10 MB  0.0 MB  0.0 MB DATE   fd32fc     3              
> +  test2        0   10 MB  0.0 MB  0.0 MB DATE   fd3815     3              
> diff --git a/tests/functional/common.rc b/tests/functional/common.rc
> index f621261..ce229f2 100644
> --- a/tests/functional/common.rc
> +++ b/tests/functional/common.rc
> @@ -486,6 +486,7 @@ _kill_zk_session()
>  		_kill_sheep $1
>  		_wait_for_sheep_stop $1
>  		_start_sheep $1
> +		sleep 1
>  	fi
>  }
>  
> diff --git a/tests/functional/group b/tests/functional/group
> index ab34281..eb2184e 100644
> --- a/tests/functional/group
> +++ b/tests/functional/group
> @@ -82,3 +82,4 @@
>  066 auto quick cluster md
>  067 auto quick cluster
>  068 auto quick cluster
> +069 auto cluster

I can't pass this script. I guess there is some timing problem.

one failure message:

069  Test collie vdi create during session timeout - output mismatch (see 069.out.bad)
--- 069.out	2013-07-02 14:34:48.056895130 +0800
+++ 069.out.bad	2013-07-02 14:54:49.932844585 +0800
@@ -1,5 +1,4 @@
 QA output created by 069
 using backend plain store
+Failed to create VDI test2: Waiting for other nodes to join cluster
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0   10 MB  0.0 MB  0.0 MB DATE   fd32fc     3              
-  test2        0   10 MB  0.0 MB  0.0 MB DATE   fd3815     3              
Failures: 069
Failed 1 of 1 tests

another failure:

PLATFORM      -- Linux/x86_64 ubuntu-precise 3.5.0-34-generic

069  Test collie vdi create during session timeout [failed, exit status 1] - output mismatch (see 069.out.bad)
--- 069.out	2013-07-02 14:34:48.056895130 +0800
+++ 069.out.bad	2013-07-02 14:55:39.188842514 +0800
@@ -1,5 +1,2 @@
 QA output created by 069
-using backend plain store
-  Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0   10 MB  0.0 MB  0.0 MB DATE   fd32fc     3              
-  test2        0   10 MB  0.0 MB  0.0 MB DATE   fd3815     3              
+should have 3, but have 2 sheep
Failures: 069
Failed 1 of 1 tests



More information about the sheepdog mailing list