[libvirt] 1/3 testsuite formatting bugs [was: [PATCH] Skip some xen tests if xend is not running]

Eric Blake eblake at redhat.com
Sat Jul 9 01:40:38 UTC 2011


On 07/08/2011 05:28 PM, Matthias Bolte wrote:
> 
> From cb39f79417dce294c654435c1a783065b4983adb Mon Sep 17 00:00:00 2001
> From: Matthias Bolte <matthias.bolte at googlemail.com>
> Date: Sat, 9 Jul 2011 01:20:05 +0200
> Subject: [PATCH] tests: Fix compressed test output padding logic
> 
> The current logic tries to count from 1 to 40 and ignores paddings
> of 0 and 1 to 40. This doesn't work for counter + 1 mod 40 == 0 like
> here for counter value 159
> 
> TEST: virsh-all
>       ........................................ 40
>       ........................................ 80
>       ........................................ 120
>       ....................................... 159 OK
> PASS: virsh-all
> 
> Instead count from 0 to 39 to fix this.
> ---
>  tests/test-lib.sh |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/test-lib.sh b/tests/test-lib.sh
> index 768f96b..9eb6864 100644
> --- a/tests/test-lib.sh
> +++ b/tests/test-lib.sh
> @@ -54,9 +54,9 @@ test_final()
>    status=$2
>  
>    if test "$verbose" = "0" ; then
> -    mod=`expr \( $counter + 1 \) % 40`
> -    if test "$mod" != "0" && test "$mod" != "1" ; then
> -      for i in `seq $mod 40`
> +    mod=`expr $counter % 40`
> +    if test "$mod" != "0" ; then
> +      for i in `seq $mod 39`

seq is a GNU-ism, but this is no less portable than what it was before.
 (To be portable to platforms that lack seq, this should really be
written as:

for i in 0 1 2 3 4 ... 39

but I'm okay waiting until someone complains before we make that change).

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110708/9fd762f9/attachment-0001.sig>


More information about the libvir-list mailing list