Skip to content

Commit

Permalink
8290687: serviceability/sa/TestClassDump.java could leave files owned…
Browse files Browse the repository at this point in the history
… by root on macOS

Backport-of: 59d85bad348f7787533ff38942dab2811c4eb623
  • Loading branch information
GoeLin committed Oct 4, 2022
1 parent 00cab3f commit 8b83fa0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/hotspot/jtreg/serviceability/sa/TestClassDump.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -30,6 +30,7 @@
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.SA.SATestUtils;
import jtreg.SkippedException;

/**
* @test
Expand Down Expand Up @@ -87,6 +88,10 @@ private static void dumpClass(long lingeredAppPid)

public static void main(String[] args) throws Exception {
SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
if (SATestUtils.needsPrivileges()) {
// This test will create files as root that cannot be easily deleted, so don't run.
throw new SkippedException("Cannot run this test on OSX if adding privileges is required.");
}
LingeredApp theApp = null;
try {
theApp = LingeredApp.startApp();
Expand Down

1 comment on commit 8b83fa0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.