Browse Source

Allow tor and tor-gencert to be specified on the chutney command-line

Now works via --tor and --tor-gencert.
Overridden by the build directory set via --tor-path and $TOR_DIR.
teor (Tim Wilson-Brown) 7 years ago
parent
commit
1ac58478c1
2 changed files with 20 additions and 2 deletions
  1. 5 1
      README
  2. 15 1
      tools/test-network.sh

+ 5 - 1
README

@@ -19,8 +19,12 @@ Stuff to try:
 
 Automated Setup, Verification, and Shutdown:
   ./tools/test-network.sh --flavor basic-min
-  ./tools/test-network.sh --tor-path <tor-build-directory>
   ./tools/test-network.sh --coverage
+  ./tools/test-network.sh --tor-path <tor-build-directory>
+  ./tools/test-network.sh --tor <name-or-path> --tor-gencert <name-or-path>
+  (--tor-path and $TOR_DIR override --tor and --tor-gencert.)
+
+The environmental variables documented below also work with test-network.sh.
 
 Standard Actions:
   ./chutney configure networks/basic

+ 15 - 1
tools/test-network.sh

@@ -13,9 +13,21 @@ do
       shift
     ;;
     --tor-path)
+      # the path of a tor build directory
+      # --tor-path overrides --tor and --tor-gencert
       export TOR_DIR="$2"
       shift
     ;;
+    --tor)
+      # the name or path of a tor binary
+      export CHUTNEY_TOR="$2"
+      shift
+    ;;
+    --tor-gencert)
+      # the name or path of a tor-gencert binary
+      export CHUTNEY_TOR_GENCERT="$2"
+      shift
+    ;;
     --flavor|--flavour|--network-flavor|--network-flavour)
       export NETWORK_FLAVOUR="$2"
       shift
@@ -113,7 +125,9 @@ CHUTNEY_PATH=\`pwd\`/chutney"
 fi
 
 # For picking up the right tor binaries.
-# If these varibles aren't set, chutney looks for tor binaries in $PATH
+# If $TOR_DIR isn't set, chutney looks for tor binaries by name or path
+# using $CHUTNEY_TOR and $CHUTNEY_TOR_GENCERT, and then falls back to
+# looking for tor and tor-gencert in $PATH
 if [ -d "$TOR_DIR" ]; then
     tor_name=tor
     tor_gencert_name=tor-gencert