From c264a45ba868d9c11f705d072dd1f8c3d1ff8e60 Mon Sep 17 00:00:00 2001 From: Zdenek Behan Date: Fri, 18 Feb 2011 06:06:55 +0100 Subject: [PATCH] au_test_harness: fix a function call, add sudo in front of ifconfig Note: sudo before ifconfig is for running on distros which do not have /sbin or /usr/sbin in common user's paths, like gentoo. Change-Id: I85bd379ad059d6ecaa8c11f3167fae27987479dd BUG=5246 TEST=run cros_au_test_harness and see it not fail Review URL: http://codereview.chromium.org/6541008 --- bin/cros_au_test_harness.py | 2 +- lib/cros_build_lib.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cros_au_test_harness.py b/bin/cros_au_test_harness.py index 994476caac..e398625d93 100755 --- a/bin/cros_au_test_harness.py +++ b/bin/cros_au_test_harness.py @@ -482,7 +482,7 @@ class RealAUTest(unittest.TestCase, AUTest): def PrepareBase(self, image_path): """Auto-update to base image to prepare for test.""" - _PrepareRealBase(image_path) + self._PrepareRealBase(image_path) def _UpdateImage(self, image_path, src_image_path='', stateful_change='old', proxy_port=None, private_key_path=None): diff --git a/lib/cros_build_lib.py b/lib/cros_build_lib.py index 11fa40cac9..138bfa7db3 100644 --- a/lib/cros_build_lib.py +++ b/lib/cros_build_lib.py @@ -256,8 +256,8 @@ def GetIPAddress(device='eth0'): this method gives you a generic way to get the address so you are reachable either via a VM or remote machine on the same network. """ - ifconfig_output = RunCommand(['ifconfig', device], redirect_stdout=True, - print_cmd=False) + ifconfig_output = RunCommand(['sudo', 'ifconfig', device], + redirect_stdout=True, print_cmd=False) match = re.search('.*inet addr:(\d+\.\d+\.\d+\.\d+).*', ifconfig_output) if match: return match.group(1)