Unverified Commit 33cd720d authored by Andrew Davies's avatar Andrew Davies Committed by GitHub

[frdp] Adds paths for `find` and `ls` for Fuchsia execution. (#26680)

Adds full path for `find` and `ls` commands.
parent f777db2b
......@@ -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<List<int>> getDeviceServicePorts() async {
final List<String> portPaths =
await _sshCommandRunner.run('find /hub -name vmservice-port');
final List<String> portPaths = await _sshCommandRunner
.run('/system/bin/find /hub -name vmservice-port');
final List<int> ports = <int>[];
for (String path in portPaths) {
if (path == '') {
continue;
}
final List<String> lsOutput = await _sshCommandRunner.run('ls $path');
final List<String> lsOutput =
await _sshCommandRunner.run('/system/bin/ls $path');
for (String line in lsOutput) {
if (line == '') {
continue;
......
......@@ -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<List<String>>.value(<String>['/hub/blah/blah/blah/vmservice-port\n']));
when(mockRunner.run(argThat(startsWith('ls')))).thenAnswer((_) =>
Future<List<String>>.value(<String>['123\n\n\n', '456 ', '789']));
when(mockRunner.run(argThat(startsWith('/system/bin/find')))).thenAnswer(
(_) => Future<List<String>>.value(
<String>['/hub/blah/blah/blah/vmservice-port\n']));
when(mockRunner.run(argThat(startsWith('/system/bin/ls')))).thenAnswer(
(_) => Future<List<String>>.value(
<String>['123\n\n\n', '456 ', '789']));
const String address = 'fe80::8eae:4cff:fef4:9247';
const String interface = 'eno1';
when(mockRunner.address).thenReturn(address);
......
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