Hi Adam,

Is it possible for the test to control the message-set?
If so, it might be safer to be explicit about the message-set to be used.
(Similar to setting LC_CTYPE=C)

Adding the "error=nn" should be sufficient without matching the full text.
It will be more resilient to possible (though unlikely) changes in the messages.

The distinction between the "No such file" and "No such file or directory" is not significant and must have crept in with multiple authors.  Unix does not have two different messages for error=2 and the shorter one covers both.

I would collapse the cases to:

static final String PERMISSION_DENIED_ERROR_MSG = "(Permission denied|error=13)";
static final String NO_SUCH_FILE_ERROR_MSG = "(No such file|error=2)";

Regards, Roger

On 2/21/20 9:51 AM, Adam Farley8 wrote:
Hi All,

Reviews and sponsor requested for a small test change.

Parts of the test appear to be pattern-matching on error messages from
catalogues on the system.

When an AIX machine has the file set "bos.msg.en_US.rte", the messages are
different for the same codes.

E.g. for Error code 13 (in the relevant group, see libc.cat) we get:

*With* file set: error=13, The file access permissions do not allow the
specified action
*Without* file set: error=13, Permission denied

Since the pattern the test matches on is "Permission denied", it fails if
the aforementioned file set is installed.

The simplest option appears to be adding the second potential form of the
message into the regex (see webrev).

http://cr.openjdk.java.net/~afarley/8239365.1/webrev/

Another option is to have "error=x," replace the regex for each error
message, unless the format of this changes on an OS I haven't checked.

Bug: https://bugs.openjdk.java.net/browse/JDK-8239365

Best Regards

Adam Farley
IBM Runtimes

P.S. The bug database website appears to be busy restarting at the moment,
if you have difficulty accessing the second link.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


Reply via email to