8239365: ProcessBuilder test modifications for AIX execution

Reviewed-by: rriggs, stuefe
This commit is contained in:
Adam Farley 2020-04-22 15:37:37 -04:00
parent 268ea904ec
commit 2785fe5621

View File

@ -74,6 +74,10 @@ public class Basic {
/* used for AIX only */
static final String libpath = System.getenv("LIBPATH");
/* Used for regex String matching for long error messages */
static final String PERMISSION_DENIED_ERROR_MSG = "(Permission denied|error=13)";
static final String NO_SUCH_FILE_ERROR_MSG = "(No such file|error=2)";
/**
* Returns the number of milliseconds since time given by
* startNanoTime, which must have been previously returned from a
@ -305,7 +309,7 @@ public class Basic {
} catch (IOException e) {
String m = e.getMessage();
if (EnglishUnix.is() &&
! matches(m, "Permission denied"))
! matches(m, PERMISSION_DENIED_ERROR_MSG))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
}
@ -415,7 +419,7 @@ public class Basic {
} catch (IOException e) {
String m = e.getMessage();
if (EnglishUnix.is() &&
! matches(m, "No such file"))
! matches(m, NO_SUCH_FILE_ERROR_MSG))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
@ -428,7 +432,7 @@ public class Basic {
} catch (IOException e) {
String m = e.getMessage();
if (EnglishUnix.is() &&
! matches(m, "No such file"))
! matches(m, NO_SUCH_FILE_ERROR_MSG))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
@ -1982,7 +1986,7 @@ public class Basic {
} catch (IOException e) {
String m = e.getMessage();
if (EnglishUnix.is() &&
! matches(m, "No such file or directory"))
! matches(m, NO_SUCH_FILE_ERROR_MSG))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
@ -1998,8 +2002,8 @@ public class Basic {
String m = e.getMessage();
Pattern p = Pattern.compile(programName);
if (! matches(m, programName)
|| (EnglishUnix.is()
&& ! matches(m, "No such file or directory")))
|| (EnglishUnix.is() &&
! matches(m, NO_SUCH_FILE_ERROR_MSG)))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
@ -2015,7 +2019,7 @@ public class Basic {
String m = e.getMessage();
if (! matches(m, "in directory")
|| (EnglishUnix.is() &&
! matches(m, "No such file or directory")))
! matches(m, NO_SUCH_FILE_ERROR_MSG)))
unexpected(e);
} catch (Throwable t) { unexpected(t); }
@ -2295,7 +2299,7 @@ public class Basic {
new File("./emptyCommand").delete();
String m = e.getMessage();
if (EnglishUnix.is() &&
! matches(m, "Permission denied"))
! matches(m, PERMISSION_DENIED_ERROR_MSG))
unexpected(e);
} catch (Throwable t) { unexpected(t); }