mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 18:21:14 +00:00
Merge pull request #131 from ep1cman/master
SysfsExtractor & Busybox fixes
This commit is contained in:
commit
9ee1666a76
Binary file not shown.
Binary file not shown.
@ -151,16 +151,18 @@ class SysfsExtractor(Instrument):
|
|||||||
def update_result(self, context):
|
def update_result(self, context):
|
||||||
if self.use_tmpfs:
|
if self.use_tmpfs:
|
||||||
on_device_tarball = self.device.path.join(self.device.working_directory, self.tarname)
|
on_device_tarball = self.device.path.join(self.device.working_directory, self.tarname)
|
||||||
on_host_tarball = self.device.path.join(context.output_directory, self.tarname)
|
on_host_tarball = self.device.path.join(context.output_directory, self.tarname + ".gz")
|
||||||
self.device.execute('{} tar czf {} -C {} .'.format(self.device.busybox,
|
self.device.execute('{} tar cf {} -C {} .'.format(self.device.busybox,
|
||||||
on_device_tarball,
|
on_device_tarball,
|
||||||
self.tmpfs_mount_point),
|
self.tmpfs_mount_point),
|
||||||
as_root=True)
|
as_root=True)
|
||||||
self.device.execute('chmod 0777 {}'.format(on_device_tarball), as_root=True)
|
self.device.execute('chmod 0777 {}'.format(on_device_tarball), as_root=True)
|
||||||
self.device.pull_file(on_device_tarball, on_host_tarball)
|
self.device.execute('{} gzip {}'.format(self.device.busybox,
|
||||||
|
on_device_tarball))
|
||||||
|
self.device.pull_file(on_device_tarball + ".gz", on_host_tarball)
|
||||||
with tarfile.open(on_host_tarball, 'r:gz') as tf:
|
with tarfile.open(on_host_tarball, 'r:gz') as tf:
|
||||||
tf.extractall(context.output_directory)
|
tf.extractall(context.output_directory)
|
||||||
self.device.delete_file(on_device_tarball)
|
self.device.delete_file(on_device_tarball + ".gz")
|
||||||
os.remove(on_host_tarball)
|
os.remove(on_host_tarball)
|
||||||
|
|
||||||
for paths in self.device_and_host_paths:
|
for paths in self.device_and_host_paths:
|
||||||
@ -386,4 +388,3 @@ def _diff_sysfs_dirs(before, after, result): # pylint: disable=R0914
|
|||||||
else:
|
else:
|
||||||
dchunks = [diff_tokens(b, a) for b, a in zip(bchunks, achunks)]
|
dchunks = [diff_tokens(b, a) for b, a in zip(bchunks, achunks)]
|
||||||
dfh.write(''.join(dchunks))
|
dfh.write(''.join(dchunks))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user