diff mbox

[v2,1/4] iotests: fix exclusion option

Message ID 1432831521-11972-2-git-send-email-jsnow@redhat.com
State New
Headers show

Commit Message

John Snow May 28, 2015, 4:45 p.m. UTC
If you are running out-of-tree, the -x option to exclude
a certain iotest is broken.

Replace porcelain usage of ls with a sturdier grep command.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/qemu-iotests/common | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

John Snow June 1, 2015, 4:29 p.m. UTC | #1
On 05/28/2015 12:45 PM, John Snow wrote:
> If you are running out-of-tree, the -x option to exclude
> a certain iotest is broken.
> 
> Replace porcelain usage of ls with a sturdier grep command.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  tests/qemu-iotests/common | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
> index 1e556bb..3949d18 100644
> --- a/tests/qemu-iotests/common
> +++ b/tests/qemu-iotests/common
> @@ -82,7 +82,8 @@ s/ .*//p
>      elif $xgroup
>      then
>          # arg after -x
> -        [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
> +        # Populate $tmp.list with all tests
> +        awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.list 2>/dev/null
>          group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
>  s/ .*//p
>  }'`
> 

s/grep/awk/

Does this look good otherwise?

--js
diff mbox

Patch

diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 1e556bb..3949d18 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -82,7 +82,8 @@  s/ .*//p
     elif $xgroup
     then
         # arg after -x
-        [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
+        # Populate $tmp.list with all tests
+        awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.list 2>/dev/null
         group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
 s/ .*//p
 }'`