[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #7952 [Tor]: Control port method to get the exit policy
#7952: Control port method to get the exit policy
-----------------------------+------------------------------------------
Reporter: atagar | Owner:
Type: enhancement | Status: needs_review
Priority: normal | Milestone: Tor: 0.2.5.x-final
Component: Tor | Version:
Resolution: | Keywords: tor-relay easy small-feature
Actual Points: | Parent ID:
Points: |
-----------------------------+------------------------------------------
Comment (by nickm):
Replying to [comment:10 cypherpunks]:
> Can you provide a review of current practices regarding unit testing? It
seems that Tor codebase does not rely on external frameworks/libraries for
unit testing and has its own testing infrastructure.
>
> To implement unit test, do I need to create several instances of
`routerinfo_t`Âstructs, process them with
`router_dump_exit_policy_to_string()`Âand useÂ`tor_assert()`Âto see if I
am getting the correct output? Should this code be placed in
test/test_dir.c?
That sounds about right. But instead of using tor_assert, use tt_assert.
The test framework we use is "tinytest", in src/ext/tinytest* ; the
tinytest_demo.h file should explain how it works and give some idea of how
to work with it.
Creating a new test/test_policies.c might also be a good idea. Also,
there's no need to generate a full routerinfo_t here; filling in the
policies structure should be enough.
Let me know if
> Regarding IPv6 exit policies, do we need to implementÂ`GETINFO exit-
policy/ipv6`? What if torrc define both IPv4 and IPv6 exit policy entries?
Maybe we need to implementÂ`GETINFO exit-policy/ipv4`Âto get IPv4-only
entries as well. In that case,Â`GETINFO exit-policy`Âshould return all
(both IPv4 and IPv6) entries.
Yes, this all sounds quite reasonable to me.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7952#comment:11>
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