/
settings.cfg
346 lines (316 loc) · 14.9 KB
/
settings.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# Testing Configuration
#
# The following contains customizable configuration information for stem's
# testing framework.
#
# integ.test_directory
# Path used for our data directory and any temporary test resources. Relative
# paths are expanded in reference to the location of 'run_tests.py'.
#
# If set then the directory's contents are reused for future tests (so we
# have a faster startup and lower load on authorities). If set to an empty
# value then this makes a fresh data directory for each test run.
#
# integ.log
# Path runtime logs are placed. Relative paths are expanded in reference to
# 'run_tests.py'. Logging is disabled if set ot an empty value.
integ.test_directory ./test/data
exclude_paths .*/stem/test/data/.*
integ.log ./test/data/log
integ.torrc
|# Configuration for stem's integration tests
|
|SocksPort [SOCKS_PORT]
|ORPort [OR_PORT]
|
|Address 1.2.3.4
|DataDirectory [DATA_DIR]
|Log notice stdout
|Log debug file [DATA_DIR]/tor_log
|
|AssumeReachable 1
|DownloadExtraInfo 1
|ExitRelay 0
|FetchUselessDescriptors 1
|LogTimeGranularity 1
|ProtocolWarnings 1
|PublishServerDescriptor 0
|SafeLogging 0
# To append additional torrc options you can overwrite the following. For
# example...
#
# % cat /home/atagar/Desktop/stem/my_test_config
# integ.extra_torrc
# |Nickname StemTestDemo
# |FetchUselessDescriptors 1
#
# % export STEM_TEST_CONFIG=/home/atagar/Desktop/stem
integ.extra_torrc
# The following are less testing framework attributes that aren't as commonly
# reconfigured.
#
# msg.*
# Rendered text.
#
# target.*
# Attributes of the integration testing targets. This helps determine what is
# ran when the user runs with '--target'.
msg.help
|Usage run_tests.py [OPTION]
|Runs tests for the stem library.
|
| -a, --all runs unit, integ, and style checks (same as '-ui')
| -u, --unit runs unit tests
| -i, --integ runs integration tests
|
| -t, --target TARGET comma separated list of integ targets (see below)
| --tor PATH custom tor binary to run testing against
|
| -l, --log RUNLEVEL include log output with test results, runlevels are:
| TRACE, DEBUG, INFO, NOTICE, WARN, ERROR
| --log-file PATH logs to this file, otherwise logging is to stdout
|
| --test TEST_NAME only run this test or or test module
| --exclude-test TEST_NAME skip this test or test module
|
| -q, --quiet only present failures
| -v, --verbose provides additional test output
| -h, --help presents this help
|
| Examples:
|
| run_tests.py --unit --integ
| Run unit and integration tests.
|
| run_tests.py --integ --target RUN_ALL
| Run integration tests against all tor configurations.
|
| run_tests.py --integ --test test.integ.util
| Only run integration tests for the util modules.
|
| run_tests.py --unit --test interpreter.commands --exclude-test interpreter.commands.test_events --verbose
| Only run interpreter.commands tests, but skip test_events.
|
| Integration targets:
|
##################
# CATEGORY: TARGET #
##################
# The '--help' description of the target.
target.description ONLINE => Includes tests that require network activity.
target.description RELATIVE => Uses a relative path for tor's data directory.
target.description CHROOT => Simulates a chroot setup.
target.description RUN_NONE => Configuration without a way for controllers to connect.
target.description RUN_OPEN => Configuration with an open control port (default).
target.description RUN_PASSWORD => Configuration with password authentication.
target.description RUN_COOKIE => Configuration with an authentication cookie.
target.description RUN_MULTIPLE => Configuration with both password and cookie authentication.
target.description RUN_SOCKET => Configuration with a control socket.
target.description RUN_SCOOKIE => Configuration with a control socket and authentication cookie.
target.description RUN_PTRACE => Configuration with an open control port and 'DisableDebuggerAttachment 0'
target.description RUN_ALL => Runs integration tests for all connection configurations.
# Torrc configuration options included with the target. Having this option set
# means that each of these targets will have a dedicated integration test run.
target.torrc RUN_NONE =>
target.torrc RUN_OPEN => PORT
target.torrc RUN_PASSWORD => PORT, PASSWORD
target.torrc RUN_COOKIE => PORT, COOKIE
target.torrc RUN_MULTIPLE => PORT, PASSWORD, COOKIE
target.torrc RUN_SOCKET => SOCKET
target.torrc RUN_SCOOKIE => SOCKET, COOKIE
target.torrc RUN_PTRACE => PORT, PTRACE
# Pycodestyle compliance issues that we're ignoreing...
#
# * E251 no spaces around keyword / parameter equals
#
# This one I dislike a great deal. It makes keyword arguments different
# from assignments which looks... aweful. I'm not sure what Pycodestyle's
# author was on when he wrote this one but it's stupid.
#
# Someone else can change this if they really care.
#
# * E501 line is over 79 characters
#
# We're no longer on TTY terminals. Overly constraining line length makes
# things far less readable, encouraging bad practices like abbreviated
# variable names.
#
# If the code fits on my tiny netbook screen then it's narrow enough.
#
# * E111, E114, and E121 four space indentations
#
# Ahhh, indentation. The holy war that'll never die. Sticking with two
# space indentations since it leads to shorter lines.
#
# * E127 and E131 continuation line over-indented for visual indent
#
# Pycodestyle only works with this one if we have four space indents (its
# detection is based on multiples of four).
#
# * E722 do not use bare except
#
# Iirc they advise against this because it catches KeyboardInterrups and
# interpreter termination. That's a fair concern, but on the other hand we
# don't have strong assurance that socket errors and the like will be caught
# without it. We've been doing this for years without issue but I'd be
# ameanable to a patch if this causes issues for someone.
pycodestyle.ignore E111
pycodestyle.ignore E114
pycodestyle.ignore E121
pycodestyle.ignore E501
pycodestyle.ignore E251
pycodestyle.ignore E127
pycodestyle.ignore E131
pycodestyle.ignore E722
pycodestyle.ignore stem/util/ed25519.py => *
pycodestyle.ignore stem/__init__.py => E402: import stem.util.connection
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.bandwidth_file
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.extrainfo_descriptor
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.hidden_service
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.microdescriptor
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.networkstatus
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.server_descriptor
pycodestyle.ignore stem/descriptor/__init__.py => E402: import stem.descriptor.tordnsel
pycodestyle.ignore test/unit/util/connection.py => W291: _tor tor 15843 10 pipe 0x0 state:
pycodestyle.ignore test/unit/util/connection.py => W291: _tor tor 15843 11 pipe 0x0 state:
pycodestyle.ignore test/unit/util/connection.py => W291: tcp ESTAB
# False positives from pyflakes. These are mappings between the path and the
# issue.
pyflakes.ignore stem/manual.py => undefined name 'sqlite3'
pyflakes.ignore stem/client/cell.py => undefined name 'cryptography'
pyflakes.ignore stem/client/cell.py => undefined name 'hashlib'
pyflakes.ignore stem/client/datatype.py => redefinition of unused 'pop' from *
pyflakes.ignore stem/descriptor/__init__.py => undefined name 'cryptography'
pyflakes.ignore stem/descriptor/certificate.py => undefined name 'cryptography'
pyflakes.ignore stem/descriptor/hidden_service.py => undefined name 'cryptography'
pyflakes.ignore stem/interpreter/autocomplete.py => undefined name 'stem'
pyflakes.ignore stem/interpreter/help.py => undefined name 'stem'
pyflakes.ignore stem/response/events.py => undefined name 'datetime'
pyflakes.ignore stem/socket.py => redefinition of unused '_recv'*
pyflakes.ignore stem/util/__init__.py => undefined name 'cryptography'
pyflakes.ignore stem/util/conf.py => undefined name 'stem'
pyflakes.ignore stem/util/enum.py => undefined name 'stem'
pyflakes.ignore test/require.py => 'cryptography.utils.int_to_bytes' imported but unused
pyflakes.ignore test/require.py => 'cryptography.hazmat.backends.default_backend' imported but unused
pyflakes.ignore test/require.py => 'cryptography.hazmat.primitives.ciphers.algorithms' imported but unused
pyflakes.ignore test/require.py => 'cryptography.hazmat.primitives.ciphers.Cipher' imported but unused
pyflakes.ignore test/require.py => 'cryptography.hazmat.primitives.ciphers.modes' imported but unused
pyflakes.ignore test/require.py => 'cryptography.hazmat.primitives.serialization.load_der_public_key' imported but unused
pyflakes.ignore test/require.py => 'cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey' imported but unused
pyflakes.ignore test/unit/examples.py => * imported but unused
pyflakes.ignore test/unit/response/events.py => 'from stem import *' used; unable to detect undefined names
pyflakes.ignore test/unit/response/events.py => *may be undefined, or defined from star imports: stem
pyflakes.ignore test/integ/interpreter.py => 'readline' imported but unused
# Our enum class confuses mypy. Ignore this until we can change to python 3.x's
# new enum builtin.
#
# For example...
#
# See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
# Variable "stem.control.EventType" is not valid as a type [valid-type]
mypy.ignore * => "Enum" has no attribute *
mypy.ignore * => "_IntegerEnum" has no attribute *
mypy.ignore * => See https://mypy.readthedocs.io/en/latest/common_issues.html*
mypy.ignore * => *is not valid as a type*
mypy.ignore stem/descriptor/remote.py => Return type "Coroutine[Any, Any, None]" of "start" *
# Metaprogramming prevents mypy from determining descriptor attributes.
mypy.ignore * => "Descriptor" has no attribute "*
# Metaprogramming false positive for our close method.
mypy.ignore stem/control.py => Return type "Coroutine[Any, Any, None]" of "close" *
# Interpreter uses a synchronous controller, which can cause false positives.
mypy.ignore stem/interpreter/commands.py => "Coroutine[Any, Any, ControlMessage]" has no attribute "*
# Test modules we want to run. Modules are roughly ordered by the dependencies
# so the lowest level tests come first. This is because a problem in say,
# controller message parsing, will cause all higher level tests to fail too.
# Hence we want the test that most narrowly exhibits problems to come first.
test.unit_tests
|test.unit.util.enum.TestEnum
|test.unit.util.connection.TestConnection
|test.unit.util.conf.TestConf
|test.unit.util.log.TestLog
|test.unit.util.proc.TestProc
|test.unit.util.str_tools.TestStrTools
|test.unit.util.system.TestSystem
|test.unit.util.term.TestTerminal
|test.unit.util.tor_tools.TestTorTools
|test.unit.util.asyncio.TestSynchronous
|test.unit.util.__init__.TestBaseUtil
|test.unit.installation.TestInstallation
|test.unit.descriptor.descriptor.TestDescriptor
|test.unit.descriptor.compression.TestCompression
|test.unit.descriptor.collector.TestCollector
|test.unit.descriptor.remote.TestDescriptorDownloader
|test.unit.descriptor.server_descriptor.TestServerDescriptor
|test.unit.descriptor.extrainfo_descriptor.TestExtraInfoDescriptor
|test.unit.descriptor.microdescriptor.TestMicrodescriptor
|test.unit.descriptor.router_status_entry.TestRouterStatusEntry
|test.unit.descriptor.tordnsel.TestTorDNSELDescriptor
|test.unit.descriptor.networkstatus.detached_signature.TestDetachedSignature
|test.unit.descriptor.networkstatus.directory_authority.TestDirectoryAuthority
|test.unit.descriptor.networkstatus.key_certificate.TestKeyCertificate
|test.unit.descriptor.networkstatus.document_v2.TestNetworkStatusDocument
|test.unit.descriptor.networkstatus.document_v3.TestNetworkStatusDocument
|test.unit.descriptor.networkstatus.bridge_document.TestBridgeNetworkStatusDocument
|test.unit.descriptor.hidden_service_v2.TestHiddenServiceDescriptorV2
|test.unit.descriptor.hidden_service_v3.TestHiddenServiceDescriptorV3
|test.unit.descriptor.certificate.TestEd25519Certificate
|test.unit.descriptor.bandwidth_file.TestBandwidthFile
|test.unit.exit_policy.rule.TestExitPolicyRule
|test.unit.exit_policy.policy.TestExitPolicy
|test.unit.endpoint.TestEndpoint
|test.unit.version.TestVersion
|test.unit.manual.TestManual
|test.unit.directory.authority.TestAuthority
|test.unit.directory.fallback.TestFallback
|test.unit.response.add_onion.TestAddOnionResponse
|test.unit.response.control_message.TestControlMessage
|test.unit.response.control_line.TestControlLine
|test.unit.response.events.TestEvents
|test.unit.response.getinfo.TestGetInfoResponse
|test.unit.response.getconf.TestGetConfResponse
|test.unit.response.singleline.TestSingleLineResponse
|test.unit.response.authchallenge.TestAuthChallengeResponse
|test.unit.response.protocolinfo.TestProtocolInfoResponse
|test.unit.response.mapaddress.TestMapAddressResponse
|test.unit.client.size.TestSize
|test.unit.client.address.TestAddress
|test.unit.client.link_protocol.TestLinkProtocol
|test.unit.client.certificate.TestCertificate
|test.unit.client.link_specifier.TestLinkSpecifier
|test.unit.client.kdf.TestKDF
|test.unit.client.cell.TestCell
|test.unit.connection.authentication.TestAuthenticate
|test.unit.connection.connect.TestConnect
|test.unit.control.controller.TestControl
|test.unit.interpreter.arguments.TestArgumentParsing
|test.unit.interpreter.autocomplete.TestAutocompletion
|test.unit.interpreter.help.TestHelpResponses
|test.unit.interpreter.commands.TestInterpreterCommands
|test.unit.examples.TestExamples
|test.unit.doctest.TestDocumentation
test.integ_tests
|test.integ.util.conf.TestConf
|test.integ.util.connection.TestConnection
|test.integ.util.proc.TestProc
|test.integ.util.system.TestSystem
|test.integ.interpreter.TestInterpreter
|test.integ.version.TestVersion
|test.integ.manual.TestManual
|test.integ.directory.authority.TestAuthority
|test.integ.directory.fallback.TestFallback
|test.integ.client.connection.TestConnection
|test.integ.response.protocolinfo.TestProtocolInfo
|test.integ.socket.control_socket.TestControlSocket
|test.integ.socket.control_message.TestControlMessage
|test.integ.connection.authentication.TestAuthenticate
|test.integ.connection.connect.TestConnect
|test.integ.control.base_controller.TestBaseController
|test.integ.control.controller.TestController
|test.integ.descriptor.collector.TestCollector
|test.integ.descriptor.remote.TestDescriptorDownloader
|test.integ.descriptor.server_descriptor.TestServerDescriptor
|test.integ.descriptor.extrainfo_descriptor.TestExtraInfoDescriptor
|test.integ.descriptor.microdescriptor.TestMicrodescriptor
|test.integ.descriptor.networkstatus.TestNetworkStatus
|test.integ.installation.TestInstallation
|test.integ.process.TestProcess