All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] iotests: More _filter_img_create fixes
@ 2020-07-10 16:32 Max Reitz
  2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Max Reitz @ 2020-07-10 16:32 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, John Snow, qemu-devel, Max Reitz

Hi,

I’m sorry.

John, could I ask you to test whether this series fixes the problems
you’re seeing?


Max Reitz (2):
  iotests: Drop readarray from _do_filter_img_create
  iotests: Set LC_ALL=C for sort

 tests/qemu-iotests/common.filter | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
  2020-07-10 16:32 [PATCH 0/2] iotests: More _filter_img_create fixes Max Reitz
@ 2020-07-10 16:32 ` Max Reitz
  2020-07-10 16:39   ` Eric Blake
  2020-07-10 21:02   ` Alex Bennée
  2020-07-10 16:32 ` [PATCH 2/2] iotests: Set LC_ALL=C for sort Max Reitz
  2020-07-10 17:18 ` [PATCH 0/2] iotests: More _filter_img_create fixes John Snow
  2 siblings, 2 replies; 10+ messages in thread
From: Max Reitz @ 2020-07-10 16:32 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, John Snow, qemu-devel, Max Reitz

Some systems where we run tests on do not have a 4.x bash, so they do
not have readarray.  While it looked a bit nicer than messing with
`head` and `tail`, we do not really need it, so we might as well not use
it.

Reported-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/common.filter | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 3833206327..345c3ca03e 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -138,13 +138,13 @@ _do_filter_img_create()
     # Split the line into the pre-options part ($filename_part, which
     # precedes ", fmt=") and the options part ($options, which starts
     # with "fmt=")
-    # (And just echo everything before the first "^Formatting")
-    readarray formatting_line < <($SED -e 's/, fmt=/\n/')
+    read formatting_line
 
-    filename_part=${formatting_line[0]}
-    unset formatting_line[0]
+    # Split line at the first ", fmt="
+    formatting_line=$(echo "$formatting_line" | $SED -e 's/, fmt=/\nfmt=/')
 
-    options="fmt=${formatting_line[@]}"
+    filename_part=$(echo "$formatting_line" | head -n 1)
+    options=$(echo "$formatting_line" | tail -n +2)
 
     # Set grep_data_file to '\|data_file' to keep it; make it empty
     # to drop it.
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] iotests: Set LC_ALL=C for sort
  2020-07-10 16:32 [PATCH 0/2] iotests: More _filter_img_create fixes Max Reitz
  2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
@ 2020-07-10 16:32 ` Max Reitz
  2020-07-10 16:43   ` Eric Blake
  2020-07-11  8:57   ` Alex Bennée
  2020-07-10 17:18 ` [PATCH 0/2] iotests: More _filter_img_create fixes John Snow
  2 siblings, 2 replies; 10+ messages in thread
From: Max Reitz @ 2020-07-10 16:32 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, John Snow, qemu-devel, Max Reitz

Otherwise the result is basically unpredictable.

(Note that the precise environment variable to control sorting order is
LC_COLLATE, but LC_ALL overrides LC_COLLATE, and we do not want the
sorting order to be messed up if LC_ALL is set in the environment.)

Reported-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/common.filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 345c3ca03e..4fd5c29b2a 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -177,7 +177,7 @@ _do_filter_img_create()
             -e 's/^\(data_file\)/3-\1/' \
             -e 's/^\(encryption\)/4-\1/' \
             -e 's/^\(preallocation\)/8-\1/' \
-        | sort \
+        | LC_ALL=C sort \
         | $SED -e 's/^[0-9]-//' \
         | tr '\n\0' ' \n' \
         | $SED -e 's/^ *$//' -e 's/ *$//'
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
  2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
@ 2020-07-10 16:39   ` Eric Blake
  2020-07-10 21:02   ` Alex Bennée
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Blake @ 2020-07-10 16:39 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, John Snow, qemu-devel

On 7/10/20 11:32 AM, Max Reitz wrote:
> Some systems where we run tests on do not have a 4.x bash, so they do
> not have readarray.  While it looked a bit nicer than messing with
> `head` and `tail`, we do not really need it, so we might as well not use
> it.
> 
> Reported-by: Claudio Fontana <cfontana@suse.de>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   tests/qemu-iotests/common.filter | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>
-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] iotests: Set LC_ALL=C for sort
  2020-07-10 16:32 ` [PATCH 2/2] iotests: Set LC_ALL=C for sort Max Reitz
