[tor-bugs] #17076 [Tor]: Improve coverage on src/or/config.c (options_validate)

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jan 28 21:46:26 UTC 2016


#17076: Improve coverage on src/or/config.c (options_validate)
----------------------------------+------------------------------------
 Reporter:  rjunior               |          Owner:
     Type:  enhancement           |         Status:  reopened
 Priority:  Medium                |      Milestone:  Tor: 0.2.8.x-final
Component:  Tor                   |        Version:
 Severity:  Normal                |     Resolution:
 Keywords:  testing, 028-triaged  |  Actual Points:
Parent ID:                        |         Points:  small
  Sponsor:  SponsorS              |
----------------------------------+------------------------------------
Changes (by teor):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 The way these tests are implemented makes it hard to add new options.

 Testing an option requires a developer to specify a set of options that
 silence all potential warnings or rejections before the option being
 tested. Several tests count a specific number of warnings, or locate a
 warning by its position in the log.

 This means that adding new option can break existing tests. And writing
 unit tests for a new option requires significant effort.

 I suggest we revise these tests to:
 * never rely on a specific option count or log message position
   * instead, search the entire log for the message, and assert that it's
 been found somewhere in it
 * never rely on the developer to choose a set of default options that
 validate correctly
   * instead, supply a set of default options that validate correctly at
 the top of the file, and use them throughout the file, overriding
 individual options as needed

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17076#comment:29>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list