[tor-bugs] #31631 [Core Tor/Tor]: Write a test for round-trip encode/decode operations on configuration objects.

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Sep 5 00:40:58 UTC 2019


#31631: Write a test for round-trip encode/decode operations on configuration
objects.
--------------------------+------------------------------------
 Reporter:  nickm         |          Owner:  (none)
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.4.2.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:  #29211        |         Points:
 Reviewer:                |        Sponsor:  Sponsor31-can
--------------------------+------------------------------------

Comment (by teor):

 Here's what I suggest:
 1. Run chutney on master
 2. Take copies of the torrc, state, and sr_disk_state files
 3. Run them through file -> object -> file
 4. Use the output files as inputs to unit tests
 5. Make the unit tests do file -> object -> file -> object
 6. Check that both files and both objects match
 7. If the files don't match, and the differences aren't meaningful,
 either:
   * mock the functions that return variable content, or
   * exclude the variable content from the test

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


More information about the tor-bugs mailing list