mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
pull more stuff during run initialization
added more paths to pull by default when device.get_properties is invoked during run initialization. Also moved the LinuxDevice implementation into BaseLinuxDevice, so that AndroidDevice tires to pull the same files (on top of the Android-specific stuff).
This commit is contained in:
parent
ead0be2763
commit
b4971d76d6
@ -478,7 +478,7 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
|
||||
|
||||
def get_properties(self, context):
|
||||
"""Captures and saves the information from /system/build.prop and /proc/version"""
|
||||
props = {}
|
||||
props = super(AndroidDevice, self).get_properties(context)
|
||||
props['android_id'] = self.get_android_id()
|
||||
buildprop_file = os.path.join(context.host_working_directory, 'build.prop')
|
||||
if not os.path.isfile(buildprop_file):
|
||||
@ -486,12 +486,6 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
|
||||
self._update_build_properties(buildprop_file, props)
|
||||
context.add_run_artifact('build_properties', buildprop_file, 'export')
|
||||
|
||||
version_file = os.path.join(context.host_working_directory, 'version')
|
||||
if not os.path.isfile(version_file):
|
||||
self.pull_file('/proc/version', context.host_working_directory)
|
||||
self._update_versions(version_file, props)
|
||||
context.add_run_artifact('device_version', version_file, 'export')
|
||||
|
||||
dumpsys_window_file = os.path.join(context.host_working_directory, 'window.dumpsys')
|
||||
dumpsys_window_output = self.execute('dumpsys window')
|
||||
with open(dumpsys_window_file, 'w') as wfh:
|
||||
|
@ -72,6 +72,24 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
|
||||
be set for non-IKS device (i.e. ``scheduler != 'iks'``). If left unset for IKS devices,
|
||||
it will default to ``800000``, i.e. 800MHz.
|
||||
"""),
|
||||
Parameter('property_files', kind=list_of_strings,
|
||||
default=[
|
||||
'/etc/arch-release',
|
||||
'/etc/debian_version',
|
||||
'/etc/lsb-release',
|
||||
'/proc/config.gz',
|
||||
'/proc/cpuinfo',
|
||||
'/proc/version',
|
||||
'/proc/zconfig',
|
||||
'/sys/kernel/debug/sched_features',
|
||||
'/sys/kernel/hmp',
|
||||
],
|
||||
description='''
|
||||
A list of paths to files containing static OS properties. These will be pulled into the
|
||||
__meta directory in output for each run in order to provide information about the platfrom.
|
||||
These paths do not have to exist and will be ignored if the path is not present on a
|
||||
particular device.
|
||||
'''),
|
||||
|
||||
]
|
||||
|
||||
@ -157,6 +175,15 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
|
||||
self.busybox = 'busybox'
|
||||
self.init(context, *args, **kwargs)
|
||||
|
||||
def get_properties(self, context):
|
||||
for propfile in self.property_files:
|
||||
if not self.file_exists(propfile):
|
||||
continue
|
||||
normname = propfile.lstrip(self.path.sep).replace(self.path.sep, '.')
|
||||
outfile = os.path.join(context.host_working_directory, normname)
|
||||
self.pull_file(propfile, outfile)
|
||||
return {}
|
||||
|
||||
def get_sysfile_value(self, sysfile, kind=None):
|
||||
"""
|
||||
Get the contents of the specified sysfile.
|
||||
@ -823,14 +850,6 @@ class LinuxDevice(BaseLinuxDevice):
|
||||
'''),
|
||||
Parameter('binaries_directory', default='/usr/local/bin',
|
||||
description='Location of executable binaries on this device (must be in PATH).'),
|
||||
Parameter('property_files', kind=list_of_strings,
|
||||
default=['/proc/version', '/etc/debian_version', '/etc/lsb-release', '/etc/arch-release'],
|
||||
description='''
|
||||
A list of paths to files containing static OS properties. These will be pulled into the
|
||||
__meta directory in output for each run in order to provide information about the platfrom.
|
||||
These paths do not have to exist and will be ignored if the path is not present on a
|
||||
particular device.
|
||||
'''),
|
||||
]
|
||||
|
||||
@property
|
||||
@ -1099,12 +1118,3 @@ class LinuxDevice(BaseLinuxDevice):
|
||||
def ensure_screen_is_on(self):
|
||||
pass # TODO
|
||||
|
||||
def get_properties(self, context):
|
||||
for propfile in self.property_files:
|
||||
if not self.file_exists(propfile):
|
||||
continue
|
||||
normname = propfile.lstrip(self.path.sep).replace(self.path.sep, '.')
|
||||
outfile = os.path.join(context.host_working_directory, normname)
|
||||
self.pull_file(propfile, outfile)
|
||||
return {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user