@ 2020-07-10 16:43   ` Eric Blake
  2020-07-11  8:57   ` Alex Bennée
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Blake @ 2020-07-10 16:43 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, John Snow, qemu-devel

On 7/10/20 11:32 AM, Max Reitz wrote:
> Otherwise the result is basically unpredictable.
> 
> (Note that the precise environment variable to control sorting order is
> LC_COLLATE, but LC_ALL overrides LC_COLLATE, and we do not want the
> sorting order to be messed up if LC_ALL is set in the environment.)

Yep, that logic is correct.

> 
> Reported-by: John Snow <jsnow@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   tests/qemu-iotests/common.filter | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
> index 345c3ca03e..4fd5c29b2a 100644
> --- a/tests/qemu-iotests/common.filter
> +++ b/tests/qemu-iotests/common.filter
> @@ -177,7 +177,7 @@ _do_filter_img_create()
>               -e 's/^\(data_file\)/3-\1/' \
>               -e 's/^\(encryption\)/4-\1/' \
>               -e 's/^\(preallocation\)/8-\1/' \
> -        | sort \
> +        | LC_ALL=C sort \
>           | $SED -e 's/^[0-9]-//' \
>           | tr '\n\0' ' \n' \
>           | $SED -e 's/^ *$//' -e 's/ *$//'
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] iotests: More _filter_img_create fixes
  2020-07-10 16:32 [PATCH 0/2] iotests: More _filter_img_create fixes Max Reitz
  2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
  2020-07-10 16:32 ` [PATCH 2/2] iotests: Set LC_ALL=C for sort Max Reitz
@ 2020-07-10 17:18 ` John Snow
  2020-07-13  6:19   ` Max Reitz
  2 siblings, 1 reply; 10+ messages in thread
From: John Snow @ 2020-07-10 17:18 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel



On 7/10/20 12:32 PM, Max Reitz wrote:
> Hi,
> 
> I’m sorry.
> 
> John, could I ask you to test whether this series fixes the problems
> you’re seeing?
> 

This is based on kwolf/block, I see.

By the time you return to reading work email, this link will have
information for you:

https://travis-ci.org/github/jnsnow/qemu/jobs/706960907

> 
> Max Reitz (2):
>   iotests: Drop readarray from _do_filter_img_create
>   iotests: Set LC_ALL=C for sort
> 
>  tests/qemu-iotests/common.filter | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 

-- 
—js



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
  2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
  2020-07-10 16:39   ` Eric Blake
@ 2020-07-10 21:02   ` Alex Bennée
  1 sibling, 0 replies; 10+ messages in thread
From: Alex Bennée @ 2020-07-10 21:02 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, John Snow, qemu-devel, qemu-block


Max Reitz <mreitz@redhat.com> writes:

> Some systems where we run tests on do not have a 4.x bash, so they do
> not have readarray.  While it looked a bit nicer than messing with
> `head` and `tail`, we do not really need it, so we might as well not use
> it.

I've fixed the cirrus build failure by brew installing a more recent
bash. However if we prefer we could do this.

>
> Reported-by: Claudio Fontana <cfontana@suse.de>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  tests/qemu-iotests/common.filter | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
> index 3833206327..345c3ca03e 100644
> --- a/tests/qemu-iotests/common.filter
> +++ b/tests/qemu-iotests/common.filter
> @@ -138,13 +138,13 @@ _do_filter_img_create()
>      # Split the line into the pre-options part ($filename_part, which
>      # precedes ", fmt=") and the options part ($options, which starts
>      # with "fmt=")
> -    # (And just echo everything before the first "^Formatting")
> -    readarray formatting_line < <($SED -e 's/, fmt=/\n/')
> +    read formatting_line
>  
> -    filename_part=${formatting_line[0]}
> -    unset formatting_line[0]
> +    # Split line at the first ", fmt="
> +    formatting_line=$(echo "$formatting_line" | $SED -e 's/, fmt=/\nfmt=/')
>  
> -    options="fmt=${formatting_line[@]}"
> +    filename_part=$(echo "$formatting_line" | head -n 1)
> +    options=$(echo "$formatting_line" | tail -n +2)
>  
>      # Set grep_data_file to '\|data_file' to keep it; make it empty
>      # to drop it.


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] iotests: Set LC_ALL=C for sort
  2020-07-10 16:32 ` [PATCH 2/2] iotests: Set LC_ALL=C for sort Max Reitz
  2020-07-10 16:43   ` Eric Blake
@ 2020-07-11  8:57   ` Alex Bennée
  2020-07-13  7:55     ` Max Reitz
  1 sibling, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2020-07-11  8:57 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, John Snow, qemu-devel, qemu-block


Max Reitz <mreitz@redhat.com> writes:

> Otherwise the result is basically unpredictable.
>
> (Note that the precise environment variable to control sorting order is
> LC_COLLATE, but LC_ALL overrides LC_COLLATE, and we do not want the
> sorting order to be messed up if LC_ALL is set in the environment.)
>
> Reported-by: John Snow <jsnow@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Queued to pr/100720-testing-and-misc-2, thanks.

I've skipped patch 1/2 for now as I have an alternative fix but we can
switch it back if you prefer?


> ---
>  tests/qemu-iotests/common.filter | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
> index 345c3ca03e..4fd5c29b2a 100644
> --- a/tests/qemu-iotests/common.filter
> +++ b/tests/qemu-iotests/common.filter
> @@ -177,7 +177,7 @@ _do_filter_img_create()
>              -e 's/^\(data_file\)/3-\1/' \
>              -e 's/^\(encryption\)/4-\1/' \
>              -e 's/^\(preallocation\)/8-\1/' \
> -        | sort \
> +        | LC_ALL=C sort \
>          | $SED -e 's/^[0-9]-//' \
>          | tr '\n\0' ' \n' \
>          | $SED -e 's/^ *$//' -e 's/ *$//'


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] iotests: More _filter_img_create fixes
  2020-07-10 17:18 ` [PATCH 0/2] iotests: More _filter_img_create fixes John Snow
