[tor-commits] [stem/master] Renaming CONN_* targets to RUN_*
atagar at torproject.org
atagar at torproject.org
Mon Jan 23 05:56:18 UTC 2012
commit d465a9162c58915cbf41c544844cd3520329e3e3
Author: Damian Johnson <atagar at torproject.org>
Date: Sun Jan 22 11:53:35 2012 -0800
Renaming CONN_* targets to RUN_*
The former CONN_* targets each represent a run of the integration tests. These
were originally called CONN_* because they defined torrc parameters for
connecting to tor, but as time went on they became more general. RUN_* (for
instance RUN_ALL) is far more intuitive to users.
Also dropping the 'integ' prefix from target configurations. It's accurate, but
pointless to have. Target options are used frequently enough that we shouldn't
make them more verbose without a reason.
---
run_tests.py | 6 ++--
test/integ/connection/authentication.py | 2 +-
test/integ/connection/connect.py | 2 +-
test/integ/connection/protocolinfo.py | 2 +-
test/runner.py | 10 +++---
test/settings.cfg | 58 +++++++++++++++---------------
test/testrc.sample | 44 ++++++++++++------------
7 files changed, 62 insertions(+), 62 deletions(-)
diff --git a/run_tests.py b/run_tests.py
index be0080b..df9c538 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -62,7 +62,7 @@ INTEG_TESTS = (
)
# Integration tests above the basic suite.
-TARGETS = stem.util.enum.Enum(*[(v, v) for v in ("ONLINE", "RELATIVE", "CONN_NONE", "CONN_OPEN", "CONN_PASSWORD", "CONN_COOKIE", "CONN_MULTIPLE", "CONN_SOCKET", "CONN_SCOOKIE", "CONN_PTRACE", "CONN_ALL")])
+TARGETS = stem.util.enum.Enum(*[(v, v) for v in ("ONLINE", "RELATIVE", "RUN_NONE", "RUN_OPEN", "RUN_PASSWORD", "RUN_COOKIE", "RUN_MULTIPLE", "RUN_SOCKET", "RUN_SCOOKIE", "RUN_PTRACE", "RUN_ALL")])
CONFIG = {
"target.config": {},
@@ -71,7 +71,7 @@ CONFIG = {
"target.torrc": {},
}
-DEFAULT_RUN_TARGET = TARGETS.CONN_OPEN
+DEFAULT_RUN_TARGET = TARGETS.RUN_OPEN
HELP_MSG = """Usage runTests.py [OPTION]
Runs tests for the stem library.
@@ -263,7 +263,7 @@ if __name__ == '__main__':
integ_run_targets = []
all_run_targets = [t for t in TARGETS if CONFIG["target.torrc"].get(t)]
- if test_config.get("test.integ.target.connection.all", False):
+ if test_config.get("test.target.run.all", False):
# test against everything with torrc options
integ_run_targets = all_run_targets
else:
diff --git a/test/integ/connection/authentication.py b/test/integ/connection/authentication.py
index e84542f..886fbb8 100644
--- a/test/integ/connection/authentication.py
+++ b/test/integ/connection/authentication.py
@@ -25,7 +25,7 @@ INCORRECT_PASSWORD_FAIL = "Authentication failed: Password did not match HashedC
class TestAuthenticate(unittest.TestCase):
"""
- Tests the authentication methods. This should be run with the 'CONN_ALL'
+ Tests the authentication methods. This should be run with the 'RUN_ALL'
integ target to exercise the widest range of use cases.
"""
diff --git a/test/integ/connection/connect.py b/test/integ/connection/connect.py
index d67f702..fb13d20 100644
--- a/test/integ/connection/connect.py
+++ b/test/integ/connection/connect.py
@@ -11,7 +11,7 @@ import test.runner
class TestConnect(unittest.TestCase):
"""
- Tests the connection methods. This should be run with the 'CONN_ALL' integ
+ Tests the connection methods. This should be run with the 'RUN_ALL' integ
target to exercise the widest range of use cases.
"""
diff --git a/test/integ/connection/protocolinfo.py b/test/integ/connection/protocolinfo.py
index 76ef38e..51076a2 100644
--- a/test/integ/connection/protocolinfo.py
+++ b/test/integ/connection/protocolinfo.py
@@ -12,7 +12,7 @@ import stem.util.system
class TestProtocolInfo(unittest.TestCase):
"""
- Queries and parses PROTOCOLINFO. This should be run with the 'CONN_ALL'
+ Queries and parses PROTOCOLINFO. This should be run with the 'RUN_ALL'
integ target to exercise the widest range of use cases.
"""
diff --git a/test/runner.py b/test/runner.py
index f78bbc9..2ca380b 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -43,8 +43,8 @@ import stem.util.term as term
DEFAULT_CONFIG = {
"test.integ.test_directory": "./test/data",
"test.integ.log": "./test/data/log",
- "test.integ.target.online": False,
- "test.integ.target.relative_data_dir": False,
+ "test.target.online": False,
+ "test.target.relative_data_dir": False,
}
STATUS_ATTR = (term.Color.BLUE, term.Attr.BOLD)
@@ -158,7 +158,7 @@ class Runner:
original_cwd, data_dir_path = os.getcwd(), self._test_dir
- if self._config["test.integ.target.relative_data_dir"]:
+ if self._config["test.target.relative_data_dir"]:
tor_cwd = os.path.dirname(self._test_dir)
if not os.path.exists(tor_cwd): os.makedirs(tor_cwd)
@@ -177,7 +177,7 @@ class Runner:
self._start_tor(tor_cmd, quiet)
# revert our cwd back to normal
- if self._config["test.integ.target.relative_data_dir"]:
+ if self._config["test.target.relative_data_dir"]:
os.chdir(original_cwd)
except OSError, exc:
self.stop(quiet)
@@ -532,7 +532,7 @@ class Runner:
try:
# wait to fully complete if we're running tests with network activity,
# otherwise finish after local bootstraping
- complete_percent = 100 if self._config["test.integ.target.online"] else 5
+ complete_percent = 100 if self._config["test.target.online"] else 5
# prints output from tor's stdout while it starts up
print_init_line = lambda line: _print_status(" %s\n" % line, SUBSTATUS_ATTR, quiet)
diff --git a/test/settings.cfg b/test/settings.cfg
index 75977d6..3766dd4 100644
--- a/test/settings.cfg
+++ b/test/settings.cfg
@@ -13,46 +13,46 @@
# Configuration option with which the target is synced. If an option is set via
# both the config and '--target' argument then the argument takes precedence.
-target.config ONLINE => test.integ.target.online
-target.config RELATIVE => test.integ.target.relative_data_dir
-target.config CONN_NONE => test.integ.target.connection.none
-target.config CONN_OPEN => test.integ.target.connection.open
-target.config CONN_PASSWORD => test.integ.target.connection.password
-target.config CONN_COOKIE => test.integ.target.connection.cookie
-target.config CONN_MULTIPLE => test.integ.target.connection.multiple
-target.config CONN_SOCKET => test.integ.target.connection.socket
-target.config CONN_SCOOKIE => test.integ.target.connection.scookie
-target.config CONN_PTRACE => test.integ.target.connection.ptrace
-target.config CONN_ALL => test.integ.target.connection.all
+target.config ONLINE => test.target.online
+target.config RELATIVE => test.target.relative_data_dir
+target.config RUN_NONE => test.target.run.none
+target.config RUN_OPEN => test.target.run.open
+target.config RUN_PASSWORD => test.target.run.password
+target.config RUN_COOKIE => test.target.run.cookie
+target.config RUN_MULTIPLE => test.target.run.multiple
+target.config RUN_SOCKET => test.target.run.socket
+target.config RUN_SCOOKIE => test.target.run.scookie
+target.config RUN_PTRACE => test.target.run.ptrace
+target.config RUN_ALL => test.target.run.all
# 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 CONN_NONE => Configuration without a way for controllers to connect.
-target.description CONN_OPEN => Configuration with an open control port (default).
-target.description CONN_PASSWORD => Configuration with password authentication.
-target.description CONN_COOKIE => Configuration with an authentication cookie.
-target.description CONN_MULTIPLE => Configuration with both password and cookie authentication.
-target.description CONN_SOCKET => Configuration with a control socket.
-target.description CONN_SCOOKIE => Configuration with a control socket and authentication cookie.
-target.description CONN_PTRACE => Configuration with an open control port and 'DisableDebuggerAttachment 0'
-target.description CONN_ALL => Runs integration tests for all connection configurations.
+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.
# Version that we need to run the target. These need to match an enumeration of
# stem.version.Requirement.
-target.prereq CONN_PTRACE => DISABLE_DEBUGGER_ATTACHMENT
+target.prereq RUN_PTRACE => DISABLE_DEBUGGER_ATTACHMENT
# 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 CONN_NONE =>
-target.torrc CONN_OPEN => PORT
-target.torrc CONN_PASSWORD => PORT, PASSWORD
-target.torrc CONN_COOKIE => PORT, COOKIE
-target.torrc CONN_MULTIPLE => PORT, PASSWORD, COOKIE
-target.torrc CONN_SOCKET => SOCKET
-target.torrc CONN_SCOOKIE => SOCKET, COOKIE
-target.torrc CONN_PTRACE => PORT, PTRACE
+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
diff --git a/test/testrc.sample b/test/testrc.sample
index d5a9326..8c89b04 100644
--- a/test/testrc.sample
+++ b/test/testrc.sample
@@ -12,37 +12,37 @@
# Path runtime logs are placed. Relative paths are expanded in reference to
# 'run_tests.py'. Logging is disabled if set ot an empty value.
#
-# test.integ.target.online
+# test.target.online
# Runs tests with network activity. If set then we'll wait for tor to fully
# bootstrap when starting, which won't happen without a network connection.
#
-# test.integ.target.relative_data_dir
+# test.target.relative_data_dir
# Uses a relative path for the tor data directory if set.
#
-# test.integ.target.connection.none
-# test.integ.target.connection.open
-# test.integ.target.connection.password
-# test.integ.target.connection.cookie
-# test.integ.target.connection.multiple
-# test.integ.target.connection.socket
-# test.integ.target.connection.scookie
-# test.integ.target.connection.ptrace
-# test.integ.target.connection.all
+# test.target.run.none
+# test.target.run.open
+# test.target.run.password
+# test.target.run.cookie
+# test.target.run.multiple
+# test.target.run.socket
+# test.target.run.scookie
+# test.target.run.ptrace
+# test.target.run.all
# Runs the integration test suite for all of the given connection and
# authentication configurations. If the 'all' option is set then the other
# flags are ignored.
test.integ.test_directory ./test/data
test.integ.log ./test/data/log
-test.integ.target.online false
-test.integ.target.relative_data_dir false
-test.integ.target.connection.none false
-test.integ.target.connection.open true
-test.integ.target.connection.password false
-test.integ.target.connection.cookie false
-test.integ.target.connection.muiltipe false
-test.integ.target.connection.socket false
-test.integ.target.connection.scookie false
-test.integ.target.connection.ptrace false
-test.integ.target.connection.all false
+test.target.online false
+test.target.relative_data_dir false
+test.target.run.none false
+test.target.run.open true
+test.target.run.password false
+test.target.run.cookie false
+test.target.run.muiltipe false
+test.target.run.socket false
+test.target.run.scookie false
+test.target.run.ptrace false
+test.target.run.all false
More information about the tor-commits
mailing list