Open hayschan opened 5 months ago
Does pytest-embedded support tests that require device resets as part of the testing process
You can call dut.reset()
or dut.serial.hard_reset()
to toggle a reset.
This is particularly relevant for testing OTA updates where the device needs to reboot to apply new firmware and continue testing post-reboot.
You can refer to this test of ESP-IDF OTA example:
Thanks for the quicky reply. I'll try them out immediately.
I am currently implementing an OTA update feature for ESP32 devices, using an OTA server. This feature is crucial as it allows for remote updates and bug fixes post-deployment. The testing strategy is designed to ensure robustness in real-world scenarios, where a device must handle firmware updates seamlessly.
Test Setup Description
I have set up a CI pipeline that includes building the firmware, flashing it onto an ESP32, and conducting OTA updates through the OTA server. The ESP32 is pre-registered on the OTA server as
ota_testing_machine
with a special OTA package (v999
) assigned to simulate an update with a significantly higher version number. The sequence of the pipeline is as follows:Request for Information
Proposed Contribution
Given the complexity of implementing realistic OTA update scenarios, I have noticed the examples in the repository, like
hello_world
, may not fully represent the challenges in such applications. I propose to contribute a detailed example based on my setup to enhance the utility of pytest-embedded for developers facing similar challenges. I am eager to contribute for the repo.Additional Resources and Documentation
For context on multi-stage testing, here's how Espressif describes it for ESP-IDF: Espressif Multi-Stage Testing Guide
Your guidance will greatly enhance the effectiveness of our testing strategy and contribute to a more robust implementation of OTA updates in IoT devices.
Thank you for your support and consideration.