[jdk8u-dev] Integrated: JDK-8292688: Support Security properties in security.testlibrary.Proc

Martin Balao mbalao at openjdk.org
Fri Aug 26 21:53:13 UTC 2022


On Sat, 20 Aug 2022 02:10:51 GMT, Martin Balao <mbalao at openjdk.org> wrote:

> Hi,
> 
> I'd like to propose a test library enhacement as described in JDK-8292688 [1].
> 
> In addition to hook context modifications from Proc.java changes in JDK-8209901, I had to use Paths::get to obtain a Path instance from a String (Path::of is not available in 8u).
> 
> I tested these changes with my own code snippet:
> 
> 
> public final class Main {
>     private static final String CHILD_ID = "CHILD_ID";
>     private static final String SEC_PROP = "SEC_PROP";
>     private static final String SEC_PROP_VAL = "KNOWN_VAL!";
>     public static void main(String[] args) throws Throwable {
>         if (args.length > 0 && args[0].equals(CHILD_ID)) {
>             String secVal = java.security.Security.getProperty(SEC_PROP);
>             System.out.println("SEC_PROP: " + secVal);
>             if (!secVal.equals(SEC_PROP_VAL)) {
>                 throw new Exception("TEST FAILED");
>             }
>         } else {
>             Proc p = Proc.create(Main.class.getName()).args(CHILD_ID);
>             p.secprop(SEC_PROP, SEC_PROP_VAL);
>             p.debug(Main.class.getName());
>             p.inheritIO();
>             p.start().waitFor(0);
>         }
>     }
> }
> 
> 
> Thanks,
> Martin.-
> 
> --
> [1] - https://bugs.openjdk.org/browse/JDK-8292688

This pull request has now been integrated.

Changeset: 0d5ea9d2
Author:    Martin Balao <mbalao at openjdk.org>
URL:       https://git.openjdk.org/jdk8u-dev/commit/0d5ea9d29e97f1e4adcc1e1d36bc109fc5cee506
Stats:     27 lines in 1 file changed: 26 ins; 0 del; 1 mod

8292688: Support Security properties in security.testlibrary.Proc

Reviewed-by: sgehwolf

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

PR: https://git.openjdk.org/jdk8u-dev/pull/107


More information about the jdk8u-dev mailing list