Unverified Commit ea4cffde authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[fuchsia] Fix paths to find and ls (#28280)

parent b7711d0f
...@@ -526,14 +526,14 @@ class FuchsiaRemoteConnection { ...@@ -526,14 +526,14 @@ class FuchsiaRemoteConnection {
/// attempting to acquire the ports. /// attempting to acquire the ports.
Future<List<int>> getDeviceServicePorts() async { Future<List<int>> getDeviceServicePorts() async {
final List<String> portPaths = await _sshCommandRunner final List<String> portPaths = await _sshCommandRunner
.run('/system/bin/find /hub -name vmservice-port'); .run('/bin/find /hub -name vmservice-port');
final List<int> ports = <int>[]; final List<int> ports = <int>[];
for (String path in portPaths) { for (String path in portPaths) {
if (path == '') { if (path == '') {
continue; continue;
} }
final List<String> lsOutput = final List<String> lsOutput =
await _sshCommandRunner.run('/system/bin/ls $path'); await _sshCommandRunner.run('/bin/ls $path');
for (String line in lsOutput) { for (String line in lsOutput) {
if (line == '') { if (line == '') {
continue; continue;
......
...@@ -21,10 +21,10 @@ void main() { ...@@ -21,10 +21,10 @@ void main() {
setUp(() { setUp(() {
mockRunner = MockSshCommandRunner(); mockRunner = MockSshCommandRunner();
// Adds some extra junk to make sure the strings will be cleaned up. // Adds some extra junk to make sure the strings will be cleaned up.
when(mockRunner.run(argThat(startsWith('/system/bin/find')))).thenAnswer( when(mockRunner.run(argThat(startsWith('/bin/find')))).thenAnswer(
(_) => Future<List<String>>.value( (_) => Future<List<String>>.value(
<String>['/hub/blah/blah/blah/vmservice-port\n'])); <String>['/hub/blah/blah/blah/vmservice-port\n']));
when(mockRunner.run(argThat(startsWith('/system/bin/ls')))).thenAnswer( when(mockRunner.run(argThat(startsWith('/bin/ls')))).thenAnswer(
(_) => Future<List<String>>.value( (_) => Future<List<String>>.value(
<String>['123\n\n\n', '456 ', '789'])); <String>['123\n\n\n', '456 ', '789']));
const String address = 'fe80::8eae:4cff:fef4:9247'; const String address = 'fe80::8eae:4cff:fef4:9247';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment