diff options
-rw-r--r-- | .travis.yml | 25 | ||||
-rw-r--r-- | changes/bug30713 | 5 | ||||
-rw-r--r-- | changes/ticket29702 | 4 | ||||
-rw-r--r-- | changes/ticket30213 | 3 | ||||
-rw-r--r-- | changes/ticket30234 | 2 | ||||
-rwxr-xr-x | src/test/test_key_expiration.sh | 3 | ||||
-rwxr-xr-x | src/test/test_keygen.sh | 3 | ||||
-rw-r--r-- | src/test/test_rebind.py | 17 | ||||
-rwxr-xr-x | src/test/test_rebind.sh | 4 | ||||
-rwxr-xr-x | src/test/zero_length_keys.sh | 3 |
10 files changed, 42 insertions, 27 deletions
diff --git a/.travis.yml b/.travis.yml index a1a48baffe..861b37f085 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ env: - RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true matrix: - ## include creates builds with gcc, linux, sudo: false + ## include creates builds with gcc, linux include: ## We include a single coverage build with the best options for coverage - env: COVERAGE_OPTIONS="--enable-coverage" HARDENING_OPTIONS="" @@ -75,12 +75,6 @@ matrix: - env: TEST_STEM="yes" exclude: - ## Clang doesn't work in containerized builds, see below. - - compiler: clang - sudo: false - ## Non-containerized gcc are slow and redundant. - - compiler: gcc - sudo: required ## gcc on OSX is less useful, because the default compiler is clang. - compiler: gcc os: osx @@ -96,20 +90,6 @@ matrix: ## TOR_RUST_DEPENDENCIES is spelt RUST_DEPENDENCIES in 0.3.2 env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true HARDENING_OPTIONS="" -## We don't need sudo. (The "apt:" stanza after this allows us to not need -## sudo; otherwise, we would need it for getting dependencies.) -## -## But we use "sudo: required" to force non-containerized builds, working -## around a Travis CI environment issue: clang LeakAnalyzer fails -## because it requires ptrace and the containerized environment no -## longer allows ptrace. -## https://github.com/travis-ci/travis-ci/issues/9033 -## -## In the matrix above, we exclude redundant combinations. -sudo: - - false - - required - ## (Linux only) Use the latest Linux image (Ubuntu Trusty) dist: trusty @@ -208,6 +188,8 @@ install: - if [[ "$TEST_STEM" != "" ]]; then pushd stem; python -c "from stem import stem; print(stem.__version__);"; git log -1; popd; fi script: + # Skip test_rebind on macOS + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export TOR_SKIP_TEST_REBIND=true; fi - ./autogen.sh - CONFIGURE_FLAGS="$ASCIIDOC_OPTIONS $COVERAGE_OPTIONS $HARDENING_OPTIONS $MODULES_OPTIONS $NSS_OPTIONS $OPENSSL_OPTIONS $RUST_OPTIONS --enable-fatal-warnings --disable-silent-rules" - echo "Configure flags are $CONFIGURE_FLAGS" @@ -229,6 +211,7 @@ after_failure: ## `make distcheck` puts it somewhere different. - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog || echo "make failed"; fi - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-core || echo "make failed"; fi + - if [[ "$TEST_STEM" != "" ]]; then cat "$STEM_SOURCE_DIR"/test/data/tor_log || echo "cat failed"; fi before_cache: ## Delete all gcov files. diff --git a/changes/bug30713 b/changes/bug30713 new file mode 100644 index 0000000000..e00b98da65 --- /dev/null +++ b/changes/bug30713 @@ -0,0 +1,5 @@ + o Minor bugfixes (testing): + - Skip test_rebind when the TOR_SKIP_TEST_REBIND environmental variable is + set. Fixes bug 30713; bugfix on 0.3.5.1-alpha. + - Skip test_rebind on macOS in Travis, because it is unreliable on + macOS on Travis. Fixes bug 30713; bugfix on 0.3.5.1-alpha. diff --git a/changes/ticket29702 b/changes/ticket29702 new file mode 100644 index 0000000000..e1cc1f867b --- /dev/null +++ b/changes/ticket29702 @@ -0,0 +1,4 @@ + o Testing: + - Specify torrc paths (with empty files) when launching tor in + integration tests; refrain from reading user and system torrcs. + Resolves issue 29702. diff --git a/changes/ticket30213 b/changes/ticket30213 new file mode 100644 index 0000000000..acb7614807 --- /dev/null +++ b/changes/ticket30213 @@ -0,0 +1,3 @@ + o Minor features (continuous integration): + - Remove sudo configuration lines from .travis.yml as they are no longer + needed with current Travis build environment. Resolves issue 30213. diff --git a/changes/ticket30234 b/changes/ticket30234 new file mode 100644 index 0000000000..5a0076bad2 --- /dev/null +++ b/changes/ticket30234 @@ -0,0 +1,2 @@ + o Testing (continuous integration): + - In Travis, show stem's tor log after failure. Closes ticket 30234. diff --git a/src/test/test_key_expiration.sh b/src/test/test_key_expiration.sh index cf6608634d..3474210607 100755 --- a/src/test/test_key_expiration.sh +++ b/src/test/test_key_expiration.sh @@ -66,10 +66,11 @@ trap "rm -rf '$DATA_DIR'" 0 DATA_DIR=`cd "${DATA_DIR}" && pwd` touch "${DATA_DIR}/empty_torrc" +touch "${DATA_DIR}/empty_defaults_torrc" QUIETLY="--hush" SILENTLY="--quiet" -TOR="${TOR_BINARY} --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0 -f ${DATA_DIR}/empty_torrc --DataDirectory ${DATA_DIR}" +TOR="${TOR_BINARY} --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0 --DataDirectory ${DATA_DIR} -f ${DATA_DIR}/empty_torrc --defaults-torrc ${DATA_DIR}/empty_defaults_torrc" ##### SETUP # diff --git a/src/test/test_keygen.sh b/src/test/test_keygen.sh index 455f9e7d42..7afff271cb 100755 --- a/src/test/test_keygen.sh +++ b/src/test/test_keygen.sh @@ -83,10 +83,11 @@ trap "rm -rf '$DATA_DIR'" 0 DATA_DIR=`cd "${DATA_DIR}" && pwd` touch "${DATA_DIR}/empty_torrc" +touch "${DATA_DIR}/empty_defaults_torrc" QUIETLY="--hush" SILENTLY="--quiet" -TOR="${TOR_BINARY} ${QUIETLY} --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0 -f ${DATA_DIR}/empty_torrc" +TOR="${TOR_BINARY} ${QUIETLY} --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0 -f ${DATA_DIR}/empty_torrc --defaults-torrc ${DATA_DIR}/empty_defaults_torrc" ##### SETUP # diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py index 00e5a08be7..45ad1c5469 100644 --- a/src/test/test_rebind.py +++ b/src/test/test_rebind.py @@ -16,6 +16,10 @@ def fail(msg): logging.error('FAIL') sys.exit(msg) +def skip(msg): + logging.warning('SKIP: {}'.format(msg)) + sys.exit(77) + def try_connecting_to_socksport(): socks_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if socks_socket.connect_ex(('127.0.0.1', socks_port)): @@ -65,6 +69,9 @@ if sys.hexversion < 0x02070000: if sys.hexversion > 0x03000000 and sys.hexversion < 0x03010000: fail("ERROR: unsupported Python3 version (should be >= 3.1)") +if 'TOR_SKIP_TEST_REBIND' in os.environ: + skip('$TOR_SKIP_TEST_REBIND is set') + control_port = pick_random_port() socks_port = pick_random_port() @@ -82,13 +89,21 @@ if not os.path.exists(sys.argv[2]): tor_path = sys.argv[1] data_dir = sys.argv[2] +empty_torrc_path = os.path.join(data_dir, 'empty_torrc') +open(empty_torrc_path, 'w').close() +empty_defaults_torrc_path = os.path.join(data_dir, 'empty_defaults_torrc') +open(empty_defaults_torrc_path, 'w').close() + tor_process = subprocess.Popen([tor_path, '-DataDirectory', data_dir, '-ControlPort', '127.0.0.1:{}'.format(control_port), '-SOCKSPort', '127.0.0.1:{}'.format(socks_port), '-Log', 'debug stdout', '-LogTimeGranularity', '1', - '-FetchServerDescriptors', '0'], + '-FetchServerDescriptors', '0', + '-f', empty_torrc_path, + '--defaults-torrc', empty_defaults_torrc_path, + ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) diff --git a/src/test/test_rebind.sh b/src/test/test_rebind.sh index 498072de35..ea2012957e 100755 --- a/src/test/test_rebind.sh +++ b/src/test/test_rebind.sh @@ -27,6 +27,6 @@ elif [ ! -d "$tmpdir" ]; then exit 3 fi -"${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/test_rebind.py" "${TESTING_TOR_BINARY}" "$tmpdir" || exitcode=1 +"${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/test_rebind.py" "${TESTING_TOR_BINARY}" "$tmpdir" -exit ${exitcode} +exit $? diff --git a/src/test/zero_length_keys.sh b/src/test/zero_length_keys.sh index 3c61f8d465..5635bdfd89 100755 --- a/src/test/zero_length_keys.sh +++ b/src/test/zero_length_keys.sh @@ -43,10 +43,11 @@ fi trap "rm -rf '$DATA_DIR'" 0 touch "$DATA_DIR"/empty_torrc +touch "$DATA_DIR"/empty_defaults_torrc # DisableNetwork means that the ORPort won't actually be opened. # 'ExitRelay 0' suppresses a warning. -TOR="${TOR_BINARY} --hush --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0 -f $DATA_DIR/empty_torrc" +TOR="${TOR_BINARY} --hush --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0 -f $DATA_DIR/empty_torrc --defaults-torrc $DATA_DIR/empty_defaults_torrc" if [ -s "$DATA_DIR"/keys/secret_id_key ] && [ -s "$DATA_DIR"/keys/secret_onion_key ] && [ -s "$DATA_DIR"/keys/secret_onion_key_ntor ]; then |