Browse Source

Additional engine coverage

GEN-7_tests
Kkevsterrr 3 years ago
parent
commit
bd7c6a3321
  1. 2
      engine.py
  2. 22
      tests/test_engine.py

2
engine.py

@ -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()

22
tests/test_engine.py

@ -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")

Loading…
Cancel
Save