Skip to content

Draft: Add tests for EUCC #638

Open
tkachyna wants to merge 9 commits into
mainfrom
eucc-add-more-tests-for-tool
Open

Draft: Add tests for EUCC #638
tkachyna wants to merge 9 commits into
mainfrom
eucc-add-more-tests-for-tool

Conversation

@tkachyna
Copy link
Copy Markdown
Collaborator

  • adding tests for EUCC sample, dataset
  • draft atm

@tkachyna tkachyna self-assigned this Apr 22, 2026
@tkachyna tkachyna added the eucc Related to EUCC certification label Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 32.60870% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.32%. Comparing base (3792999) to head (0ce2412).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sec_certs/dataset/eucc.py 3.23% 30 Missing ⚠️
src/sec_certs/sample/eucc.py 92.86% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (3792999) and HEAD (0ce2412). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (3792999) HEAD (0ce2412)
5 1
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.
📢 Have feedback on the report? Share it here.

@tkachyna tkachyna force-pushed the eucc-add-more-tests-for-tool branch from 7674198 to 67a7615 Compare May 13, 2026 13:46
Comment thread src/sec_certs/rules.yaml
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-.*"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And how does the structure look right now?

@tkachyna tkachyna requested a review from jborsky May 20, 2026 10:04
Copy link
Copy Markdown
Collaborator

@jborsky jborsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different indentation

"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",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different indendation

Comment thread src/sec_certs/rules.yaml
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-.*"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there the '/product/combicao in the link? Is this on purpose to test if the extraction will omit it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eucc Related to EUCC certification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants