iotests: More _filter_img_create fixes
cover iotests: More _filter_img_create fixes
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(-)
Signature · 1 line
2.26.2
PATCH 1/2 iotests: Drop readarray from _do_filter_img_create
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.
--- tests/qemu-iotests/common.filter | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tests/qemu-iotests/common.filter +5 -5
@@ -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.
Signature · 1 line
2.26.2
Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
Quoted 11 lines · 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
headandtail, we do not really need it, so we might as well not use it.Reported-by Claudio Fontana <[email protected]>Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/common.filter | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
In reply to Max ReitzQuoted 4 lines · 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
headandtail, 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.
Quoted 30 lines
Reported-by Claudio Fontana <[email protected]>Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/common.filter | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)tests/qemu-iotests/common.filter +5
-5@@ -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.
Signature · 1 line
Alex Bennée
PATCH 2/2 iotests: Set LC_ALL=C for sort
In reply to Max ReitzOtherwise 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.)
--- tests/qemu-iotests/common.filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/common.filter +1 -1
@@ -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/ *$//'
Signature · 1 line
2.26.2
Re: [PATCH 2/2] iotests: Set LC_ALL=C for sort
Quoted 5 lines · Max Reitz
Otherwise the result is basically unpredictable.
(Note that the precise environment variable to control sorting order is
LC_COLLATE, butLC_ALLoverridesLC_COLLATE, and we do not want the sorting order to be messed up ifLC_ALLis set in the environment.)
Yep, that logic is correct.
Quoted 6 lines
Reported-by John Snow <[email protected]>Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/common.filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
tests/qemu-iotests/common.filter +1
-1@@ -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/ *$//'
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Re: [PATCH 2/2] iotests: Set LC_ALL=C for sort
In reply to Max ReitzQuoted 8 lines · Max Reitz
Otherwise the result is basically unpredictable.
(Note that the precise environment variable to control sorting order is
LC_COLLATE, butLC_ALLoverridesLC_COLLATE, and we do not want the sorting order to be messed up ifLC_ALLis set in the environment.)Reported-by John Snow <[email protected]>Signed-off-by Max Reitz <[email protected]>
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?
Quoted 17 lines
--- tests/qemu-iotests/common.filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/qemu-iotests/common.filter +1
-1@@ -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/ *$//'
Signature · 1 line
Alex Bennée
Re: [PATCH 2/2] iotests: Set LC_ALL=C for sort
Quoted 9 lines · Alex Bennée
Quoted 6 lines · Max Reitz
Otherwise the result is basically unpredictable.
(Note that the precise environment variable to control sorting order is
LC_COLLATE, butLC_ALLoverridesLC_COLLATE, and we do not want the sorting order to be messed up ifLC_ALLis set in the environment.)
Quoted 7 lines
Quoted 2 lines
Reported-by John Snow <[email protected]>Signed-off-by Max Reitz <[email protected]>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
Quoted 7 lines · Max Reitz
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
Quoted 8 lines
Max Reitz (2):
iotests: Drop readarray from_do_filter_img_create
iotests: Set LC_ALL=C for sorttests/qemu-iotests/common.filter | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
—js
Quoted 11 lines · John Snow
Quoted 7 lines · Max Reitz
Hi,
I’m sorry.
John, could I ask you to test whether this series fixes the problems you’re seeing?
Quoted 6 lines
This is based on kwolf/block, I see.
By the time you return to reading work email, this link will have information for you:
:)
I thank you, John from the past. Though only future John will ever know.
Max