[tor-bugs] #28430 [Core Tor/Tor]: Tests for 'extra dormant' code

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 15 14:52:58 UTC 2018


#28430: Tests for 'extra dormant' code
--------------------------+------------------------------------
 Reporter:  nickm         |          Owner:  nickm
     Type:  enhancement   |         Status:  assigned
 Priority:  Medium        |      Milestone:  Tor: 0.4.0.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:  #28335        |         Points:
 Reviewer:                |        Sponsor:  Sponsor8
--------------------------+------------------------------------

Comment (by dgoulet):

 There are probably a series of basic tests I would propose:

  1. Make sure that the "user activity" functions do what they are suppose
 to do. Very basic functions but still basic unit tests would be good.

  2. One important function for me is the one that detects to go dormant or
 not (`check_network_participation_callback()`). It can easily be tested by
 trying all code path.
    * If server, don't go dormant.
    * If HS configured, don't go dormant.
    * If one connection is open, don't go dormant.

  Because we can control the time in the test, we can test easily the
 function to "go dormant".

  3. The other part that I'm interested in testing is the "going *out* of
 the dormant state". There seems to be 3 entry points for that.
    * A change in a torrc option that makes us in a new role (becoming a
 relay or HS for instance).
    * Inbound connection like SOCKS.
    * DNS Server request through control port.

 Would be a good starting point. This value might be a problem so we could
 change it only for unit tests. Even for integration testing, this is just
 too huge to be fully tested unless we run them for days...

 {{{
 #define BECOME_DORMANT_AFTER_INACTIVITY (24*60*60)
 }}}

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


More information about the tor-bugs mailing list