Synss / python-mbedtls

Cryptographic library with an mbed TLS back end
MIT License
79 stars 28 forks source link

test_version() test fails due to Mbed TLS spelling change #96

Closed steev closed 7 months ago

steev commented 8 months ago

I am submitting a …

Description

Unit tests fail due to Mbed TLS trademark spelling changes.

Current behavior

=================================== FAILURES ===================================
_________________________________ test_version _________________________________
    def test_version() -> None:
>       assert version.version == "mbed TLS %i.%i.%i" % version.version_info
E       AssertionError: assert 'Mbed TLS 2.28.5' == 'mbed TLS 2.28.5'
E         - mbed TLS 2.28.5
E         ? ^
E         + Mbed TLS 2.28.5
E         ? ^
tests/test_version.py:16: AssertionError
=========================== short test summary info ============================
FAILED tests/test_version.py::test_version - AssertionError: assert 'Mbed TLS 2.28.5' == 'mbed TLS 2.28.5'
  - mbed TLS 2.28.5
  ? ^
  + Mbed TLS 2.28.5
  ? ^
===== 1 failed, 2763 passed, 78 skipped, 8 deselected, 7 xfailed in 10.16s =====

You can see this in Kali's CI at https://gitlab.com/kalilinux/packages/python-mbedtls/-/jobs/5439497215

Expected behavior

Tests pass

Other information

Upstream made the changes to the spelling in https://github.com/Mbed-TLS/mbedtls/commit/f08ca83b4fe40411e5bd89aeebd8cbf3bf02b1d9 for the 2.28 lts releases and in https://github.com/Mbed-TLS/mbedtls/commit/e820c0abc82cb851f81b9fd10298f5b5f7b0d72a for development version.

In Kali packaging, I added https://gitlab.com/kalilinux/packages/python-mbedtls/-/blob/kali/master/debian/patches/Fix-version-test.patch which is a simple m->M (though I unfortunately copied and pasted the patch header and just noticed that I attributed it to Sophie. :/ )

Synss commented 8 months ago

Thank you! I'll fix that ASAP. 😊

Synss commented 7 months ago

Thank you for the heads-up! I took the opportunity to upgrade the backend to latest. It looks like I've missed quiet a few point releases this time... :(

Anyway, I've decided to make the test case insensitive instead of capitalising. It shouldn't make much of a difference.