| Index: tools/telemetry/telemetry/core/forwarders/android_forwarder.py
|
| diff --git a/tools/telemetry/telemetry/core/forwarders/android_forwarder.py b/tools/telemetry/telemetry/core/forwarders/android_forwarder.py
|
| index a4c77cf92e07c48a2f85e14fd3d4f07f60ee1cc9..f5878968e65657d6639e94e4de1790dbac0c7543 100644
|
| --- a/tools/telemetry/telemetry/core/forwarders/android_forwarder.py
|
| +++ b/tools/telemetry/telemetry/core/forwarders/android_forwarder.py
|
| @@ -240,7 +240,8 @@ class AndroidRndisConfigurator(object):
|
|
|
| def _WriteProtectedFile(self, file_path, contents):
|
| subprocess.check_call(
|
| - ['sudo', 'bash', '-c', 'echo -e "%s" > %s' % (contents, file_path)])
|
| + ['/usr/bin/sudo', 'bash', '-c',
|
| + 'echo -e "%s" > %s' % (contents, file_path)])
|
|
|
| def _InstallHorndis(self):
|
| if 'HoRNDIS' in subprocess.check_output(['kextstat']):
|
| @@ -250,7 +251,7 @@ class AndroidRndisConfigurator(object):
|
| path.GetTelemetryDir(), 'bin', 'mac', 'HoRNDIS-rel5.pkg')
|
| cloud_storage.GetIfChanged(pkg_path, bucket=cloud_storage.PUBLIC_BUCKET)
|
| subprocess.check_call(
|
| - ['sudo', 'installer', '-pkg', pkg_path, '-target', '/'])
|
| + ['/usr/bin/sudo', 'installer', '-pkg', pkg_path, '-target', '/'])
|
|
|
| def _DisableRndis(self):
|
| self._device.SetProp('sys.usb.config', 'adb')
|
| @@ -397,10 +398,10 @@ doit &
|
| if 'Telemetry' not in subprocess.check_output(
|
| ['networksetup', '-listallnetworkservices']):
|
| subprocess.check_call(
|
| - ['sudo', 'networksetup',
|
| + ['/usr/bin/sudo', 'networksetup',
|
| '-createnetworkservice', 'Telemetry', host_iface])
|
| subprocess.check_call(
|
| - ['sudo', 'networksetup',
|
| + ['/usr/bin/sudo', 'networksetup',
|
| '-setmanual', 'Telemetry', '192.168.123.1', '255.255.255.0'])
|
| elif platform.GetHostPlatform().GetOSName() == 'linux':
|
| with open(self._NETWORK_INTERFACES) as f:
|
| @@ -416,8 +417,9 @@ doit &
|
| if not os.path.exists(interface_conf_file):
|
| interface_conf_dir = os.path.dirname(interface_conf_file)
|
| if not interface_conf_dir:
|
| - subprocess.call(['sudo', '/bin/mkdir', interface_conf_dir])
|
| - subprocess.call(['sudo', '/bin/chmod', '755', interface_conf_dir])
|
| + subprocess.call(['/usr/bin/sudo', '/bin/mkdir', interface_conf_dir])
|
| + subprocess.call(
|
| + ['/usr/bin/sudo', '/bin/chmod', '755', interface_conf_dir])
|
| interface_conf = '\n'.join([
|
| '# Added by Telemetry for RNDIS forwarding.',
|
| 'allow-hotplug %s' % host_iface,
|
| @@ -426,7 +428,7 @@ doit &
|
| ' netmask 255.255.255.0',
|
| ])
|
| self._WriteProtectedFile(interface_conf_file, interface_conf)
|
| - subprocess.check_call(['sudo', 'ifup', host_iface])
|
| + subprocess.check_call(['/usr/bin/sudo', 'ifup', host_iface])
|
| logging.info('Waiting for RNDIS connectivity...')
|
| util.WaitFor(HasHostAddress, 10)
|
|
|
|
|