[ipv6] Regarding 8220673: Add test library support for determining platform IP support

Martin Buchholz martinrb at google.com
Mon May 6 22:55:01 UTC 2019


On Thu, May 2, 2019 at 2:28 AM Daniel Fuchs <daniel.fuchs at oracle.com> wrote:

>
> 1. IPSupport needs to read system properties, attempts
>     to bind sockets etc... I wonder how that might interact
>     with tests that use a security manager, as some of these
>     operations may throw a SecurityException.
>     Maybe some double checking would be in order for those.
>

Reading system properties is such a common operation that test library code
should simply rely on the security manager allowing it.  Yes, it is
sometimes useful to have a DraconianSecurityManager in a test, including
one that disallows System.getProperty (I've written such a test myself!)
but then the use of that security manager should be scoped to a limited
operation that includes no test library code, as in

    /**
     * Runs Runnable r with a security policy that permits precisely
     * the specified permissions.  If there is no current security
     * manager, a temporary one is set for the duration of the
     * Runnable.  We require that any security manager permit
     * getPolicy/setPolicy.
     */
    public void runWithSecurityManagerWithPermissions(Runnable r,
                                                      Permission...
permissions) {

The same argument might apply to socket operations as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20190506/107f83f9/attachment-0001.html>


More information about the net-dev mailing list