test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java
changeset 59317 7089399d6ade
parent 58384 9a3a700ca571
equal deleted inserted replaced
59316:753ab8dcdbba 59317:7089399d6ade
   109             SATestUtils.unzipCores(new File("."));
   109             SATestUtils.unzipCores(new File("."));
   110             String coreFileLocation = getCoreFileLocation(crashOutputString);
   110             String coreFileLocation = getCoreFileLocation(crashOutputString);
   111             if (coreFileLocation == null) {
   111             if (coreFileLocation == null) {
   112                 if (Platform.isOSX()) {
   112                 if (Platform.isOSX()) {
   113                     File coresDir = new File("/cores");
   113                     File coresDir = new File("/cores");
   114                     if (!coresDir.isDirectory() || !coresDir.canWrite()) {
   114                     if (!coresDir.isDirectory()) {
   115                         throw new Error("cores is not a directory or does not have write permissions");
   115                         throw new Error("cores is not a directory");
       
   116                     }
       
   117                     // the /cores directory is usually not writable on macOS 10.15
       
   118                     final String osVersion = System.getProperty("os.version");
       
   119                     if (osVersion == null) {
       
   120                         throw new Error("Cannot query the 'os.version' property!");
       
   121                     }
       
   122                     if (!coresDir.canWrite()) {
       
   123                         if (osVersion.startsWith("10.15")) {
       
   124                             throw new SkippedException("/cores is not writable");
       
   125                         } else {
       
   126                             throw new Error("cores does not have write permissions");
       
   127                         }
   116                     }
   128                     }
   117                 } else if (Platform.isLinux()) {
   129                 } else if (Platform.isLinux()) {
   118                     // Check if a crash report tool is installed.
   130                     // Check if a crash report tool is installed.
   119                     File corePatternFile = new File(CORE_PATTERN_FILE_NAME);
   131                     File corePatternFile = new File(CORE_PATTERN_FILE_NAME);
   120                     Scanner scanner = new Scanner(corePatternFile);
   132                     Scanner scanner = new Scanner(corePatternFile);