diff mbox series

[v2,for,3.0,07/16] docker: gracefully skip check_qemu

Message ID 20180713121741.19262-8-alex.bennee@linaro.org
State New
Headers show
Series various docker fixes | expand

Commit Message

Alex Bennée July 13, 2018, 12:17 p.m. UTC
Not all our images are able to run the tests. Rather than use features
we can just check for the existence and run-ability of gtester. If the
image has been setup for binfmt_misc it will be able to run anyway.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/common.rc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé July 17, 2018, 3:02 a.m. UTC | #1
On 07/13/2018 09:17 AM, Alex Bennée wrote:
> Not all our images are able to run the tests. Rather than use features
> we can just check for the existence and run-ability of gtester. If the
> image has been setup for binfmt_misc it will be able to run anyway.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/docker/common.rc | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
> index cfc620d554..6df431eb72 100755
> --- a/tests/docker/common.rc
> +++ b/tests/docker/common.rc
> @@ -47,7 +47,13 @@ check_qemu()
>      else
>          TEST="$@"
>      fi
> -    make $MAKEFLAGS $TEST
> +
> +    if type gtester > /dev/null 2>&1 && \

commit e465ce7d09939d631f1861e0bd8873417c1c0d65

    tests: Use "command -v" instead of which(1) in shell scripts

    When which(1) is not installed, we would complain "perl not found"
    because it's the first set_prog_path check. The error message is
    wrong.

    Fix it by using "command -v", a native way to query the existence
    of a command.

> +           gtester --version > /dev/null 2>&1; then
> +        make $MAKEFLAGS $TEST
> +    else
> +        echo "No working gtester, skipping make $TEST"
> +    fi
>  }
>  
>  test_fail()
>
Alex Bennée July 17, 2018, 10:22 a.m. UTC | #2
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 07/13/2018 09:17 AM, Alex Bennée wrote:
>> Not all our images are able to run the tests. Rather than use features
>> we can just check for the existence and run-ability of gtester. If the
>> image has been setup for binfmt_misc it will be able to run anyway.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  tests/docker/common.rc | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
>> index cfc620d554..6df431eb72 100755
>> --- a/tests/docker/common.rc
>> +++ b/tests/docker/common.rc
>> @@ -47,7 +47,13 @@ check_qemu()
>>      else
>>          TEST="$@"
>>      fi
>> -    make $MAKEFLAGS $TEST
>> +
>> +    if type gtester > /dev/null 2>&1 && \
>
> commit e465ce7d09939d631f1861e0bd8873417c1c0d65
>
>     tests: Use "command -v" instead of which(1) in shell scripts

type is also a shell built-in albeit an 1982 bashism. I'll switch to
command -v as tending towards POSIX is what we should aim for (although
our test-FOO/common.rc structure seems a little confused).

>
>     When which(1) is not installed, we would complain "perl not found"
>     because it's the first set_prog_path check. The error message is
>     wrong.
>
>     Fix it by using "command -v", a native way to query the existence
>     of a command.
>
>> +           gtester --version > /dev/null 2>&1; then
>> +        make $MAKEFLAGS $TEST
>> +    else
>> +        echo "No working gtester, skipping make $TEST"
>> +    fi
>>  }
>>
>>  test_fail()
>>


--
Alex Bennée
Philippe Mathieu-Daudé July 17, 2018, 3:05 p.m. UTC | #3
On 07/17/2018 07:22 AM, Alex Bennée wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>> On 07/13/2018 09:17 AM, Alex Bennée wrote:
>>> Not all our images are able to run the tests. Rather than use features
>>> we can just check for the existence and run-ability of gtester. If the
>>> image has been setup for binfmt_misc it will be able to run anyway.
>>>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> ---
>>>  tests/docker/common.rc | 8 +++++++-
>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
>>> index cfc620d554..6df431eb72 100755
>>> --- a/tests/docker/common.rc
>>> +++ b/tests/docker/common.rc
>>> @@ -47,7 +47,13 @@ check_qemu()
>>>      else
>>>          TEST="$@"
>>>      fi
>>> -    make $MAKEFLAGS $TEST
>>> +
>>> +    if type gtester > /dev/null 2>&1 && \
>>
>> commit e465ce7d09939d631f1861e0bd8873417c1c0d65
>>
>>     tests: Use "command -v" instead of which(1) in shell scripts
> 
> type is also a shell built-in albeit an 1982 bashism. I'll switch to
> command -v as tending towards POSIX is what we should aim for (although
> our test-FOO/common.rc structure seems a little confused).

Thanks, with 'command -v':
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> 
>>
>>     When which(1) is not installed, we would complain "perl not found"
>>     because it's the first set_prog_path check. The error message is
>>     wrong.
>>
>>     Fix it by using "command -v", a native way to query the existence
>>     of a command.
>>
>>> +           gtester --version > /dev/null 2>&1; then
>>> +        make $MAKEFLAGS $TEST
>>> +    else
>>> +        echo "No working gtester, skipping make $TEST"
>>> +    fi
>>>  }
>>>
>>>  test_fail()
>>>
> 
> 
> --
> Alex Bennée
>
diff mbox series

Patch

diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index cfc620d554..6df431eb72 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -47,7 +47,13 @@  check_qemu()
     else
         TEST="$@"
     fi
-    make $MAKEFLAGS $TEST
+
+    if type gtester > /dev/null 2>&1 && \
+           gtester --version > /dev/null 2>&1; then
+        make $MAKEFLAGS $TEST
+    else
+        echo "No working gtester, skipping make $TEST"
+    fi
 }
 
 test_fail()