Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TC-DA-1.2: Better error messages #35916

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/python_testing/TC_DA_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
# === END CI TEST ARGUMENTS ===

import logging
import os
import random
import re
Expand Down Expand Up @@ -383,7 +384,12 @@ async def test_TC_DA_1_2(self):
if '.der' not in filename:
continue
with open(os.path.join(cd_cert_dir, filename), 'rb') as f:
cert = x509.load_der_x509_certificate(f.read())
logging.info(f'Parsing CD signing certificate file: {filename}')
try:
cert = x509.load_der_x509_certificate(f.read())
except ValueError:
logging.info(f'File {filename} is not a valid certificate, skipping')
pass
pub = cert.public_key()
ski = x509.SubjectKeyIdentifier.from_public_key(pub).digest
certs[ski] = pub
Expand Down
Loading