espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.6k stars 1.39k forks source link

Parametrize test_espsecure.py to enable skipping unsupported signing methods (ESPTOOL-928) #1013

Open befeleme opened 1 month ago

befeleme commented 1 month ago

Operating System

Fedora Linux

Esptool Version

4.8.0

Python Version

Python 3.13.0~rc2

Full Esptool Command Line that Was Run

pytest -m host_test

Esptool Output

No response

What is the Expected Behaviour?

I want to run as much of the esptool test suite when building it for Fedora Linux, to make sure it works as expected. ecdsa192 is not supported by openSSL in Fedora Linux, hence all the tests that operate on the key fail. As tests are not parametrized, but rather loop over lists in the test bodies, I can't easily skip the ones I don't want to run. Would it be possible to parametrize the tests, e.g. with the pytest @pytest.mark.parametrize decorator?

More Information

No response

Other Steps to Reproduce

No response

radimkarnis commented 1 month ago

Hello @befeleme,

if you want to skip certain tests, you can use the -k option of pytest to select and deselect tests based on their name.

Parametrizing the tests could be a solution, but how do we decide which criteria to parameterize? Another user could later come and say that some tests can't run on his machine because of another reason.

Do you think only the schemes ("rsa3072", "ecdsa192", "ecdsa256", "ecdsa384") should be parametrized?