[tor-commits] [sbws/master] scanner: exit after the first loop in test networks

juga at torproject.org juga at torproject.org
Sat Feb 23 15:59:30 UTC 2019


commit 7c42d62b3a39385470c5db0bf16262e58e1f0ff7
Author: juga0 <juga at riseup.net>
Date:   Wed Jan 9 15:49:26 2019 +0000

    scanner: exit after the first loop in test networks
    
    In order to run the scanner as part of the integration tests.
---
 sbws/core/scanner.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sbws/core/scanner.py b/sbws/core/scanner.py
index 7246f12..791d719 100644
--- a/sbws/core/scanner.py
+++ b/sbws/core/scanner.py
@@ -382,6 +382,11 @@ def run_speedtest(args, conf):
         loop_tstop = time.time()
         loop_tdelta = (loop_tstop - loop_tstart) / 60
         log.info("Measured %s relays in %s minutes", num_relays, loop_tdelta)
+        # In a testing network, exit after first loop
+        if controller.get_conf('TestingTorNetwork') == '1':
+            log.info("In a testing network, exiting after the first loop.")
+            # Threads should be closed nicely in some refactor
+            exit(0)
 
 
 def gen_parser(sub):





More information about the tor-commits mailing list