From 33cd720db671c1b8ed98d54926219222152d29c5 Mon Sep 17 00:00:00 2001 From: Andrew Davies Date: Tue, 22 Jan 2019 10:49:17 -0800 Subject: [PATCH] [frdp] Adds paths for `find` and `ls` for Fuchsia execution. (#26680) Adds full path for `find` and `ls` commands. --- .../lib/src/fuchsia_remote_connection.dart | 7 ++++--- .../test/fuchsia_remote_connection_test.dart | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart index 91a8a0349f..1965752ac4 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart @@ -523,14 +523,15 @@ class FuchsiaRemoteConnection { /// found. An exception is thrown in the event of an actual error when /// attempting to acquire the ports. Future> getDeviceServicePorts() async { - final List portPaths = - await _sshCommandRunner.run('find /hub -name vmservice-port'); + final List portPaths = await _sshCommandRunner + .run('/system/bin/find /hub -name vmservice-port'); final List ports = []; for (String path in portPaths) { if (path == '') { continue; } - final List lsOutput = await _sshCommandRunner.run('ls $path'); + final List lsOutput = + await _sshCommandRunner.run('/system/bin/ls $path'); for (String line in lsOutput) { if (line == '') { continue; diff --git a/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart b/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart index 1d13e077d1..c7444af698 100644 --- a/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart +++ b/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart @@ -21,10 +21,12 @@ void main() { setUp(() { mockRunner = MockSshCommandRunner(); // Adds some extra junk to make sure the strings will be cleaned up. - when(mockRunner.run(argThat(startsWith('find')))).thenAnswer((_) => - Future>.value(['/hub/blah/blah/blah/vmservice-port\n'])); - when(mockRunner.run(argThat(startsWith('ls')))).thenAnswer((_) => - Future>.value(['123\n\n\n', '456 ', '789'])); + when(mockRunner.run(argThat(startsWith('/system/bin/find')))).thenAnswer( + (_) => Future>.value( + ['/hub/blah/blah/blah/vmservice-port\n'])); + when(mockRunner.run(argThat(startsWith('/system/bin/ls')))).thenAnswer( + (_) => Future>.value( + ['123\n\n\n', '456 ', '789'])); const String address = 'fe80::8eae:4cff:fef4:9247'; const String interface = 'eno1'; when(mockRunner.address).thenReturn(address);