diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-09-15 23:07:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-09-15 23:07:53 +0000 |
commit | 6fa88cf86c73aea5f8e2c063bd8d06f27fbdff98 (patch) | |
tree | 5bd370553ff14de4867c2505d72bc7984cd9b135 | |
parent | b25de42f8da8be4db4fbc4f055810d8c6e26724a (diff) | |
parent | 5a682869b81682a19e9ba09c0419e09cb55487d6 (diff) | |
download | platform_tools_test_connectivity-6fa88cf86c73aea5f8e2c063bd8d06f27fbdff98.tar.gz platform_tools_test_connectivity-6fa88cf86c73aea5f8e2c063bd8d06f27fbdff98.tar.bz2 platform_tools_test_connectivity-6fa88cf86c73aea5f8e2c063bd8d06f27fbdff98.zip |
Merge "Add bugreport collection fuchsia_device"
-rw-r--r-- | acts/framework/acts/controllers/fuchsia_device.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/acts/framework/acts/controllers/fuchsia_device.py b/acts/framework/acts/controllers/fuchsia_device.py index 9dfffeae99..12ce3f5289 100644 --- a/acts/framework/acts/controllers/fuchsia_device.py +++ b/acts/framework/acts/controllers/fuchsia_device.py @@ -864,10 +864,23 @@ class FuchsiaDevice: acts_logger.epoch_to_log_line_timestamp(begin_time)) out_name = "FuchsiaDevice%s_%s" % ( self.serial, time_stamp.replace(" ", "_").replace(":", "-")) + bugreport_out_name = f"{out_name}.zip" out_name = "%s.txt" % out_name full_out_path = os.path.join(br_path, out_name) + full_br_out_path = os.path.join(br_path, bugreport_out_name) self.log.info("Taking bugreport for %s on FuchsiaDevice%s." % (test_name, self.serial)) + if self.ssh_config is not None: + try: + subprocess.run([ + f"ssh -F {self.ssh_config} {self.ip} bugreport > {full_br_out_path}" + ], + shell=True) + self.log.info( + "Bugreport saved at: {}".format(full_br_out_path)) + except Exception as err: + self.log.error("Failed to take bugreport with: {}".format(err)) + system_objects = self.send_command_ssh('iquery --find /hub').stdout system_objects = system_objects.split() |