Browse Source

Chutney scripts now use a network file rather than flavour

Allows you to specify network configurations that aren't in the
'chutney/networks/' directory.
Steven Engler 2 years ago
parent
commit
23093073bc
3 changed files with 13 additions and 16 deletions
  1. 9 8
      tools/bootstrap-network.sh
  2. 2 2
      tools/test-network-impl.sh
  3. 2 6
      tools/test-network.sh

+ 9 - 8
tools/bootstrap-network.sh

@@ -8,9 +8,8 @@
 #       and creating a new net/nodes
 #
 # Usage:
-#    tools/bootstrap-network.sh [network-flavour]
-#    network-flavour: one of the files in the networks directory,
-#                     (default: 'basic')
+#    tools/bootstrap-network.sh [network]
+#    network: a network configuration file
 #
 
 # Get a working chutney path
@@ -38,15 +37,17 @@ fi
 CHUTNEY="$CHUTNEY_PATH/chutney"
 myname=$(basename "$0")
 
+if [ -z "$1" ]; then
+    echo "$myname: the network wasn't provided"
+    exit 1
+fi
+
 [ -d "$CHUTNEY_PATH" ] || \
     { echo "$myname: missing chutney directory: $CHUTNEY_PATH"; exit 1; }
 [ -x "$CHUTNEY" ] || \
     { echo "$myname: missing chutney: $CHUTNEY"; exit 1; }
 
-# Set the variables for the chutney network flavour
-export NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-"bridges+hs-v2"}
-[ -n "$1" ] && { NETWORK_FLAVOUR=$1; shift; }
-export CHUTNEY_NETWORK="$CHUTNEY_PATH/networks/$NETWORK_FLAVOUR"
+export CHUTNEY_NETWORK="$1"
 
 [ -e "$CHUTNEY_NETWORK" ] || \
     { echo "$myname: missing network file: $CHUTNEY_NETWORK"; exit 1; }
@@ -58,7 +59,7 @@ if ! "$CHUTNEY" supported "$CHUTNEY_NETWORK"; then
     exit 77
 fi
 
-echo "$myname: bootstrapping network: $NETWORK_FLAVOUR"
+echo "$myname: bootstrapping network: $CHUTNEY_NETWORK"
 "$CHUTNEY" configure "$CHUTNEY_NETWORK"
 
 "$CHUTNEY" start "$CHUTNEY_NETWORK"

+ 2 - 2
tools/test-network-impl.sh

@@ -1,8 +1,8 @@
 #!/bin/sh
 
-if ! "$CHUTNEY_PATH/tools/bootstrap-network.sh" "$NETWORK_FLAVOUR"; then
+if ! "$CHUTNEY_PATH/tools/bootstrap-network.sh" "$CHUTNEY_NETWORK"; then
     if test "$?" = 77; then
-	$ECHO "SKIP: $NETWORK_FLAVOR not supported."
+	$ECHO "SKIP: $CHUTNEY_NETWORK not supported."
 	exit 77
     fi
     CHUTNEY_WARNINGS_IGNORE_EXPECTED=false CHUTNEY_WARNINGS_SUMMARY=false \

+ 2 - 6
tools/test-network.sh

@@ -53,8 +53,8 @@ do
         --debug)
             export CHUTNEY_DEBUG="yes"
             ;;
-        --flavor|--flavour|--network-flavor|--network-flavour)
-            export NETWORK_FLAVOUR="$2"
+        --network)
+            export CHUTNEY_NETWORK="$2"
             shift
         ;;
         # The amount of time chutney will wait before starting to verify
@@ -335,10 +335,6 @@ else
 fi
 $ECHO "$myname: Using \$CHUTNEY_TOR: '$CHUTNEY_TOR' and \$CHUTNEY_TOR_GENCERT: '$CHUTNEY_TOR_GENCERT'"
 
-# Set the variables for the chutney network flavour
-export NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-"bridges+hs-v2"}
-export CHUTNEY_NETWORK="$CHUTNEY_PATH/networks/$NETWORK_FLAVOUR"
-
 export WARNING_COMMAND="$CHUTNEY_PATH/tools/warnings.sh"
 if [ "$CHUTNEY_WARNINGS_SKIP" = true ]; then
     export WARNINGS=true