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");
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");
/*
- * 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
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);