Draft: Add tests for EUCC #638
Conversation
tkachyna
commented
Apr 22, 2026
- adding tests for EUCC sample, dataset
- draft atm
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #638 +/- ##
===========================================
- Coverage 70.67% 59.32% -11.35%
===========================================
Files 78 78
Lines 9358 9374 +16
===========================================
- Hits 6613 5560 -1053
- Misses 2745 3814 +1069 ☔ View full report in Codecov by Sentry. |
7674198 to
67a7615
Compare
| DE: | ||
| - "BSI[-_]DSZ[-_]CC[-_](?:(?P<s>S)[-_])?(?P<counter>[0-9]{3,5})[-_]?(?:(?P<version>[vV][0-9])[-_])?(?P<year>[0-9]{4})?(?:[-_](?P<doc>(?:RA|MA)(?:[-_][0-9]+)?))?" | ||
| - "EUCC-3087-(?P<year>[0-9]{4})-(?P<month>[0-9]{2})-(?P<counter>[0-9]{2,4})" | ||
| - "^EUCC-3087-.*" |
There was a problem hiding this comment.
Can we be more specific here or no? Keeping the metadata parse-able at least for the IDs that follow the structure would be nice.
There was a problem hiding this comment.
Well the structure of some IDs has already changed for the third time or the length of each segment (number of digits) differs a bit, and then it is exhausting to change it every time.
There was a problem hiding this comment.
And how does the structure look right now?
jborsky
left a comment
There was a problem hiding this comment.
Do you consider these tests final, or do you plan to add more?
I'd at least add some tests for extracting URLs from the RSS feed, using some local template fixtures. This part doesnt have any coverage now.
Also, I'd consider including other tests similar to those in CC or FIPS for consistency, e.g., testing the serialization of the certs or the dataset. For this, you should also add schemas for the dataset and certificates.
| response = requests.get(constants.EUCC_RSS_URL, timeout=10) | ||
| response.raise_for_status() | ||
| except requests.RequestException as e: | ||
| print(f"Error fetching RSS feed: {e}") |
There was a problem hiding this comment.
Using print() is inconsistent with the rest of the codebase that uses logging
| try: | ||
| root = ET.fromstring(response.content) | ||
| except ET.ParseError as e: | ||
| print(f"Error parsing XML content: {e}") |
There was a problem hiding this comment.
Same issue with print as above
| "cc_version": "CC:2022", | ||
| "cem_version": "CC:2022", | ||
| "ava_van_level": "Global: 5, SubTSF: 6", | ||
| "package": {"EAL5": ["ADV_IMP.2", |
| "modification_or_reassurance": "N/A", | ||
| "issuance_date_full": "'19/12/2025'", | ||
| "validity_period_years": "5 years", | ||
| "product_description": "The TOE provides a real 16-bit CPU-architecture and is compatible to the Intel 80251 architecture. The major components of the core system are the two CPUs (Central Processing Units), the MMU (Memory Management Unit), and the MED (Memory Encryption/Decryption Unit). The dual interface controller is able to communicate using either the contact based or the contactless interface. This TOE is intended to be used in smart cards for particular security relevant applications and as a developing platform for smart card operating systems.1", |
| DE: | ||
| - "BSI[-_]DSZ[-_]CC[-_](?:(?P<s>S)[-_])?(?P<counter>[0-9]{3,5})[-_]?(?:(?P<version>[vV][0-9])[-_])?(?P<year>[0-9]{4})?(?:[-_](?P<doc>(?:RA|MA)(?:[-_][0-9]+)?))?" | ||
| - "EUCC-3087-(?P<year>[0-9]{4})-(?P<month>[0-9]{2})-(?P<counter>[0-9]{2,4})" | ||
| - "^EUCC-3087-.*" |
There was a problem hiding this comment.
And how does the structure look right now?
| "holder_name": "Infineon Technologies AG", | ||
| "holder_address": "Am Campeon 1-15 85579 Neubiberg", | ||
| "holder_contact": "psirt infineon [dot] com ( psirt[at]infineon[dot]com )", | ||
| "holder_website": "https://www.infineon.com/product-information/cybersecurity-information'/product/combicao/", |
There was a problem hiding this comment.
Why is there the '/product/combicao in the link? Is this on purpose to test if the extraction will omit it?