From b77c85c1e1a2d48a9d7251441ec5459dcaa09fc5 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 18 Jan 2021 17:06:00 +0530 Subject: [PATCH] ttfw/IDFDUT: i) Added option to erase_flash in the IDFDUT class ii) Renamed the method dump_flush to dump_flash --- tools/ci/python_packages/ttfw_idf/IDFDUT.py | 22 ++++++++++++++----- .../panic/test_panic_util/test_panic_util.py | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/ci/python_packages/ttfw_idf/IDFDUT.py b/tools/ci/python_packages/ttfw_idf/IDFDUT.py index e7450c4474..d94f479dcd 100644 --- a/tools/ci/python_packages/ttfw_idf/IDFDUT.py +++ b/tools/ci/python_packages/ttfw_idf/IDFDUT.py @@ -334,9 +334,18 @@ class IDFDUT(DUT.SerialDUT): f.write(chr(0xFF) * size) @_uses_esptool - def dump_flush(self, esp, output_file, **kwargs): + def erase_flash(self, esp): """ - dump flush + erase the flash completely + + :return: None + """ + esp.erase_flash() + + @_uses_esptool + def dump_flash(self, esp, output_file, **kwargs): + """ + dump flash :param output_file: output file name, if relative path, will use sdk path as base path. :keyword partition: partition name, dump the partition. @@ -576,10 +585,13 @@ class IDFQEMUDUT(IDFDUT): self.qemu.expect_exact(b"(qemu)") def erase_partition(self, partition): - raise NotImplementedError("method not erase_partition not implemented") + raise NotImplementedError("method erase_partition not implemented") - def dump_flush(self, output_file, **kwargs): - raise NotImplementedError("method not dump_flush not implemented") + def erase_flash(self): + raise NotImplementedError("method erase_flash not implemented") + + def dump_flash(self, output_file, **kwargs): + raise NotImplementedError("method dump_flash not implemented") @classmethod def list_available_ports(cls): diff --git a/tools/test_apps/system/panic/test_panic_util/test_panic_util.py b/tools/test_apps/system/panic/test_panic_util/test_panic_util.py index 2c68b91475..3cc98a02f7 100644 --- a/tools/test_apps/system/panic/test_panic_util/test_panic_util.py +++ b/tools/test_apps/system/panic/test_panic_util/test_panic_util.py @@ -139,7 +139,7 @@ class PanicTestMixin(object): log_folder = self.app.get_log_folder(TEST_SUITE) coredump_file_name = os.path.join(log_folder, "coredump_data_" + self.test_name + ".bin") Utility.console_log("Writing flash binary core dump to " + coredump_file_name) - self.dump_flush(coredump_file_name, partition="coredump") + self.dump_flash(coredump_file_name, partition="coredump") output_file_name = os.path.join(log_folder, "coredump_flash_result_" + self.test_name + ".txt") self._call_espcoredump(["--core-format", "raw"], coredump_file_name, output_file_name)