RFR: 7903044: Report `os.*` system properties in .jtr file

Jonathan Gibbons jjg at openjdk.java.net
Mon Nov 8 18:49:48 UTC 2021


On Mon, 8 Nov 2021 06:26:47 GMT, Christian Stein <cstein at openjdk.org> wrote:

> https://bugs.openjdk.java.net/browse/CODETOOLS-7903044

Changes requested by jjg (Lead).

src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java line 141:

> 139:         for (String p: props) {
> 140:             testResult.putProperty(p, System.getProperty(p));
> 141:         }

Nice and simple ... but probably too simple.

This will report the properties for the JVM running `jtreg`, which is OK for `user.name`, but for the `os.*` properties we probably want the values for the test JVM.  You can get the properties from `params.getTestJDK().getProperties()` ... or better still, use/report the values cached in `params.getTestOS()`.
 And, if we're going as far as using `params.getTestOS()` it might be worth printing out the full `OS.toString()`.
 
 So, suggest either
 
 *  `testResult.putProperty(` _name_ `, os.` _field_ `)` for the three values, or else just
 * `testProperty.putProperty("testJDK_OS", os.toString())`
 
 (or both?)

-------------

PR: https://git.openjdk.java.net/jtreg/pull/35


More information about the jtreg-dev mailing list