RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Fri Feb 12 21:55:43 UTC 2021


On Fri, 12 Feb 2021 21:32:04 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

>> ## java/net/MulticastSocket/SetLoopbackMode.java
>> 
>>     make test TEST="jtreg:test/jdk/java/net/MulticastSocket/SetLoopbackMode.java"
>>     
>>     
>>     STDOUT:
>>     IPv6 can be used
>>     Default network interface: null
>> 
>>     Test will use multicast group: /ff01:0:0:0:0:0:0:1
>>     NetworkInterface.getByInetAddress(grp): null
>>     STDERR:
>>     java.net.NoRouteToHostException: No route to host: no further information
>>             at java.base/sun.nio.ch.Net.joinOrDrop6(Native Method)
>>             at java.base/sun.nio.ch.Net.join6(Net.java:734)
>>             at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1515)
>>             at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
>>             at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
>>             at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:479)
>>             at java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:318)
>>             at SetLoopbackMode.main(SetLoopbackMode.java:132)
>>             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>>             at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>             at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>>             at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>>             at java.base/java.lang.Thread.run(Thread.java:831)
>> 
>>     JavaTest Message: Test threw exception: java.net.NoRouteToHostException: No route to host: no further information
>>     JavaTest Message: shutting down test
>> 
>>     STATUS:Failed.`main' threw exception: java.net.NoRouteToHostException: No route to host: no further information
>>     
>> Cause looks similar to `MulticastAddresses`: virtualbox network interface:
>> Test: /ff01:0:0:0:0:0:0:1  ni: name:eth10 (VirtualBox Host-Only Ethernet Adapter)
>>     joinGroup(InetAddress) Failed: No route to host: no further information
>> Will investigate futher.
>
> ## java/nio/file/Files/CopyAndMove.java    
>     
>     make test TEST="jtreg:java/nio/file/Files/CopyAndMove.java"
>     
>     STDOUT:
>     Seed from RandomFactory = 704532001916725417L
>     STDERR:
>     dir1: f:\projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_nio_file_Files_CopyAndMove_java\tmp\name9678927043623070601 (NTFS)
>     dir2: .\name1900089232270637553 (NTFS)
>     java.lang.RuntimeException: AtomicMoveNotSupportedException expected
>             at CopyAndMove.testMove(CopyAndMove.java:369)
>             at CopyAndMove.main(CopyAndMove.java:74)
>             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
>             at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>             at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>             at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>             at java.base/java.lang.Thread.run(Thread.java:831)
> 
>     JavaTest Message: Test threw exception: java.lang.RuntimeException: AtomicMoveNotSupportedException expected
>     JavaTest Message: shutting down test
> 
>     STATUS:Failed.`main' threw exception: java.lang.RuntimeException: AtomicMoveNotSupportedException expected
> 
> Checked in debugger:
> 
>     Files.getFileStore(dir1) = {WindowsFileStore at 1211} "ssd (f:)"
>     Files.getFileStore(dir2) = {WindowsFileStore at 1213} "ssd (F:)"
>     sameDevice = false
> 
> https://bugs.openjdk.java.net/browse/JDK-8219644 looks like there is already known bug this test.

