[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #12088 [Pluggable transport]: goptlib should provide a method for querying the state location.



#12088: goptlib should provide a method for querying the state location.
-------------------------------------+------------------------------
     Reporter:  yawning              |      Owner:  dcf
         Type:  enhancement          |     Status:  needs_review
     Priority:  normal               |  Milestone:
    Component:  Pluggable transport  |    Version:
   Resolution:                       |   Keywords:  goptlib, library
Actual Points:                       |  Parent ID:
       Points:                       |
-------------------------------------+------------------------------

Comment (by dcf):

 Replying to [comment:3 yawning]:
 > Replying to [comment:2 dcf]:
 > > I think we need some tests for this new function:
 > >  1. TOR_PT_STATE_LOCATION not set.
 > >  1. Already existing directory.
 > >  1. Nonexistent directory, parent exists.
 > >  1. Nonexistent directory, parent doesn't exist.
 > >  1. Name already exists, but is an ordinary file.
 > >  1. Directory name that cannot be created (e.g., no write permission
 in parent).
 >
 > Tests 2 through 6 seem to be more like "testing os.Mkdirall()", I'll be
 happy to write such tests, but it feels a bit redundant given
 pkg/os/path_test.go tests most of those conditions.

 But that's the point of tests, right? Don't think too much about what the
 code is doing internally, just think about what its effects are supposed
 to be. obfs4's first version of GetStateLocation would not have passed all
 these tests, after all, so guarding against future refactoring changes
 seems to make sense.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12088#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs