Browse Source

test scripts: If a network is not supported, exit with 77

This will help automake's test drivers realize that it has been
skipped.
Nick Mathewson 4 years ago
parent
commit
d8c700e178
3 changed files with 12 additions and 0 deletions
  1. 5 0
      tools/bootstrap-network.sh
  2. 4 0
      tools/test-network-impl.sh
  3. 3 0
      tools/test-network.sh

+ 5 - 0
tools/bootstrap-network.sh

@@ -53,6 +53,11 @@ export CHUTNEY_NETWORK="$CHUTNEY_PATH/networks/$NETWORK_FLAVOUR"
 
 "$CHUTNEY" stop "$CHUTNEY_NETWORK"
 
+if ! "$CHUTNEY" supported "$CHUTNEY_NETWORK"; then
+    echo "%myname: network not supported."
+    exit 77
+fi
+
 echo "$myname: bootstrapping network: $NETWORK_FLAVOUR"
 "$CHUTNEY" configure "$CHUTNEY_NETWORK"
 

+ 4 - 0
tools/test-network-impl.sh

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

+ 3 - 0
tools/test-network.sh

@@ -351,6 +351,9 @@ while [ "$n_attempts" -lt "$max_attempts" ]; do
 	$ECHO "==== Chutney succeeded after $n_attempts attempt(s)."
 	exit 0
     fi
+    if test "$?" = 77; then
+	exit 77
+    fi
 done
 
 $ECHO "Chutney failed $n_attempts times; we may have a problem here."