## java/security/AccessController/DoPrivAccompliceTest.java

    make test TEST="jtreg:java/security/AccessController/DoPrivAccompliceTest.java"

    STDOUT:
    Adding DoPrivAccomplice.class to F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar

    Created jar file F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar
    Adding DoPrivTest.class to F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar

    Created jar file F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar
    Created policy for F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar
    Command line: [f:\projects\official_openjdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe -cp F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\classes\0\java\security\AccessController\DoPrivAccompliceTest.d;F:\Projects\official_openjdk\test\jdk\java\security\AccessController;F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\classes\0\test\lib;F:\Projects\official_openjdk\test\lib;C:\Programs\jtreg-4.2.0-tip\jtreg\lib\javatest.jar;C:\Programs\jtreg-4.2.0-tip\jtreg\lib\jtreg.jar -Xmx512m -XX:MaxRAMPercentage=6 -Djava.io.tmpdir=f:\projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\tmp -ea -esa -Djava.security.manager -Djava.security.policy=F:\Projects\official_openjdk\build\win
 dows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\java.policy -classpath F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar;F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar DoPrivTest ]
    [2021-02-12T21:42:29.297091800Z] Gathering output for process 12712
    [2021-02-12T21:42:29.544092Z] Waiting for completion for process 12712
    [2021-02-12T21:42:29.544092Z] Waiting for completion finished for process 12712
    Output and diagnostic info for process 12712 was saved into 'pid-12712-output.log'
    [2021-02-12T21:42:29.547092500Z] Waiting for completion for process 12712
    [2021-02-12T21:42:29.547092500Z] Waiting for completion finished for process 12712
    Created policy for F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar
    Command line: [f:\projects\official_openjdk\build\windows-x86_64-server-release\images\jdk\bin\java.exe -cp F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\classes\0\java\security\AccessController\DoPrivAccompliceTest.d;F:\Projects\official_openjdk\test\jdk\java\security\AccessController;F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\classes\0\test\lib;F:\Projects\official_openjdk\test\lib;C:\Programs\jtreg-4.2.0-tip\jtreg\lib\javatest.jar;C:\Programs\jtreg-4.2.0-tip\jtreg\lib\jtreg.jar -Xmx512m -XX:MaxRAMPercentage=6 -Djava.io.tmpdir=f:\projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\tmp -ea -esa -Djava.security.manager -Djava.security.policy=F:\Projects\official_openjdk\build\win
 dows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\java.policy -classpath F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivAccomplice.jar;F:\Projects\official_openjdk\build\windows-x86_64-server-release\test-support\jtreg_test_jdk_java_security_AccessController_DoPrivAccompliceTest_java\scratch\0.\DoPrivTest.jar DoPrivTest ]
    [2021-02-12T21:42:29.553092400Z] Gathering output for process 10560
    [2021-02-12T21:42:29.783092500Z] Waiting for completion for process 10560
    [2021-02-12T21:42:29.783092500Z] Waiting for completion finished for process 10560
    Output and diagnostic info for process 10560 was saved into 'pid-10560-output.log'
    [2021-02-12T21:42:29.785092800Z] Waiting for completion for process 10560
    [2021-02-12T21:42:29.785092800Z] Waiting for completion finished for process 10560
    [2021-02-12T21:42:29.785092800Z] Waiting for completion for process 10560
    [2021-02-12T21:42:29.785092800Z] Waiting for completion finished for process 10560
    STDERR:
     stdout: [];
     stderr: [Exception in thread "main" java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.name" "read")
            at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
            at java.base/java.security.AccessController.checkPermission(AccessController.java:1036)
            at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:408)
            at java.base/java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1152)
            at java.base/java.lang.System.getProperty(System.java:833)
            at DoPrivAccomplice.lambda$go$0(DoPrivAccomplice.java:31)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
            at DoPrivAccomplice.go(DoPrivAccomplice.java:30)
            at DoPrivTest.main(DoPrivTest.java:29)
    ]
     exitValue = 1

    java.lang.RuntimeException: 'user' found in stderr

            at jdk.test.lib.process.OutputAnalyzer.shouldNotContain(OutputAnalyzer.java:256)
            at DoPrivAccompliceTest.main(DoPrivAccompliceTest.java:112)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:566)
            at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
            at java.base/java.lang.Thread.run(Thread.java:831)

    JavaTest Message: Test threw exception: java.lang.RuntimeException: 'user' found in stderr

    JavaTest Message: shutting down test

    STATUS:Failed.`main' threw exception: java.lang.RuntimeException: 'user' found in stderr
    
Looks like test is not ready for username `user`, which I use locally.

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

PR: https://git.openjdk.java.net/jdk/pull/1853



More information about the security-dev mailing list