2020-08-10 21:58:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-08-11 16:44:32 +02:00
|
|
|
####
|
|
|
|
# DO NOT EDIT THIS FILE IN MASTER. ONLY EDIT IT IN THE OLDEST SUPPORTED
|
|
|
|
# BRANCH, THEN MERGE FORWARD.
|
|
|
|
####
|
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
# This script is used to build Tor for continuous integration. It should
|
|
|
|
# be kept the same for all supported Tor versions.
|
|
|
|
#
|
|
|
|
# It's subject to the regular Tor license; see LICENSE for copying
|
|
|
|
# information.
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
|
|
|
|
# Options for this script.
|
|
|
|
DEBUG_CI="${DEBUG_CI:-no}"
|
|
|
|
COLOR_CI="${COLOR_CI:-yes}"
|
|
|
|
|
|
|
|
# Options for which CI system this is.
|
|
|
|
ON_GITLAB="${ON_GITLAB:-yes}"
|
|
|
|
|
2020-08-12 17:35:15 +02:00
|
|
|
# Options for things we usually won't want to skip.
|
|
|
|
RUN_STAGE_CONFIGURE="${RUN_STAGE_CONFIGURE:-yes}"
|
|
|
|
RUN_STAGE_BUILD="${RUN_STAGE_BUILD:-yes}"
|
|
|
|
RUN_STAGE_TEST="${RUN_STAGE_TEST:-yes}"
|
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
# Options for how to build Tor. All should be yes/no.
|
|
|
|
FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
|
|
|
|
HARDENING="${HARDENING:-no}"
|
|
|
|
COVERAGE="${COVERAGE:-no}"
|
|
|
|
DOXYGEN="${DOXYGEN:-no}"
|
|
|
|
ASCIIDOC="${ASCIIDOC:-no}"
|
2020-09-18 21:53:06 +02:00
|
|
|
TRACING="${TRACING:-no}"
|
2020-09-21 15:20:40 +02:00
|
|
|
ALL_BUGS_ARE_FATAL="${ALL_BUGS_ARE_FATAL:-no}"
|
|
|
|
DISABLE_DIRAUTH="${DISABLE_DIRAUTH:-no}"
|
|
|
|
DISABLE_RELAY="${DISABLE_RELAY:-no}"
|
|
|
|
NSS="${NSS:-no}"
|
2020-08-10 21:58:28 +02:00
|
|
|
|
|
|
|
# Options for which tests to run. All should be yes/no.
|
|
|
|
CHECK="${CHECK:-yes}"
|
|
|
|
STEM="${STEM:-no}"
|
|
|
|
CHUTNEY="${CHUTNEY:-no}"
|
|
|
|
DISTCHECK="${DISTCHECK:-no}"
|
|
|
|
|
|
|
|
# Options for where the Tor source is.
|
|
|
|
CI_SRCDIR="${CI_SRCDIR:-.}"
|
|
|
|
|
|
|
|
# Options for where to build.
|
|
|
|
CI_BUILDDIR="${CI_BUILDDIR:-./build}"
|
|
|
|
|
|
|
|
# How parallel should we run make?
|
|
|
|
MAKE_J_OPT="${MAKE_J_OPT:--j4}"
|
|
|
|
# Should we stop after make finds an error?
|
|
|
|
MAKE_K_OPT="${MAKE_K_OPT:--k}"
|
|
|
|
|
|
|
|
# What make target should we use for chutney?
|
|
|
|
CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
|
|
|
|
|
|
|
|
# Where do we find our additional testing tools?
|
|
|
|
CHUTNEY_PATH="${CHUTNEY_PATH:-}"
|
|
|
|
STEM_PATH="${STEM_PATH:-}"
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# Preliminary functions.
|
|
|
|
|
|
|
|
# Terminal coloring/emphasis stuff.
|
|
|
|
if [[ "${COLOR_CI}" == "yes" ]]; then
|
|
|
|
T_RED=$(tput setaf 1 || true)
|
|
|
|
T_GREEN=$(tput setaf 2 || true)
|
2020-08-12 18:13:56 +02:00
|
|
|
T_YELLOW=$(tput setaf 3 || true)
|
2020-08-10 21:58:28 +02:00
|
|
|
T_DIM=$(tput dim || true)
|
|
|
|
T_BOLD=$(tput bold || true)
|
|
|
|
T_RESET=$(tput sgr0 || true)
|
|
|
|
else
|
|
|
|
T_RED=
|
|
|
|
T_GREEN=
|
2020-08-12 18:13:56 +02:00
|
|
|
T_YELLOW=
|
2020-08-10 21:58:28 +02:00
|
|
|
T_DIM=
|
|
|
|
T_BOLD=
|
|
|
|
T_RESET=
|
|
|
|
fi
|
|
|
|
|
|
|
|
function error()
|
|
|
|
{
|
|
|
|
echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
|
|
|
|
}
|
2022-01-06 21:25:30 +01:00
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
function die()
|
|
|
|
{
|
|
|
|
echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
|
|
|
|
exit 1
|
|
|
|
}
|
2020-08-12 18:13:56 +02:00
|
|
|
|
|
|
|
function skipping()
|
|
|
|
{
|
|
|
|
echo "${T_BOLD}${T_YELLOW}Skipping $*${T_RESET}"
|
|
|
|
}
|
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
function hooray()
|
|
|
|
{
|
|
|
|
echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [[ "${DEBUG_CI}" == "yes" ]]; then
|
|
|
|
function debug()
|
|
|
|
{
|
|
|
|
echo "${T_DIM}(debug): $*${T_RESET}"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
function debug()
|
|
|
|
{
|
|
|
|
:
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
function yes_or_no()
|
|
|
|
{
|
|
|
|
local varname="$1"
|
|
|
|
local value="${!varname}"
|
|
|
|
debug "${varname} is ${value}"
|
|
|
|
if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
|
|
|
|
die "${varname} must be 'yes' or 'no'. Got unexpected value ${value}".
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function incompatible()
|
|
|
|
{
|
|
|
|
local varname1="$1"
|
|
|
|
local varname2="$2"
|
|
|
|
local val1="${!varname1}"
|
|
|
|
local val2="${!varname2}"
|
|
|
|
if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
|
|
|
|
die "Cannot set both ${varname1} and ${varname2}: they are incompatible."
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function runcmd()
|
|
|
|
{
|
|
|
|
echo "${T_BOLD}\$ $*${T_RESET}"
|
|
|
|
if ! "$@" ; then
|
|
|
|
error "command '$*' has failed."
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_git_version()
|
|
|
|
{
|
|
|
|
local tool="$1"
|
|
|
|
local dir="$2"
|
|
|
|
local version="?????"
|
|
|
|
if [[ -e "$dir/.git" ]] ; then
|
|
|
|
version=$(cd "$dir"; git rev-parse HEAD)
|
|
|
|
fi
|
|
|
|
echo "${T_BOLD}$tool:${T_RESET} $version"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [[ "${ON_GITLAB}" == "yes" ]]; then
|
|
|
|
function start_section()
|
|
|
|
{
|
2022-01-06 21:25:30 +01:00
|
|
|
local label="$1"
|
|
|
|
local stamp
|
|
|
|
stamp=$(date +%s)
|
|
|
|
printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
|
|
|
|
echo "${T_BOLD}${T_GREEN}========= $label${T_RESET}"
|
2020-08-10 21:58:28 +02:00
|
|
|
}
|
|
|
|
function end_section()
|
|
|
|
{
|
2022-01-06 21:25:30 +01:00
|
|
|
local label="$1"
|
|
|
|
local stamp
|
|
|
|
stamp=$(date +%s)
|
|
|
|
printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
|
2020-08-10 21:58:28 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
function start_section()
|
|
|
|
{
|
2022-01-06 21:25:30 +01:00
|
|
|
true
|
2020-08-10 21:58:28 +02:00
|
|
|
}
|
|
|
|
function end_section()
|
|
|
|
{
|
2022-01-06 21:25:30 +01:00
|
|
|
true
|
2020-08-10 21:58:28 +02:00
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# Validate inputs.
|
|
|
|
|
|
|
|
debug Validating inputs
|
|
|
|
yes_or_no DEBUG_CI
|
|
|
|
yes_or_no COLOR_CI
|
|
|
|
yes_or_no ON_GITLAB
|
|
|
|
yes_or_no FATAL_WARNINGS
|
|
|
|
yes_or_no HARDENING
|
|
|
|
yes_or_no COVERAGE
|
|
|
|
yes_or_no DOXYGEN
|
|
|
|
yes_or_no ASCIIDOC
|
2020-09-18 21:53:06 +02:00
|
|
|
yes_or_no TRACING
|
2020-09-21 15:20:40 +02:00
|
|
|
yes_or_no ALL_BUGS_ARE_FATAL
|
|
|
|
yes_or_no DISABLE_DIRAUTH
|
|
|
|
yes_or_no DISABLE_RELAY
|
|
|
|
yes_or_no NSS
|
2020-08-10 21:58:28 +02:00
|
|
|
|
2020-08-12 17:35:15 +02:00
|
|
|
yes_or_no RUN_STAGE_CONFIGURE
|
|
|
|
yes_or_no RUN_STAGE_BUILD
|
|
|
|
yes_or_no RUN_STAGE_TEST
|
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
yes_or_no CHECK
|
|
|
|
yes_or_no STEM
|
|
|
|
yes_or_no DISTCHECK
|
|
|
|
|
|
|
|
incompatible DISTCHECK CHECK
|
|
|
|
incompatible DISTCHECK CHUTNEY
|
|
|
|
incompatible DISTCHECK STEM
|
|
|
|
incompatible DISTCHECK COVERAGE
|
|
|
|
incompatible DISTCHECK DOXYGEN
|
|
|
|
|
|
|
|
if [[ "${CHUTNEY}" = yes && "${CHUTNEY_PATH}" = '' ]] ; then
|
|
|
|
die "CHUTNEY is set to 'yes', but CHUTNEY_PATH was not specified."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${STEM}" = yes && "${STEM_PATH}" = '' ]] ; then
|
|
|
|
die "STEM is set to 'yes', but STEM_PATH was not specified."
|
|
|
|
fi
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# Set up options for make and configure.
|
|
|
|
|
|
|
|
make_options=()
|
|
|
|
if [[ "$MAKE_J_OPT" != "" ]]; then
|
|
|
|
make_options+=("$MAKE_J_OPT")
|
|
|
|
fi
|
|
|
|
if [[ "$MAKE_K_OPT" != "" ]]; then
|
|
|
|
make_options+=("$MAKE_K_OPT")
|
|
|
|
fi
|
|
|
|
|
|
|
|
configure_options=()
|
|
|
|
if [[ "$FATAL_WARNINGS" == "yes" ]]; then
|
|
|
|
configure_options+=("--enable-fatal-warnings")
|
|
|
|
fi
|
|
|
|
if [[ "$HARDENING" == "yes" ]]; then
|
|
|
|
configure_options+=("--enable-fragile-hardening")
|
|
|
|
fi
|
|
|
|
if [[ "$COVERAGE" == "yes" ]]; then
|
|
|
|
configure_options+=("--enable-coverage")
|
|
|
|
fi
|
|
|
|
if [[ "$ASCIIDOC" != "yes" ]]; then
|
|
|
|
configure_options+=("--disable-asciidoc")
|
|
|
|
fi
|
2020-09-18 21:53:06 +02:00
|
|
|
if [[ "$TRACING" == "yes" ]]; then
|
|
|
|
configure_options+=("--enable-tracing-instrumentation-lttng")
|
|
|
|
fi
|
2020-09-21 15:20:40 +02:00
|
|
|
if [[ "$ALL_BUGS_ARE_FATAL" == "yes" ]]; then
|
|
|
|
configure_options+=("--enable-all-bugs-are-fatal")
|
|
|
|
fi
|
|
|
|
if [[ "$DISABLE_DIRAUTH" == "yes" ]]; then
|
|
|
|
configure_options+=("--disable-module-dirauth")
|
|
|
|
fi
|
|
|
|
if [[ "$DISABLE_RELAY" == "yes" ]]; then
|
|
|
|
configure_options+=("--disable-module-relay")
|
|
|
|
fi
|
|
|
|
if [[ "$NSS" == "yes" ]]; then
|
|
|
|
configure_options+=("--enable-nss")
|
|
|
|
fi
|
2020-08-10 21:58:28 +02:00
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# Tell the user about our versions of different tools and packages.
|
|
|
|
|
|
|
|
uname -a
|
2020-08-11 18:24:03 +02:00
|
|
|
printf "python: "
|
2020-08-10 21:58:28 +02:00
|
|
|
python -V || echo "no 'python' binary."
|
2020-08-11 18:24:03 +02:00
|
|
|
printf "python3: "
|
2020-08-11 17:03:11 +02:00
|
|
|
python3 -V || echo "no 'python3' binary."
|
2020-08-10 21:58:28 +02:00
|
|
|
|
|
|
|
show_git_version Tor "${CI_SRCDIR}"
|
|
|
|
if [[ "${STEM}" = "yes" ]]; then
|
|
|
|
show_git_version Stem "${STEM_PATH}"
|
|
|
|
fi
|
|
|
|
if [[ "${CHUTNEY}" = "yes" ]]; then
|
|
|
|
show_git_version Chutney "${CHUTNEY_PATH}"
|
|
|
|
fi
|
|
|
|
|
2020-08-11 18:22:35 +02:00
|
|
|
#############################################################################
|
|
|
|
# Determine the version of Tor.
|
|
|
|
|
2021-11-03 14:47:30 +01:00
|
|
|
TOR_VERSION=$(grep -m 1 AC_INIT "${CI_SRCDIR}"/configure.ac | sed -e 's/.*\[//; s/\].*//;')
|
2020-08-11 18:22:35 +02:00
|
|
|
|
|
|
|
# Use variables like these when we need to behave differently depending on
|
|
|
|
# Tor version. Only create the variables we need.
|
|
|
|
TOR_VER_AT_LEAST_043=no
|
2020-08-13 02:13:18 +02:00
|
|
|
TOR_VER_AT_LEAST_044=no
|
2020-08-11 18:22:35 +02:00
|
|
|
|
|
|
|
# These are the currently supported Tor versions; no need to work with anything
|
|
|
|
# ancient in this script.
|
|
|
|
case "$TOR_VERSION" in
|
2022-04-27 17:06:03 +02:00
|
|
|
0.4.7.*)
|
|
|
|
TOR_VER_AT_LEAST_043=yes
|
|
|
|
TOR_VER_AT_LEAST_044=yes
|
|
|
|
;;
|
2020-08-11 18:22:35 +02:00
|
|
|
esac
|
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
#############################################################################
|
|
|
|
# Make sure the directories are all there.
|
|
|
|
|
|
|
|
# Make sure CI_SRCDIR exists and has a file we expect.
|
|
|
|
if [[ ! -d "$CI_SRCDIR" ]] ; then
|
|
|
|
die "CI_SRCDIR=${CI_SRCDIR} is not a directory"
|
|
|
|
fi
|
|
|
|
if [[ ! -f "$CI_SRCDIR/src/core/or/or.h" ]] ; then
|
|
|
|
die "CI_SRCDIR=${CI_SRCDIR} does not look like a Tor directory."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Make CI_SRCDIR absolute.
|
|
|
|
CI_SRCDIR=$(cd "$CI_SRCDIR" && pwd)
|
|
|
|
|
|
|
|
# Create an "artifacts" directory to copy artifacts into.
|
|
|
|
mkdir -p ./artifacts
|
|
|
|
|
|
|
|
if [[ "$RUN_STAGE_CONFIGURE" = "yes" ]]; then
|
|
|
|
|
|
|
|
start_section "Autogen"
|
|
|
|
runcmd cd "${CI_SRCDIR}"
|
|
|
|
runcmd ./autogen.sh
|
|
|
|
runcmd mkdir -p "${CI_BUILDDIR}"
|
|
|
|
runcmd cd "${CI_BUILDDIR}"
|
|
|
|
end_section "Autogen"
|
|
|
|
|
|
|
|
# make the builddir absolute too.
|
|
|
|
CI_BUILDDIR=$(pwd)
|
|
|
|
|
|
|
|
start_section "Configure"
|
|
|
|
if ! runcmd "${CI_SRCDIR}"/configure "${configure_options[@]}" ; then
|
2022-01-06 21:25:30 +01:00
|
|
|
error "Here is the end of config.log:"
|
|
|
|
runcmd tail config.log
|
|
|
|
die "Unable to continue"
|
2020-08-10 21:58:28 +02:00
|
|
|
fi
|
|
|
|
end_section "Configure"
|
|
|
|
else
|
|
|
|
debug "Skipping configure stage. Making sure that ${CI_BUILDDIR}/config.log exists."
|
|
|
|
if [[ ! -d "${CI_BUILDDIR}" ]]; then
|
2022-01-06 21:25:30 +01:00
|
|
|
die "Build directory ${CI_BUILDDIR} did not exist!"
|
2020-08-10 21:58:28 +02:00
|
|
|
fi
|
|
|
|
if [[ ! -f "${CI_BUILDDIR}/config.log" ]]; then
|
2022-01-06 21:25:30 +01:00
|
|
|
die "Tor was not configured in ${CI_BUILDDIR}!"
|
2020-08-10 21:58:28 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
cp config.log "${CI_SRCDIR}"/artifacts
|
|
|
|
|
|
|
|
runcmd cd "${CI_BUILDDIR}"
|
|
|
|
CI_BUILDDIR=$(pwd)
|
|
|
|
fi
|
|
|
|
|
|
|
|
###############################
|
|
|
|
# Build Tor.
|
|
|
|
|
|
|
|
if [[ "$RUN_STAGE_BUILD" = "yes" ]] ; then
|
|
|
|
if [[ "$DISTCHECK" = "no" ]]; then
|
2022-01-06 21:25:30 +01:00
|
|
|
start_section "Build"
|
|
|
|
runcmd make "${make_options[@]}" all
|
2020-08-10 21:58:28 +02:00
|
|
|
cp src/app/tor "${CI_SRCDIR}"/artifacts
|
2022-01-06 21:25:30 +01:00
|
|
|
end_section "Build"
|
2020-08-10 21:58:28 +02:00
|
|
|
else
|
2022-01-06 21:25:30 +01:00
|
|
|
export DISTCHECK_CONFIGURE_FLAGS="${configure_options[*]}"
|
|
|
|
# XXXX Set make options?
|
|
|
|
start_section Distcheck
|
|
|
|
if runcmd make "${make_options[@]}" distcheck ; then
|
2020-08-10 21:58:28 +02:00
|
|
|
hooray "Distcheck was successful. Nothing further will be done."
|
|
|
|
# We have to exit early here, since we can't do any other tests.
|
|
|
|
cp tor-*.tar.gz "${CI_SRCDIR}"/artifacts
|
2022-01-06 21:25:30 +01:00
|
|
|
else
|
2020-08-10 21:58:28 +02:00
|
|
|
error "Diagnostics:"
|
|
|
|
runcmd make show-distdir-testlog || true
|
|
|
|
runcmd make show-distdir-core || true
|
|
|
|
die "Unable to continue."
|
2022-01-06 21:25:30 +01:00
|
|
|
fi
|
|
|
|
end_section Distcheck
|
2023-01-10 15:11:52 +01:00
|
|
|
exit 0
|
2020-08-10 21:58:28 +02:00
|
|
|
fi
|
|
|
|
fi
|
2020-08-12 17:35:15 +02:00
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
##############################
|
|
|
|
# Run tests.
|
|
|
|
|
|
|
|
if [[ "$RUN_STAGE_TEST" == "no" ]]; then
|
|
|
|
echo "Skipping tests. Exiting now."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
FAILED_TESTS=""
|
|
|
|
|
2020-08-12 18:13:56 +02:00
|
|
|
if [[ "${DOXYGEN}" = 'yes' ]]; then
|
2020-08-10 21:58:28 +02:00
|
|
|
start_section Doxygen
|
2020-08-12 18:13:56 +02:00
|
|
|
if [[ "${TOR_VER_AT_LEAST_043}" = 'yes' ]]; then
|
|
|
|
if runcmd make doxygen; then
|
2022-01-06 21:25:30 +01:00
|
|
|
hooray "make doxygen has succeeded."
|
2020-08-12 18:13:56 +02:00
|
|
|
else
|
2022-01-06 21:25:30 +01:00
|
|
|
FAILED_TESTS="${FAILED_TESTS} doxygen"
|
2020-08-12 18:13:56 +02:00
|
|
|
fi
|
2020-08-10 21:58:28 +02:00
|
|
|
else
|
2020-08-12 18:13:56 +02:00
|
|
|
skipping "make doxygen: doxygen is broken for Tor < 0.4.3"
|
2020-08-10 21:58:28 +02:00
|
|
|
fi
|
|
|
|
end_section Doxygen
|
|
|
|
fi
|
|
|
|
|
2020-08-12 17:35:15 +02:00
|
|
|
if [[ "${ASCIIDOC}" = 'yes' ]]; then
|
|
|
|
start_section Asciidoc
|
|
|
|
if runcmd make manpages; then
|
|
|
|
hooray "make manpages has succeeded."
|
|
|
|
else
|
|
|
|
FAILED_TESTS="${FAILED_TESTS} asciidoc"
|
|
|
|
fi
|
|
|
|
end_section Asciidoc
|
|
|
|
fi
|
|
|
|
|
2020-08-10 21:58:28 +02:00
|
|
|
if [[ "${CHECK}" = "yes" ]]; then
|
|
|
|
start_section "Check"
|
|
|
|
if runcmd make "${make_options[@]}" check; then
|
|
|
|
hooray "make check has succeeded."
|
|
|
|
else
|
|
|
|
error "Here are the contents of the test suite output:"
|
2020-08-11 17:03:11 +02:00
|
|
|
runcmd cat test-suite.log || true
|
2020-08-10 21:58:28 +02:00
|
|
|
FAILED_TESTS="${FAILED_TESTS} check"
|
|
|
|
fi
|
|
|
|
end_section "Check"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${CHUTNEY}" = "yes" ]]; then
|
|
|
|
start_section "Chutney"
|
2020-08-12 15:38:19 +02:00
|
|
|
export CHUTNEY_TOR_SANDBOX=0
|
|
|
|
export CHUTNEY_ALLOW_FAILURES=2
|
2021-10-14 17:39:10 +02:00
|
|
|
# Send 5MB for every verify check.
|
|
|
|
export CHUTNEY_DATA_BYTES=5000000
|
2020-08-10 21:58:28 +02:00
|
|
|
if runcmd make "${CHUTNEY_MAKE_TARGET}"; then
|
|
|
|
hooray "Chutney tests have succeeded"
|
|
|
|
else
|
|
|
|
error "Chutney says:"
|
2020-08-12 15:38:19 +02:00
|
|
|
export CHUTNEY_DATA_DIR="${CHUTNEY_PATH}/net"
|
2020-08-10 21:58:28 +02:00
|
|
|
runcmd "${CHUTNEY_PATH}"/tools/diagnostics.sh || true
|
|
|
|
# XXXX These next two should be part of a make target.
|
|
|
|
runcmd ls test_network_log || true
|
2022-03-28 21:43:31 +02:00
|
|
|
runcmd head -n -0 test_network_log/* || true
|
2020-08-10 21:58:28 +02:00
|
|
|
FAILED_TESTS="${FAILED_TESTS} chutney"
|
|
|
|
fi
|
|
|
|
end_section "Chutney"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${STEM}" = "yes" ]]; then
|
2022-01-06 21:25:30 +01:00
|
|
|
start_section "Stem"
|
|
|
|
# 0.3.5 and onward have now disabled onion service v2 so we need to exclude
|
|
|
|
# these Stem tests from now on.
|
|
|
|
EXCLUDE_TESTS="--exclude-test control.controller.test_ephemeral_hidden_services_v2 --exclude-test control.controller.test_hidden_services_conf --exclude-test control.controller.test_with_ephemeral_hidden_services_basic_auth --exclude-test control.controller.test_without_ephemeral_hidden_services --exclude-test control.controller.test_with_ephemeral_hidden_services_basic_auth_no_credentials"
|
|
|
|
if [[ "${TOR_VER_AT_LEAST_044}" = 'yes' ]]; then
|
|
|
|
# XXXX This should probably be part of some test-stem make target.
|
|
|
|
|
|
|
|
# Disable the check around EXCLUDE_TESTS that requires double quote. We
|
|
|
|
# need it to be expanded.
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
if runcmd timelimit -p -t 520 -s USR1 -T 30 -S ABRT \
|
|
|
|
python3 "${STEM_PATH}/run_tests.py" \
|
|
|
|
--tor src/app/tor \
|
|
|
|
--integ --test control.controller \
|
|
|
|
$EXCLUDE_TESTS \
|
|
|
|
--test control.base_controller \
|
|
|
|
--test process \
|
|
|
|
--log TRACE \
|
|
|
|
--log-file stem.log ; then
|
|
|
|
hooray "Stem tests have succeeded"
|
|
|
|
else
|
|
|
|
error "Stem output:"
|
|
|
|
runcmd tail -1000 "${STEM_PATH}"/test/data/tor_log
|
|
|
|
runcmd grep -v "SocketClosed" stem.log | tail -1000
|
|
|
|
FAILED_TESTS="${FAILED_TESTS} stem"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
skipping "Stem: broken with <= 0.4.3. See bug tor#40077"
|
|
|
|
fi
|
|
|
|
end_section "Stem"
|
2020-08-10 21:58:28 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# TODO: Coverage
|
|
|
|
|
|
|
|
if [[ "${FAILED_TESTS}" != "" ]]; then
|
|
|
|
die "Failed tests: ${FAILED_TESTS}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
hooray "Everything seems fine."
|