autotest(wifi): System info changes for Android
Couple of changes needed to get chaos tests running on Android DUT's:
1. The uname binary (used to get the kernel version, arch, etc) is
located at /system/bin/uname for Android/Brillo and /bin/uname for Cros
devices. So, use the path utils to figure out the exact command to be
run to make it compatible across different platforms.
2. Skip chaos_clique_utils.get_firmware_ver() for Android/Brillo
targets.
BUG=chromium:564291
TEST=`test_that -b panther chromeos3-row1-rack1-host5.cros
network_WiFi_ChaosConnectDisconnect.open` on CrosHost(veyron_minnie).
TEST=`test_that -b panther chromeos3-row1-rack1-host3.cros
network_WiFi_ChaosConnectDisconnect.open` on AdbHost(Android)
Change-Id: I0f2a4fe34eb12ba315603637be23956e91f5b258
Reviewed-on: https://chromium-review.googlesource.com/315192
Commit-Ready: Roshan Pius <rpius@chromium.org>
Tested-by: Roshan Pius <rpius@chromium.org>
Reviewed-by: Roshan Pius <rpius@chromium.org>
diff --git a/client/common_lib/hosts/base_classes.py b/client/common_lib/hosts/base_classes.py
index c66a670..90094e2 100644
--- a/client/common_lib/hosts/base_classes.py
+++ b/client/common_lib/hosts/base_classes.py
@@ -18,6 +18,7 @@
import cPickle, cStringIO, logging, os, re, time
from autotest_lib.client.common_lib import global_config, error, utils
+from autotest_lib.client.common_lib.cros import path_utils
from autotest_lib.client.common_lib.cros.graphite import autotest_stats
from autotest_lib.client.bin import partition
@@ -381,7 +382,8 @@
def get_arch(self):
""" Get the hardware architecture of the remote machine. """
- arch = self.run('/bin/uname -m').stdout.rstrip()
+ cmd_uname = path_utils.must_be_installed('/bin/uname', host=self)
+ arch = self.run('%s -m' % cmd_uname).stdout.rstrip()
if re.match(r'i\d86$', arch):
arch = 'i386'
return arch
@@ -389,7 +391,8 @@
def get_kernel_ver(self):
""" Get the kernel version of the remote machine. """
- return self.run('/bin/uname -r').stdout.rstrip()
+ cmd_uname = path_utils.must_be_installed('/bin/uname', host=self)
+ return self.run('%s -r' % cmd_uname).stdout.rstrip()
def get_cmdline(self):
diff --git a/server/cros/network/chaos_clique_utils.py b/server/cros/network/chaos_clique_utils.py
index 03538b5..bb17577 100644
--- a/server/cros/network/chaos_clique_utils.py
+++ b/server/cros/network/chaos_clique_utils.py
@@ -321,6 +321,10 @@
@returns the WiFi firmware version as a string, None if the version
cannot be found.
"""
+ # TODO(rpius): Need to find someway to get this info for Android/Brillo.
+ if host.get_os_type() != 'cros':
+ return None
+
# Firmware versions manually aggregated by installing ToT on each device
known_firmware_ver = ['Atheros', 'mwifiex', 'loaded firmware version',
'brcmf_c_preinit_dcmds']