From 6aa123de1737d50a3a00124b0d1e88d226d718d7 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Thu, 14 Dec 2017 09:46:04 -0600 Subject: [PATCH] Bug 1425163 - Use cat /proc/meminfo rather than trying to pull it from device; r=bc --- .../mozbase/mozdevice/mozdevice/devicemanagerADB.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py index 99e9e9a2650a..00d9b317cf00 100644 --- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py +++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py @@ -643,11 +643,13 @@ class DeviceManagerADB(DeviceManager): if directive == "systime" or directive == "all": ret["systime"] = self.shellCheckOutput(["date"], timeout=self.short_timeout) if directive == "memtotal" or directive == "all": - meminfo = {} - for line in self.pullFile("/proc/meminfo").splitlines(): - key, value = line.split(":") - meminfo[key] = value.strip() - ret["memtotal"] = meminfo["MemTotal"] + out = self.shellCheckOutput(["cat", "/proc/meminfo"], timeout=self.short_timeout) + out = out.replace('\r\n', '\n').splitlines(True) + for line in out: + parts = line.split(":") + if len(parts) == 2 and parts[0] == "MemTotal": + ret["memtotal"] = parts[1].strip() + break if directive == "disk" or directive == "all": data = self.shellCheckOutput( ["df", "/data", "/system", "/sdcard"], timeout=self.short_timeout)