From 9fc991900056e20bb940eed243dad0c0516d497b Mon Sep 17 00:00:00 2001 From: Yunlian Jiang Date: Wed, 29 May 2013 16:29:51 -0700 Subject: crosperf: use mac address as machine id if VPD is not available. For zgb machine, the dump_vpd_log --full --stdout does not return serial number, in this case, we use mac address instead. BUG=None TEST=It get machine id for zgb Change-Id: I1058dcd2a18638533c90a40d09adcc7a6bd8a660 Reviewed-on: https://gerrit-int.chromium.org/38900 Reviewed-by: Luis Lozano Tested-by: Yunlian Jiang Commit-Queue: Yunlian Jiang --- crosperf/machine_manager.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'crosperf') diff --git a/crosperf/machine_manager.py b/crosperf/machine_manager.py index ea3f17d7..957c8304 100644 --- a/crosperf/machine_manager.py +++ b/crosperf/machine_manager.py @@ -132,8 +132,19 @@ class CrosMachine(object): machine=self.name, chromeos_root=self.chromeos_root) b = if_out.splitlines() a = [l for l in b if "Product" in l] - self.machine_id = a[0] - assert ret == 0, "Could not get machine_id from machine: %s" % self.name + if len(a): + self.machine_id = a[0] + return + command = "ifconfig" + ret, if_out, _ = ce.CrosRunCommand( + command, return_output=True, + machine=self.name, chromeos_root=self.chromeos_root) + b = if_out.splitlines() + a = [l for l in b if "HWaddr" in l] + if len(a): + self.machine_id = "_".join(a) + return + assert 0, "Could not get machine_id from machine: %s" % self.name def __str__(self): l = [] -- cgit v1.2.3