@ 2020-07-13  6:19   ` Max Reitz
  0 siblings, 0 replies; 10+ messages in thread
From: Max Reitz @ 2020-07-13  6:19 UTC (permalink / raw)
  To: John Snow, qemu-block; +Cc: Kevin Wolf, qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 513 bytes --]

On 10.07.20 19:18, John Snow wrote:
> 
> 
> On 7/10/20 12:32 PM, Max Reitz wrote:
>> Hi,
>>
>> I’m sorry.
>>
>> John, could I ask you to test whether this series fixes the problems
>> you’re seeing?
>>
> 
> This is based on kwolf/block, I see.
> 
> By the time you return to reading work email, this link will have
> information for you:
> 
> https://travis-ci.org/github/jnsnow/qemu/jobs/706960907

:)

I thank you, John from the past.  Though only future John will ever know.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] iotests: Set LC_ALL=C for sort
  2020-07-11  8:57   ` Alex Bennée
@ 2020-07-13  7:55     ` Max Reitz
  0 siblings, 0 replies; 10+ messages in thread
From: Max Reitz @ 2020-07-13  7:55 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Kevin Wolf, John Snow, qemu-devel, qemu-block


[-- Attachment #1.1: Type: text/plain, Size: 817 bytes --]

On 11.07.20 10:57, Alex Bennée wrote:
> 
> Max Reitz <mreitz@redhat.com> writes:
> 
>> Otherwise the result is basically unpredictable.
>>
>> (Note that the precise environment variable to control sorting order is
>> LC_COLLATE, but LC_ALL overrides LC_COLLATE, and we do not want the
>> sorting order to be messed up if LC_ALL is set in the environment.)
>>
>> Reported-by: John Snow <jsnow@redhat.com>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
> 
> Queued to pr/100720-testing-and-misc-2, thanks.
> 
> I've skipped patch 1/2 for now as I have an alternative fix but we can
> switch it back if you prefer?

I see you’ve sent your pull request already, so I’ll see whether I’ll
include 1/2 in some block pull request.  Maybe, maybe not.

Thanks for queuing 2/2, anyway. :)

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-13  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 16:32 [PATCH 0/2] iotests: More _filter_img_create fixes Max Reitz
2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
2020-07-10 16:39   ` Eric Blake
2020-07-10 21:02   ` Alex Bennée
2020-07-10 16:32 ` [PATCH 2/2] iotests: Set LC_ALL=C for sort Max Reitz
2020-07-10 16:43   ` Eric Blake
2020-07-11  8:57   ` Alex Bennée
2020-07-13  7:55     ` Max Reitz
2020-07-10 17:18 ` [PATCH 0/2] iotests: More _filter_img_create fixes John Snow
2020-07-13  6:19   ` Max Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.