Skip to content

test: Add DSSE test coverage for TrustedMetadataSet and Updater - #3061

Open
Sauvi72 wants to merge 1 commit into
theupdateframework:developfrom
Sauvi72:test-dsse-components
Open

Sauvi72 wants to merge 1 commit into
theupdateframework:developfrom
Sauvi72:test-dsse-components

Conversation

@Sauvi72

@Sauvi72 Sauvi72 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds test coverage for Dead Simple Signing Envelopes (DSSE / EnvelopeType.SIMPLE) across both TrustedMetadataSet and Updater, resolving #2565 and addressing the TODO in test_trusted_metadata_set.py.

Changes Made

  1. tests/test_trusted_metadata_set.py:

    • Added test_update_simple_envelope() to verify the full update cycle (root, timestamp, snapshot, targets, and delegated targets) when using EnvelopeType.SIMPLE.
    • Added tests for error handling with simple envelopes:
      • test_update_simple_envelope_expired(): verifies ExpiredMetadataError.
      • test_update_simple_envelope_untrusted_signature(): verifies UnsignedMetadataError.
      • test_update_simple_envelope_unexpected_payload_type(): verifies RepositoryError.
    • Removed the resolved TODO in test_load_from_simple_envelope.
  2. tests/test_updater_ng.py:

    • Added test_refresh_simple_envelope(): an end-to-end integration test verifying that an Updater configured with UpdaterConfig(envelope_type=EnvelopeType.SIMPLE) successfully refreshes metadata from a repository serving SimpleEnvelopes and downloads target files.

Verification

  • ruff check and ruff format: passed cleanly.
  • mypy: passed with 0 issues.
  • python -m unittest discover tests: all 213 unit tests passed.

Fixes #2565.

Add test coverage for DSSE (EnvelopeType.SIMPLE) across TrustedMetadataSet
and Updater components:

- In tests/test_trusted_metadata_set.py:
  * Add full update workflow test with EnvelopeType.SIMPLE (loading root
    from simple envelope, updating timestamp, snapshot, targets, and
    delegated targets).
  * Add error tests for expired metadata, untrusted/invalid signatures,
    and unexpected payload types in simple envelopes.
  * Resolve TODO regarding testing via trusted metadata set tests.

- In tests/test_updater_ng.py:
  * Add end-to-end integration test verifying that Updater with
    EnvelopeType.SIMPLE refreshes metadata from a repository serving
    SimpleEnvelope formats and successfully downloads target files.

Closes theupdateframework#2565

Signed-off-by: saurav kumar <krsauvi@gmail.com>
@Sauvi72
Sauvi72 requested a review from a team as a code owner November 24, 2026 19:18

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test all components with DSSE

1 participant