[U-Boot] [PATCH 1/1] test/py: provide example scripts for integrating qemu

Stephen Warren swarren at wwwdotorg.org
Wed Sep 20 15:52:43 UTC 2017


On 09/19/2017 02:15 PM, Heinrich Schuchardt wrote:
> On 09/18/2017 11:28 PM, Stephen Warren wrote:
>> On 09/18/2017 01:55 PM, Heinrich Schuchardt wrote:
>>> On 09/18/2017 08:27 PM, Stephen Warren wrote:
>>>> On 09/17/2017 01:32 PM, Heinrich Schuchardt wrote:
>>>>> The necessary parameters for running Python tests on qemu are
>>>>> tediouus to find.

>>>>> +    -device e1000,netdev=eth0 -machine pc-i440fx-2.8 \
>>>>> +    -monitor unix:/tmp/u-boot-monitor-socket,server,nowait
>>>>> +
>>>>> +In `u-boot-test-reset` call the socat command to send a system reset:
>>>>> +
>>>>> +    #!/bin/sh
>>>>> +    echo system_reset | socat - UNIX-CONNECT:/tmp/u-boot-monitor-socket
>>>>> +    sleep 1
>>>>> +    true

>>>> The true command shouldn't have any effect
>>>> given set -e isn't in use.
>>>
>>> man dash:
>>> The shell will return the exit status of the last command executed.
>>>
>>> If the last command is false running the test suite fails.
>>
>> OK. Why would either the echo or sleep fail? If they do, then that
>> failure should be passed back to test/py so that it can record the
>> problem. Errors shouldn't just be ignored.
> 
> true is really needed here. The return code of the script otherwise is
> always false even though the system reset succeeds.

I've tested this on my system, and such a shell script always sets the 
exit code to 0; success. echo or socat should only ever exit non-zero if 
they fail, which shouldn't happen.


More information about the U-Boot mailing list