summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-02-28 20:13:54 -0500
committerNick Mathewson <nickm@torproject.org>2017-02-28 20:13:54 -0500
commit909493604072e371d05d622a9ee1554e6cb7313b (patch)
tree36d6e869dc6ac90f8ff6ce70107dcb8030550957
parentcf9844fcfa5387e054dff55d5ad0bfd538b4cec3 (diff)
parenta3bec9aa5a023c39f04d863c21cef779cb590e85 (diff)
downloadtor-909493604072e371d05d622a9ee1554e6cb7313b.tar.gz
tor-909493604072e371d05d622a9ee1554e6cb7313b.zip
Merge branch 'maint-0.3.0' into release-0.3.0
-rw-r--r--Makefile.am3
-rw-r--r--changes/bug215815
-rwxr-xr-xsrc/test/test-network.sh19
3 files changed, 21 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index 880420b287..3d50594bf4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -137,9 +137,6 @@ test-network-all: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/
for f in $$flavors; do \
$(SHELL) $(top_srcdir)/test-driver --test-name $$f --log-file $(TEST_NETWORK_ALL_LOG_DIR)/$$f.log --trs-file $(TEST_NETWORK_ALL_LOG_DIR)/$$f.trs $(TEST_NETWORK_ALL_DRIVER_FLAGS) $(top_srcdir)/src/test/test-network.sh --flavor $$f $(TEST_NETWORK_FLAGS); \
$(top_srcdir)/src/test/test-network.sh $(TEST_NETWORK_WARNING_FLAGS); \
- if test $$? -eq 2 ; then \
- echo "Please update your chutney using 'git pull' to see tor warnings here."; \
- fi; \
done; \
echo "Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."; \
! grep -q FAIL test_network_log/*.trs
diff --git a/changes/bug21581 b/changes/bug21581
new file mode 100644
index 0000000000..1077719856
--- /dev/null
+++ b/changes/bug21581
@@ -0,0 +1,5 @@
+ o Minor bugfixes (testing):
+ - Restore support for test-network.sh on BSD and other systems without
+ bash. (But use bash if it's available.) This is a workaround until we
+ remove bash-specific code in 19699.
+ Fixes bug 21581; bugfix on 21562, not in any released version of tor.
diff --git a/src/test/test-network.sh b/src/test/test-network.sh
index cb10f7232f..edd2897e5d 100755
--- a/src/test/test-network.sh
+++ b/src/test/test-network.sh
@@ -1,9 +1,19 @@
-#! /bin/bash
+#! /bin/sh
+
+# use bash if it is available, as this script doesn't work well in non-bash sh
+# this will be fixed in #19699
+# there is no simple, portable way of checking the name of the shell, so we
+# exec bash even when sh is bash
+if [ -x /bin/bash -a "$USING_BASH" != true ]; then
+ # only do this once
+ export USING_BASH=true
+ exec /bin/bash "$0" "$@"
+fi
# Please do not modify this script, it has been moved to chutney/tools
-export ECHO=${ECHO:-"echo"}
-export ECHO_N=${ECHO_N:-"/bin/echo -n"}
+export ECHO="${ECHO:-echo}"
+export ECHO_N="${ECHO_N:-/bin/echo -n}"
# Output is prefixed with the name of the script
myname=$(basename $0)
@@ -21,6 +31,8 @@ if [ "$TEST_NETWORK_RECURSING" != true ]; then
# can be removed, because this script will find chutney, then pass all
# arguments to chutney's test-network.sh
export TEST_NETWORK_RECURSING=true
+ # passing arguments to a sourced script only works in bash
+ # this will be fixed in #19699
. "$0" --dry-run "$@"
# Call the chutney version of this script, if it exists, and we can find it
@@ -179,6 +191,7 @@ export CHUTNEY_NETWORK=networks/$NETWORK_FLAVOUR
if [ "$NETWORK_DRY_RUN" = true ]; then
# we can't exit here, it breaks argument processing
# this only works in bash: return semantics are shell-specific
+ # this will be fixed in #19699
return 2>/dev/null || exit
fi