Update test descriptors, and work out how to keep them updated
Tor's unit tests contain a bunch of test descriptors: router descriptors, extrainfo descriptors, votes, and onion service descriptors.
But these descriptors go out of date over time, because we don't keep them updated.
For example, EX_EI_MAXIMAL in src/test/example_extrainfo.inc is no longer maximal, because we added PaddingStatistics (and maybe other statistics).
Ideally, we need:
- tests for the oldest supported minimal and maximal descriptors
- tests for significant changes in the minimal and maximal descriptors
- tests for the current version's minimal and maximal descriptors
- a test that fails if we forget to update the test descriptors for a new feature
We could implement 1 & 2 by storing minimal and maximal descriptors from each supported Tor version. We could test 3 by generating and parsing the descriptors as part of the test, and 4 by checking for new fields in the generated descriptor, that are missing from the latest stored descriptor.
Maybe we also want a test that old versions can parse newer descriptors?
We could store an archive of supported descriptors, and test it against every supported Tor version using CI and a (Travis) cron job.