Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8324811

java/nio/file/Files/CopyMoveVariations.java fails run with non-root user and /tmp and -w JTwork are in different partitions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 23
    • core-libs
    • None
    • generic
    • linux

      java/nio/file/Files/CopyMoveVariations.java run pass with root user:

      #whoami
      root

      #jtreg -v1 -nr -w tmp-2 test/jdk/java/nio/file/Files/CopyMoveVariations.java
      Directory "tmp-2" not found: creating
      Passed: java/nio/file/Files/CopyMoveVariations.java
      Test results: passed: 1
      Results written to /home/yansendao/git/jdk/tmp-2



      java/nio/file/Files/CopyMoveVariations.java run fails with non-root user:

      > jtreg -va -nr -w tmp -J-Djavatest.maxOutputSize=1000000 test/jdk/java/nio/file/Files/CopyMoveVariations.java 2>&1 | tee CopyMoveVariations.log | grep FAILED
      FAILED CopyMoveVariations::move '[1] FILE, ---------, false, false'
      FAILED CopyMoveVariations::move '[3] FILE, ---------, true, false'
      FAILED CopyMoveVariations::move '[9] FILE, -w--w--w-, false, false'
      FAILED CopyMoveVariations::move '[11] FILE, -w--w--w-, true, false'
      FAILED CopyMoveVariations::move '[25] DIR, -w--w--w-, false, false'
      FAILED CopyMoveVariations::move '[27] DIR, -w--w--w-, true, false'


      detail fail:
      STARTED CopyMoveVariations::move '[1] FILE, ---------, false, false'
      java.nio.file.AccessDeniedException: /tmp/file2996867938559763338dat
      at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
      at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
      at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
      at java.base/sun.nio.fs.UnixFileSystem.copyFile(UnixFileSystem.java:658)
      at java.base/sun.nio.fs.UnixFileSystem.move(UnixFileSystem.java:963)
      at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:309)
      at java.base/java.nio.file.Files.move(Files.java:1437)
      at CopyMoveVariations.op(CopyMoveVariations.java:195)
      at CopyMoveVariations.move(CopyMoveVariations.java:136)


      STARTED CopyMoveVariations::move '[25] DIR, -w--w--w-, false, false'
      org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
      at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
      at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
      at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
      at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
      at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
      at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:180)
      at CopyMoveVariations.op(CopyMoveVariations.java:215)
      at CopyMoveVariations.move(CopyMoveVariations.java:136)

            syan Sendao Yan
            syan Sendao Yan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: