File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -699,7 +699,7 @@ private static class TrueExe {
699699 public static String path () { return path ; }
700700 private static final String path = path0 ();
701701 private static String path0 (){
702- if (!Platform . isBusybox ( "/bin/true" )) {
702+ if (!Files . isSymbolicLink ( Paths . get ( "/bin/true" ) )) {
703703 return "/bin/true" ;
704704 } else {
705705 File trueExe = new File ("true" );
@@ -714,7 +714,7 @@ private static class FalseExe {
714714 public static String path () { return path ; }
715715 private static final String path = path0 ();
716716 private static String path0 (){
717- if (!Platform . isBusybox ( "/bin/false" )) {
717+ if (!Files . isSymbolicLink ( Paths . get ( "/bin/false" ) )) {
718718 return "/bin/false" ;
719719 } else {
720720 File falseExe = new File ("false" );
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2014, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2014, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -294,10 +294,12 @@ public static void test3() {
294294 String expected = "sleep" ;
295295 if (Platform .isWindows ()) {
296296 expected = "sleep.exe" ;
297- } else if (Platform .isBusybox ("/bin/sleep" )) {
298- // With busybox sleep is just a sym link to busybox.
299- // The busbox executable is seen as ProcessHandle.Info command.
300- expected = "busybox" ;
297+ } else if (Files .isSymbolicLink (Paths .get ("/bin/sleep" ))) {
298+ // Busybox sleep is a symbolic link to /bin/busybox.
299+ // Rust coreutils sleep is a symbolic link to coreutils
300+ // The busbox/coreutils executables are seen as ProcessHandle.Info command.
301+ Path executable = Files .readSymbolicLink (Paths .get ("/bin/sleep" ));
302+ expected = executable .getFileName ().toString ();
301303 }
302304 Assert .assertTrue (command .endsWith (expected ), "Command: expected: \' " +
303305 expected + "\' , actual: " + command );
You can’t perform that action at this time.
0 commit comments