[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: fix false failure due to xargs usage
From: |
Eric Blake |
Subject: |
Re: [PATCH] tests: fix false failure due to xargs usage |
Date: |
Mon, 09 Dec 2013 17:54:07 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
On 12/09/2013 12:18 PM, Pádraig Brady wrote:
> On 12/09/2013 06:43 PM, Andreas Schwab wrote:
>> Pádraig Brady <address@hidden> writes:
>>
>>> diff --git a/tests/readlink/multi.sh b/tests/readlink/multi.sh
>>> index 3b91544..dc4ba87 100755
>>> --- a/tests/readlink/multi.sh
>>> +++ b/tests/readlink/multi.sh
>>> @@ -40,7 +40,7 @@ compare exp out || fail=1
>>> # Note the edge case that the last xargs run may not have a delimiter
>>> rm out || framework_failure_
>>> printf '/1\0/1\0/1' > exp || framework_failure_
>>> -printf '/1 /1 /1' | xargs -n2 readlink -n -m --zero >> out || fail=1
>>> +printf '/1 /1 /1 ' | xargs -n2 readlink -n -m --zero >> out || fail=1
>>
>> Still wrong.
>>
>> <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html>:
>>
>> The standard input shall be a text file.
>
> A "text file" doesn't have to have a new line AFAIK,
> so the above should be fine.
A text file must either end in newline or be empty; your approach does
neither.
Why not just:
readlink -n -m --zero /1 /1 >> out || fail=1
readlink -n -m --zero /1 >> out || fail=1
and just avoid the printf and xargs altogether?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature