Additional engine coverage

This commit is contained in:
Kkevsterrr 2019-12-12 23:09:07 -05:00
parent f8c4220259
commit bd7c6a3321
2 changed files with 22 additions and 2 deletions

View File

@ -34,8 +34,6 @@ class Engine():
self.server_port = server_port
self.seen_packets = []
# Set up the directory and ID for logging
if not output_directory:
output_directory = "trials"
actions.utils.setup_dirs(output_directory)
if not environment_id:
environment_id = actions.utils.get_id()

View File

@ -34,6 +34,14 @@ def test_engine_sleep():
with engine.Engine(port, strategy, log_level="info") as eng:
os.system("curl http://example.com?q=ultrasurf")
# Strategy to use in opposite direction
strategy = "\/ [TCP:flags:SA]-sleep{1}-|"
# Create the engine in debug mode
with engine.Engine(port, strategy, log_level="debug") as eng:
os.system("curl http://example.com?q=ultrasurf")
def test_engine_trace():
"""
@ -48,3 +56,17 @@ def test_engine_trace():
with engine.Engine(port, strategy, log_level="debug") as eng:
os.system("curl -m 5 http://example.com?q=ultrasurf")
def test_engine_trace():
"""
Basic engine test with trace
"""
# Port to run the engine on
port = 80
# Strategy to use
strategy = "\/ [TCP:flags:SA]-drop-|"
# Create the engine in debug mode
with engine.Engine(port, strategy, log_level="debug") as eng:
os.system("curl -m 3 http://example.com?q=ultrasurf")