[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [chutney/master] test scripts: If a network is not supported, exit with 77



commit d8c700e178e171cb49c37a76c574c97ced5295e1
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu May 9 13:07:57 2019 -0400

    test scripts: If a network is not supported, exit with 77
    
    This will help automake's test drivers realize that it has been
    skipped.
---
 tools/bootstrap-network.sh | 5 +++++
 tools/test-network-impl.sh | 4 ++++
 tools/test-network.sh      | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/tools/bootstrap-network.sh b/tools/bootstrap-network.sh
index f767e7f..34db0f3 100755
--- a/tools/bootstrap-network.sh
+++ b/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"
 
diff --git a/tools/test-network-impl.sh b/tools/test-network-impl.sh
index a63fe97..73b942b 100755
--- a/tools/test-network-impl.sh
+++ b/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"
diff --git a/tools/test-network.sh b/tools/test-network.sh
index f28acea..4571499 100755
--- a/tools/test-network.sh
+++ b/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."



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits