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

More trusted set tests #1522

Merged
merged 4 commits into from
Aug 19, 2021
Merged

Conversation

jku
Copy link
Member

@jku jku commented Aug 17, 2021

  • fixes a bug in TrustedMetadataSet
  • adds three tests to improve TrustedMetadataSet coverage
  • Fixes one broken test to also improve TrustedMetadataSet coverage

This gets us to 99% coverage (the only missing thing is successful rollback test -- IOW successfully updating a new snapshot when a snapshot is loaded already -- this requires #1498 I think)

Jussi Kukkonen added 4 commits August 17, 2021 13:54
* test for succesful root update
* fix test for snapshot version rollback in timestamp update

Signed-off-by: Jussi Kukkonen <[email protected]>
Test failing length/hash test for snapshot

Signed-off-by: Jussi Kukkonen <[email protected]>
We're unlikely to use the iterator but it's required to implement Mapping.

Signed-off-by: Jussi Kukkonen <[email protected]>
@jku jku requested a review from MVrachev August 17, 2021 14:08
@jku jku added this to the Sprint 6 milestone Aug 18, 2021
@jku jku mentioned this pull request Aug 18, 2021
2 tasks
Copy link
Collaborator

@MVrachev MVrachev left a comment

Choose a reason for hiding this comment

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

The changes are simple and make sense.
LGTM!

Comment on lines 258 to 264
def test_update_timestamp_snapshot_ver_below_current(self):
def bump_snapshot_version(timestamp: Timestamp) -> None:
timestamp.meta["snapshot.json"].version = 2

# set current known snapshot.json version to 2
timestamp = self.modify_metadata("timestamp", bump_snapshot_version)
self._root_updated_and_update_timestamp(timestamp)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see I made a mistake when writing this test and test_update_timestamp_new_timestamp_ver_below_trusted_ver test.
It must have been a mistake while rebasing.
Great catch!

@jku jku requested a review from joshuagl August 19, 2021 06:12
Copy link
Member

@joshuagl joshuagl left a comment

Choose a reason for hiding this comment

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

Nice set of test enhancements, LGTM

@joshuagl joshuagl merged commit e9106b5 into theupdateframework:develop Aug 19, 2021
@jku jku deleted the more-trusted-set-tests branch December 30, 2024 09:10
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.

3 participants