| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
Use CONF_CHANGED instead of BW events, they arrive much quicker and
don't require us to wait so long. Execution time for the controller
tests go from 1m25.348s to 0m6.053s when selecting all connection
configurations.
|
| | |
|
| |
|
|
| |
Library Yawning is working on for controllers in Go.
|
| |
|
|
| |
Checked with Karsten on #15276.
|
| |
|
|
|
|
| |
Adding support for the new extrainfo descriptor stats for hidden services...
https://gitweb.torproject.org/torspec.git/commit/?id=ddb630d
|
| |
|
|
| |
Issue caught by DonnchaC.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Despite having a notion of a 'daemon thread', python's behavior around it is
remarkably poor. The point of a daemon is that it can be safely reaped during
interpreter shutdown, but if one *actually* exists python screams like you're
kicking it on the balls.
*sigh*
So anyway, it's important to be sure all threads are joined on before shutting
down. Generally Stem is good about this but forgot that state change
notifications spawn their own untracked daemons.
As a result if you've registered any state listeners you'll have a good chance
of a stacktrace. What happens is as follows...
* You call close() on the controller.
* Closing sends a notification in a new thread to your listener to say that
it's closing.
* Before that thread finishes the interpreter shuts down and wails like a
baby.
As such, we now track these daemons and close() joins on them before returning.
This was caught thanks to frequent arm stacktraces like...
Exception in thread Closed notification (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 504, in run
File "/home/atagar/Desktop/seth/seth/header_panel.py", line 372, in reset_listener
File "/home/atagar/Desktop/seth/seth/header_panel.py", line 376, in _update
File "/home/atagar/Desktop/seth/seth/header_panel.py", line 403, in get_sampling
File "/home/atagar/Desktop/seth/stem/control.py", line 392, in wrapped
File "/home/atagar/Desktop/seth/stem/control.py", line 1445, in get_pid
File "/home/atagar/Desktop/seth/stem/util/system.py", line 328, in pid_by_name
File "/home/atagar/Desktop/seth/stem/util/system.py", line 930, in call
File "/usr/lib/python2.7/subprocess.py", line 754, in communicate
File "/usr/lib/python2.7/subprocess.py", line 1312, in _communicate
File "/usr/lib/python2.7/subprocess.py", line 1373, in _communicate_with_poll
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'POLLOUT'
|
| |
|
|
|
|
| |
Usually I don't had support before an event is in tor, but HS_DESC_CONTENT is
tantalizingly close and I want to help #14847 along. This helped highlight a
couple issues we should address.
|
| |
|
|
|
| |
As per #14994 tor's handling of '--quiet' changed, breaking an integ test. Also
it now provides content on stderr so suppressing that.
|
| |
|
|
|
|
|
| |
Oops, another spot where we need to do slice rather than indexing (since the
later provides an int in python3). Caught by cyberpunks on...
https://trac.torproject.org/projects/tor/ticket/15004#comment:18
|
| |
|
|
|
|
|
|
|
|
|
| |
Didn't have pycrypto for python3 so this test was being skipped for me. There
were two issues...
* we need to normalize the cookie to be bytes
* indexing into bytes provides an int in python3, so we need to use an
equivalent slice instead
Caught by toralf (on irc) and cypherpunks (on #15004).
|
| |
|
|
|
|
| |
This is a pattern I like that we used for our interpreter. Our run_tests.py was
getting a bit long, and this is funtionality that really does belong in its own
file.
|
| | |
|
| |
|
|
|
| |
Supporting basic and stealth auth for hidden service descriptor
introduction-points. Based on donncha's example script on #15004.
|
| |
|
|
|
|
|
|
| |
Nathan Willis wrote a very nice description of Stem's 1.3 release. Lets point
visitors their way!
This also includes release dates with the version number. Looks a tad batter
this way.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Support for the newly added pacakge field...
https://gitweb.torproject.org/torspec.git/commit/?id=ab6453476066fd1bf5c8cb577863c0cdd5079e0f
These don't appear to be in the actual consensus yet, but likely will soon. I
still have some questions about this field but this parsing apprach should work
for now.
https://trac.torproject.org/projects/tor/ticket/15157
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our run_tests.py's '--test' argument can now be giving a single test to just
run that. For example...
./run_tests.py --unit --test test.unit.util.conf.test_parse_enum_csv -v
The 'test.unit.' or 'test.integ.' prefix is optional. Initial patch thanks to
civ!
https://trac.torproject.org/projects/tor/ticket/14944
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Initially I planned for _get_tests() to detect if the test exists, but on
reflection it's better if we surface it in our output...
util.conf.test_parse_enum_csvv... no such test
This way the user will be informed of the error.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Oops! Didn't catch that the test modules include the class. For example...
test.unit.util.conf.TestConf.test_parse_enum_csv
civ's original patch did, though he surfaced it in our output which caused our
test names to be a lot longer. Changing us back so we hide it.
|
| | |
| |
| |
| |
| | |
We can just return prematurely. No need to hide everything else behind a
conditional.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our module_prefixes fall into two camps...
* It's... well, a module prefix. It'll be a prefix of our import name.
* It's an exact match for a test. Our import name will be a prefix of it.
No need to strip off the last component and try again. We can do this in one
pass. One thing I noticed though is that we don't check to see if tests exist.
We rely on a try/catch for that. Might be able to wrap it into this helper -
we'll see.
|
| | |
| |
| |
| |
| |
| | |
With the new behavior it's effectively doing a prefix check rather than
substring (since it adds 'test.unit.' or 'test.integ.'). This is fine. Just
renaming things to be accurate.
|
| |/ |
|
| |
|
|
|
|
|
| |
Task to ensure we don't test against bytecode for deleted or renamed files.
Initial patch thanks to dumindux.
https://trac.torproject.org/projects/tor/ticket/14628
|
| | |
|
| |
|
|
|
| |
These are internal constants for parsing. They're big blobs in our generated
api docs and unhelpful.
|
| |
|
|
| |
Oops, forgot to add this new file.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Support for parsing hidden service descriptors, as defined in the rend-spec...
https://trac.torproject.org/projects/tor/ticket/15004
https://gitweb.torproject.org/torspec.git/tree/rend-spec.txt#n222
This doesn't yet support encrypted introduction-points, but otherwise is a
complete parser. Like server descriptors, this validates our signature's
integrity if pycrypto is available.
|
| | |
| |
| |
| |
| | |
Adding our new hidden service desriptors to the generated API docs, in addition
to a changelog entry and few other improvements.
|
| | |
| |
| |
| |
| | |
This is identical to how server descriptors are validated, so taking this
opportunity to tidy that up a bit in the process.
|
| | |
| |
| |
| |
| |
| |
| | |
Including examples of hidden service descriptors with encrypted
introduction-points fields from #15004. We don't yet have support for
decrypting the fields, but at least we can assert that we raise the expected
exception when it's encrypted.
|
| | |
| |
| |
| | |
Expanding its unit test coverage and few fixes for isssues it surfaced.
|
| | |
| |
| |
| |
| |
| | |
Adding a helper for generating hidden service descriptors. This is done for all
of our descriptor types, and helps us test individual fields. Presently just
checking that the minimal descriptor it generates is valid.
|
| | |
| |
| |
| | |
Clarification courtesy of #15010.
|
| | |
| |
| |
| | |
Got clarification from Nick on #15010.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a very unusual attribute in that it's a base64 encoded blob of two
subdocuments: the first optional authentication data, followed by a list of
subdocuments.
Parsing the authentication data when reading the field, but leaving the second
pass to a method since it may optionally be encrypted.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
Quick initial parser for hidden service descriptors...
https://trac.torproject.org/projects/tor/ticket/15004
Things left to do are...
* Issue tickets for some of these 'TODO' notes.
* Support the introduction-points field. It's a bit special.
* Unit tests for malformed content.
* Validate that the signature matches the descriptor content.
|
| | |
|
| | |
|
| |
|
|
| |
Adding support for the new controller attributes discussed in #14555.
|
| |
|
|
|
|
|
| |
Tor now supports providing the torrc via stdin, so taking advantage of that
when we can...
https://trac.torproject.org/projects/tor/ticket/13865
|
| |
|
|
|
|
|
| |
The feature this test exercises was added in 0.2.6.3-alpha...
https://trac.torproject.org/projects/tor/ticket/14961
https://trac.torproject.org/projects/tor/ticket/13865
|
| |
|
|
|
| |
Oops, didn't mean to bypass the catch here. Switching to getopt.GetoptError so
we'll include that in the message.
|
| |
|
|
|
|
|
|
| |
Michael points out that we leaked our DNS requests in this example. By using
PROXYTYPE_SOCKS5_HOSTNAME which was added to pycurl v7.19.5.1 on 2015-01-06
uses the socks proxy for them...
https://github.com/pycurl/pycurl/issues/206
|
| |\
| |
| |
| |
| |
| |
| |
| | |
Using decorators like @require_controller for skipping our tests rather than
helper functions. This is a perfect use case for decorators, as it lets the
test content just be focused on what it should do.
https://trac.torproject.org/projects/tor/ticket/14945
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
| |
Replacing our require_control() function with a decorator. Yay, nicer code!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Updating Faravahar's address. It's presently still listening on the old address
but ready for us to move. On a side note test I added to detect things like
this worked like a charm...
======================================================================
FAIL: test_authorities_are_up_to_date
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/atagar/Desktop/stem/test/integ/descriptor/remote.py", line 43, in test_authorities_are_up_to_date
self.fail("%s has %s %s, but we expected %s" % (auth.nickname, attr, getattr(auth, attr), getattr(stem_auth, attr)))
AssertionError: Faravahar has address 154.35.175.225, but we expected 154.35.32.5
----------------------------------------------------------------------
|