[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Only query by name for relays with the Named flag
commit 8099efdecf3d64abef787d1b19b537c4b9c30088
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Mon Mar 18 18:32:28 2013 -0700
Only query by name for relays with the Named flag
Our integ tests pick a relay at random from its present consensus to test the
'GETINFO desc/name/*', 'md/name/*', and 'ns/name/*' functions. However, this
could fail if we're querying a relay without the Named flag.
======================================================================
ERROR: test_get_microdescriptor
----------------------------------------------------------------------
Traceback:
File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 826, in test_get_microdescriptor
md_by_nickname = controller.get_microdescriptor(test_relay.nickname)
File "/home/atagar/Desktop/stem/stem/control.py", line 1001, in get_microdescriptor
raise exc
InvalidArguments: GETINFO request contained unrecognized keywords: md/name/MukiMukiAmaguri
======================================================================
ERROR: test_get_network_status
----------------------------------------------------------------------
Traceback:
File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 928, in test_get_network_status
desc_by_nickname = controller.get_network_status(test_relay.nickname)
File "/home/atagar/Desktop/stem/stem/control.py", line 1165, in get_network_status
raise exc
InvalidArguments: GETINFO request contained unrecognized keywords: ns/name/MukiMukiAmaguri
----------------------------------------------------------------------
Ran 31 tests in 11.307s
---
test/integ/control/controller.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index f35932f..6b5c407 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -22,7 +22,7 @@ import test.network
import test.runner
import test.util
-from stem import Signal
+from stem import Flag, Signal
from stem.control import EventType, State
from stem.exit_policy import ExitPolicy
from stem.version import Requirement
@@ -1010,7 +1010,7 @@ class TestController(unittest.TestCase):
if TEST_ROUTER_STATUS_ENTRY is None:
for desc in controller.get_network_statuses():
- if desc.nickname != "Unnamed":
+ if desc.nickname != "Unnamed" and Flag.NAMED in desc.flags:
TEST_ROUTER_STATUS_ENTRY = desc
break
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits