8359735: [Ubuntu 25.10] java/lang/ProcessBuilder/Basic.java, java/lang/ProcessHandle/InfoTest.java fail due to rust-coreutils

Reviewed-by: rriggs
This commit is contained in:
Vladimir Petko 2025-06-20 13:51:55 +00:00 committed by SendaoYan
parent ff54a6493a
commit c6ab63d306
2 changed files with 9 additions and 7 deletions

View File

@ -696,7 +696,7 @@ public class Basic {
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 @@ public class Basic {
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");

View File

@ -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 class InfoTest {
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);