RFR: 8367552: JCmdTestFileSafety.java fails when ran by root user

Daniel D. Daugherty dcubed at openjdk.org
Mon Sep 15 23:35:16 UTC 2025


On Fri, 12 Sep 2025 15:30:49 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:

> I noticed this while running the test in a Docker container. The test tries to call `File.setWriteable(false)` on a directory in which it later tries to override an existing CDS archive. Since the root user is not affected by the missing write permission, the test fails consistently.
> 
> I propose to skip it if we detect that 'root' is running it, should be a trivial change.

Changes requested by dcubed (Reviewer).

test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestFileSafety.java line 145:

> 143:         }
> 144:         if (Platform.isRoot()) {
> 145:             throw new jtreg.SkippedException("Write permissions do not apply to root user");

Perhaps:

throw new jtreg.SkippedException("Test skipped when executed by root user.");

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

PR Review: https://git.openjdk.org/jdk/pull/27261#pullrequestreview-3226600884
PR Review Comment: https://git.openjdk.org/jdk/pull/27261#discussion_r2350321907


More information about the hotspot-runtime-dev mailing list