python-tuf/tests/repository_data
Martin Vrachev d3d2f57f3a Test files: bump expiration date and resign
Our newly added metadata files in the
tests/repository_data/fishy_rolenames/metadata directory have an expiry
date until "2021-10-22T11:21:56Z" and today while running the tests on
develop branch I recived this error:
ExpiredMetadataError("Metadata X expired on Fri Oct 22 11:21:56 2021")
when running the tests in tests/test_updater.py file and more precisly
the TestUpdaterRolenames.test_unusual_rolenames() test.

That's why I decided to bump the expiration date to a random time in
the future (October 22-nd 2050) and I had to resign all of the metadata
files.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2021-10-23 18:39:22 +03:00
..
client Re-generate repository and client test metadata 2020-03-11 11:35:37 +00:00
fishy_rolenames Test files: bump expiration date and resign 2021-10-23 18:39:22 +03:00
keystore Add a test for the 'ecdsa' key type 2021-06-21 16:32:49 +03:00
project Re-generate projects test metadata 2019-09-16 15:43:39 +02:00
repository Metadata API: verify_delegate: refactor 2021-07-08 20:16:42 +03:00
generate.py Adopt sslib keygen interface encryption changes 2020-11-11 10:27:56 +01:00
generate_project_data.py Remove redundant test logic 2020-05-12 22:16:38 +01:00
map.json Tests: Queue replace tmp files, OS port creation 2020-11-13 14:01:57 +02:00
README.md Update links to account for repository rename 2021-09-01 11:15:33 +01:00

Unit and integration testing

Running the tests

The unit and integration tests can be executed by invoking tox from any path under the project directory.

$ tox

Or by invoking aggregate_tests.py from the tests directory.

$ python3 aggregate_tests.py

Note: integration tests end in _integration.py.

If you wish to run a particular unit test, navigate to the tests directory and run that specific unit test. For example:

$ python3 test_updater.py

It it also possible to run the test cases of a unit test. For instance:

$ python3 -m unittest test_updater.TestMultiRepoUpdater.test_get_one_valid_targetinfo

Setup

The unit and integration tests operate on static metadata available in the repository_data directory. Before running the tests, static metadata is first copied to temporary directories and modified, as needed, by the tests.

The test modules typically spawn HTTP(S) servers that serve metadata and target files for the unit tests. The map file specifies the location of the test repositories and other properties. For specific targets and metadata provided by the tests repositories, please inspect their respective metadata.