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

29018: ExtraInfoStatistics fixes and unit tests #709

merged 19 commits into from Mar 26, 2019


None yet
3 participants
Copy link

teor2345 commented Feb 19, 2019

No description provided.

teor2345 added some commits Jan 8, 2019

stats: Make PaddingStatistics depend on ExtraInfoStatistics
When ExtraInfoStatistics is 0, stop including PaddingStatistics in
relay and bridge extra-info documents.

Fixes bug 29017; bugfix on
stats: Stop reporting statistics when ExtraInfoStatistics is 0
When ExtraInfoStatistics is 0, stop including bandwidth usage statistics,
GeoIPFile hashes, ServerTransportPlugin lines, and bridge statistics
by country in extra-info documents.

Fixes bug 29018; bugfix on (and earlier versions).
router: split router_build_fresh_descriptor() into static functions
Split the body of router_build_fresh_descriptor() into static functions,
by inserting function prologues and epilogues between existing sections.

Write a new body for router_build_fresh_descriptor() that calls the new
static functions.

Initial refactor with no changes to the body of the old
router_build_fresh_descriptor(), except for the split.

Preparation for testing 29017 and 20918.
router: refactor router_build_fresh_descriptor() static function inte…

Tidy the arguments and return values of these functions, and clean up their
memory management.

Preparation for testing 29017 and 20918.
router: check for NULL in router_build_fresh_descriptor() static func…

Make sure that these static functions aren't passed NULL.
If they are, log a BUG() warning, and return an error.

Preparation for testing 29017 and 20918.
router: eliminate tiny router_build_fresh_descriptor() static functions
Remove some tiny static functions called by router_build_fresh_descriptor(),
and move their code into more relevant functions.

Then, give router_update_{router,extra}info_descriptor_body identical layouts.

Preparation for testing 29017 and 20918.
router: eliminate router_update_info_send_unencrypted()
Remove router_update_info_send_unencrypted(), and move its code into the
relevant functions.

Then, re-use an options pointer.

Preparation for testing 29017 and 20918.
router: Move extrainfo signing into its own function
This refactoring improves the structure of router_build_fresh_descriptor().

Preparation for testing 29017 and 20918.
router: Document the additional config and state used to dump descrip…

Also, explicitly state when routerinfos and extra-infos are signed.
And tidy up some other comments.

Preparation for testing 29017 and 20918.
test_router: Add comment to explain mocking
Add comment in
test_router_dump_router_to_string_no_bridge_distribution_method to explain
the effect of a mocked function.
test_dir: Test rsa + ed25519 extrainfo creation and parsing
Also fix a missing mock in rsa-only parsing.
test_dir: Refactor common code out of the dir_format unit tests
* delete some obsolete code that was #if 0
* improve cleanup on failure
* make the dir_format tests more consistent with each other
* construct the descriptors using smartlist chunks

This refactor is incomplete, because removing the remaining duplicate
code would be time-consuming.

Part of 29017 and 29018.
test_dir: Test descriptor variants
* relays and bridges,
* no stats, basic stats, and all stats

Part of 29017 and 29018.

This comment has been minimized.

Copy link

coveralls commented Feb 20, 2019

Pull Request Test Coverage Report for Build 3861

  • 69 of 106 (65.09%) changed or added relevant lines in 3 files are covered.
  • 482 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.2%) to 61.993%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/feature/relay/routerkeys.c 3 5 60.0%
src/feature/relay/router.c 65 100 65.0%
Files with Coverage Reduction New Missed Lines %
src/feature/relay/routerkeys.c 2 81.16%
src/core/crypto/relay_crypto.c 5 85.0%
src/core/or/circuitlist.c 23 57.68%
src/core/or/circuitpadding.c 26 93.71%
src/core/or/circuituse.c 426 29.58%
Totals Coverage Status
Change from base Build 3824: 0.2%
Covered Lines: 45542
Relevant Lines: 73463

💛 - Coveralls

@torproject-pusher torproject-pusher merged commit 6c652ea into torproject:master Mar 26, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.