Add two skiplist tuples to the selftest framework, one for tests to
remove when debug mode is on, another for tests to remove when debug
mode is off. This is not used yet, so the tuples are initially
empty. Also enable debug mode in the daemon config fixture so that
debug functionality can be tested in the normal selftest run. The
default example config (tested with tox -e selftest_config) covers
the debug disabled case.
# Debugging commands are dangerous, and may result in granting
# administrative users access to the system account under which the
# service runs. Be very sure you trust your admins before enabling!
# Debugging commands are dangerous, and may result in granting
# administrative users access to the system account under which the
# service runs. Be very sure you trust your admins before enabling!
-# .mudpy.limit.debug: true
+.mudpy.limit.debug: true
.mudpy.limit.password_tries: 3
.mudpy.log.file: var/mudpy.log
.mudpy.limit.password_tries: 3
.mudpy.log.file: var/mudpy.log
import telnetlib
import time
import telnetlib
import time
# TODO(fungi) Clean this up once Python 3.5 is no longer supported
if sys.version < "3.6":
import collections
# TODO(fungi) Clean this up once Python 3.5 is no longer supported
if sys.version < "3.6":
import collections
(final_cleanup, "delete remaining accounts"),
))
(final_cleanup, "delete remaining accounts"),
))
+debug_tests = (
+)
+
+nondebug_tests = (
+)
+
def start_service(config):
# Clean up any previously run daemon which didn't terminate
def start_service(config):
# Clean up any previously run daemon which didn't terminate
telnet_socket.send(telnetlib.IAC + telnetlib.DONT + option)
telnet_socket.send(telnetlib.IAC + telnetlib.DONT + option)
+def check_debug():
+ if len(sys.argv) > 1:
+ config = yaml.safe_load(open(sys.argv[1]))
+ return config.get(".mudpy.limit.debug", False)
+ return False
+
+
def main():
captures = ["", "", ""]
lusers = [telnetlib.Telnet(), telnetlib.Telnet(), telnetlib.Telnet()]
def main():
captures = ["", "", ""]
lusers = [telnetlib.Telnet(), telnetlib.Telnet(), telnetlib.Telnet()]
luser.open("::1", 4000)
luser.set_option_negotiation_callback(option_callback)
selected_dialogue = odict(dialogue)
luser.open("::1", 4000)
luser.set_option_negotiation_callback(option_callback)
selected_dialogue = odict(dialogue)
+ if check_debug():
+ for test in nondebug_tests:
+ del selected_dialogue[test]
+ else:
+ for test in debug_tests:
+ del selected_dialogue[test]
for test, description in selected_dialogue.items():
tlog("\nTesting %s..." % description)
test_start = time.time()
for test, description in selected_dialogue.items():
tlog("\nTesting %s..." % description)
test_start = time.time()