-
Notifications
You must be signed in to change notification settings - Fork 278
tests: Updater key rotation tests #1607
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
Comments
So the potential issues here are:
I think I'll try to do a throwaway version of this to smoke test the second issue (also so others see what the idea is), then if it still seems reasonable we can try tweaking the test case format so it's understandable |
It's fine: https://github.com/jku/python-tuf/blob/e6911d6ae4c5630ca44b97d62a692d11737af100/tests/test_updater_key_rotations.py#L94 shows an example: the actual test is just 30 lines I think the only real issue is the test case format. |
@jku I think probably we want to add a couple of test cases for the rest of the keys, right? Also, while I was reviewing #1635 it was little hard for me to remember the placement of the arguments for |
I'll file another one, just forgot to do it (EDIT: see #1647)
yeah WFM, replace signatures with sigs and it should even fit |
This is part of #1579, we want to test the Updater in various key/signature change scenarios in a setup where:
I have been looking at existing tests (test_key_revocation_integration.py, test_root_versioning_integration.py and test_updater_root_rotation_integration.py) and I believe they all revolve around a few variables that we should be able to turn into a table testing setup where no additional code is needed for most new tests. The most interesting and complex case is root rotations (because root delegates not just to other roles but to "future root role") so I'll start there.
All root key/signature change cases can be defined by listing N sequential root states, each with
In practice a table like this should do it:
The "key rotation" test case written out would be
There is no exception listed so Updater is expected to load all the versions correctly
The "failing" test case written out would be
Updater should fail to update v2 as it's not signed by both keys as v1 requires
This is not super readable (using numbers to represent keys is admittedly a bit confusing) but similar 3-5 lines can describe quite tricky situations like threshold increases while rotating keys etc
The text was updated successfully, but these errors were encountered: