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

Add tests for multiple root key rotation #930

Merged

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Oct 7, 2019

Fixes issue #:
Add tests for bugfix provided by #885.

Description of the changes being introduced by the pull request:

  • Add two ed25519 key pairs for updater root key rotation tests
  • Add two root key rotation tests

See commit messages for more details.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

This commit also updates the key loader helper in
test_updater_root_rotation_integration.py to load
the new keys too.

The keys were created (at the root of the repository) like
so:

```
from tuf import repository_tool
repository_tool.generate_and_write_ed25519_keypair(
    "tests/repository_data/keystore/root_key2", "password")
repository_tool.generate_and_write_ed25519_keypair(
    "tests/repository_data/keystore/root_key3", "password")

```

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Test that a client whose root is outdated by multiple versions and
who has none of the latest nor next-to-latest root keys can still
update and does so by incrementally verifying all roots until the
most recent one.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Test that client does not rotate beyond a configured upper bound,
i.e. `current_version + MAX_NUMBER_ROOT_ROTATIONS`

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@lukpueh
Copy link
Member Author

lukpueh commented Oct 7, 2019

@trishankatdatadog, would you mind giving me a LGTM on these tests that I added for the bug fix you provided in #885?

Copy link
Member

@trishankatdatadog trishankatdatadog left a comment

Choose a reason for hiding this comment

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

LGTM, @lukpueh, thanks very much!

Have you tested this PR on both my branch (should ✅), and master (should ❌)?

tests/test_updater_root_rotation_integration.py Outdated Show resolved Hide resolved
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Co-Authored-By: Trishank K Kuppusamy <33133073+trishankatdatadog@users.noreply.github.com>
@lukpueh
Copy link
Member Author

lukpueh commented Oct 8, 2019

Have you tested this PR on both my branch (should ✅), and master (should ❌)?

Yes I did, and yes it did! :)

Thanks for catching the comment mistake. Will merge once the tests ran through.

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.

2 participants