RR(XS): JDK-8002116 This JdbReadTwiceTest.sh gets an exit 1
David Holmes
david.holmes at oracle.com
Wed Jan 22 02:38:55 PST 2014
On 22/01/2014 7:57 PM, Dmitry Samersoff wrote:
> On 2014-01-22 10:39, David Holmes wrote:
>> On 22/01/2014 12:00 AM, Dmitry Samersoff wrote:
>>> Missed CR in subject. Sorry!
>>>
>>> http://cr.openjdk.java.net/~dsamersoff/JDK-8002116/webrev.01/
>>
>> You already create the file with mkFiles so no need to echo something
>> into it, a simple cat will suffice to see if it is unreadable.
>
> Exit code of cat is not specified. So cat is enough to just warn user,
> but we have to use grep to branch.
>
> Grep should return 2 in case of permission denied, but it's not stable
> across implementations - grep can return 0 if patter is found and 1 in
> all other cases.
>
> So I just choose the most reliable solution.
So grep is commonly better than cat but still not guaranteed - okay. But
can't you simply grep the empty file to get the same result?
No big deal.
David
>> Not sure why this was being run as root though - can't be normal else
>> we'd have seen this before. There are other tests that fail when run as
>> root due to still being able to read/write unreadable/unwriteable files.
>
> I plan to file infrastructure bug to clarify it. Tests shouldn't run as
> root in any case.
>
> -Dmitry
>
>>
>> BTW the indention in that test case is messed up (in the original).
>>
>> David
>>
>>>
>>> On 2014-01-21 17:49, Dmitry Samersoff wrote:
>>>> Hi Everyone,
>>>>
>>>> Please review.
>>>>
>>>> http://cr.openjdk.java.net/~dsamersoff/JDK-8002116/webrev.01/
>>>>
>>>> I can't reproduce the issue locally, but suspect, the test failed
>>>> because after chmod a-r the file is sill readable. So check it
>>>> explicitly before run the test itself.
>>>>
>>>
>>>
>
>
More information about the serviceability-dev
mailing list