diff --git a/test/jdk/java/lang/ProcessBuilder/Basic.java b/test/jdk/java/lang/ProcessBuilder/Basic.java index 1995e9cecd1a2..c06ecbdb871fc 100644 --- a/test/jdk/java/lang/ProcessBuilder/Basic.java +++ b/test/jdk/java/lang/ProcessBuilder/Basic.java @@ -696,7 +696,7 @@ private static class TrueExe { public static String path() { return path; } private static final String path = path0(); private static String path0(){ - if (!Platform.isBusybox("/bin/true")) { + if (!Files.isSymbolicLink(Paths.get("/bin/true"))) { return "/bin/true"; } else { File trueExe = new File("true"); @@ -711,7 +711,7 @@ private static class FalseExe { public static String path() { return path; } private static final String path = path0(); private static String path0(){ - if (!Platform.isBusybox("/bin/false")) { + if (!Files.isSymbolicLink(Paths.get("/bin/false"))) { return "/bin/false"; } else { File falseExe = new File("false"); diff --git a/test/jdk/java/lang/ProcessHandle/InfoTest.java b/test/jdk/java/lang/ProcessHandle/InfoTest.java index 66ac2df830b57..38c86db3b914f 100644 --- a/test/jdk/java/lang/ProcessHandle/InfoTest.java +++ b/test/jdk/java/lang/ProcessHandle/InfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, 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 @@ -295,10 +295,12 @@ public static void test3() { String expected = "sleep"; if (Platform.isWindows()) { expected = "sleep.exe"; - } else if (Platform.isBusybox("/bin/sleep")) { - // With busybox sleep is just a sym link to busybox. - // The busbox executable is seen as ProcessHandle.Info command. - expected = "busybox"; + } else if (Files.isSymbolicLink(Paths.get("/bin/sleep"))) { + // Busybox sleep is a symbolic link to /bin/busybox. + // Rust coreutils sleep is a symbolic link to coreutils + // The busbox/coreutils executables are seen as ProcessHandle.Info command. + Path executable = Files.readSymbolicLink(Paths.get("/bin/sleep")); + expected = executable.getFileName().toString(); } Assert.assertTrue(command.endsWith(expected), "Command: expected: \'" + expected + "\', actual: " + command);