test-network.sh gets a --debug flag, and they both get documented in the README. debug_flag is no longer recommended.
@@ -57,6 +57,7 @@ Warning Options:
--only-warnings CHUTNEY_WARNINGS_ONLY=true
Expert Options:
+ --debug CHUTNEY_DEBUG=true
--coverage USE_COVERAGE_BINARY=true
--net-dir CHUTNEY_DATA_DIR
--dry-run NETWORK_DRY_RUN=true
@@ -28,11 +28,11 @@ import select
import struct
import errno
import time
+import os
# Set debug_flag=True in order to debug this program or to get hints
# about what's going wrong in your system.
-debug_flag = False
-
+debug_flag = os.environ.get("CHUTNEY_DEBUG", "") != ""
def debug(s):
"Print a debug message on stdout if debug_flag is True."
@@ -19,9 +19,7 @@ def run_test(network):
time.sleep(5)
print("Transmission: %s" % ("Success" if status else "Failure"))
if not status:
- # TODO: allow the debug flag to be passed as an argument to
- # src/test/test-network.sh and chutney
- print("Set 'debug_flag = True' in Traffic.py to diagnose.")
+ print("Set CHUTNEY_DEBUG to diagnose.")
return status
@@ -35,7 +35,10 @@ do
# the name or path of a tor-gencert binary
export CHUTNEY_TOR_GENCERT="$2"
shift
- ;;
+ ;;
+ --debug)
+ export CHUTEY_DEBUG="yes"
--flavor|--flavour|--network-flavor|--network-flavour)
export NETWORK_FLAVOUR="$2"