Skip to content
Snippets Groups Projects
Commit 032b0d25 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

arti-bench.sh: Handle the case where CHUTNEY_PATH is set.

Previously, this case would cause arti-bench to hang forever, trying
to bootstrap against one network while another network was running.
parent ba6828d9
No related branches found
No related tags found
No related merge requests found
......@@ -6,14 +6,38 @@ if [ -z "$RUST_LOG" ]; then
export RUST_LOG=info
fi
target="chutney/networks/basic"
target="networks/basic"
cd "$(git rev-parse --show-toplevel)"
[ -d chutney ] || git clone https://gitlab.torproject.org/tpo/core/chutney
./chutney/chutney configure "$target"
./chutney/chutney start "$target"
CHUTNEY_START_TIME=180 ./chutney/chutney wait_for_bootstrap "$target"
./chutney/chutney verify "$target"
cargo run -p arti-bench --release -- -c chutney/net/nodes/arti.toml "$@"
# TODO: Much of the setup logic below is boilerplate. Maybe the
# common parts of this script and setup.sh/teardown.sh should be
# extracted.
if [ -z "${CHUTNEY_PATH}" ]; then
# CHUTNEY_PATH isn't set; try cloning or updating a local chutney.
if [ -d chutney ]; then
(cd ./chutney && git pull)
else
git clone https://gitlab.torproject.org/tpo/core/chutney
fi
CHUTNEY_PATH="$(pwd)/chutney"
export CHUTNEY_PATH
else
# CHUTNEY_PATH is set; tell the user so.
echo "CHUTNEY_PATH is ${CHUTNEY_PATH}; using your local copy of chutney."
fi
if [ ! -e "${CHUTNEY_PATH}/${target}" ]; then
echo "Target network description ${CHUTNEY_PATH}/${target} not found."
exit 1
fi
"${CHUTNEY_PATH}/chutney" configure "${CHUTNEY_PATH}/$target"
"${CHUTNEY_PATH}/chutney" start "${CHUTNEY_PATH}/$target"
CHUTNEY_START_TIME=180 "${CHUTNEY_PATH}"/chutney wait_for_bootstrap "${CHUTNEY_PATH}/$target"
"${CHUTNEY_PATH}"/chutney verify "${CHUTNEY_PATH}/$target"
# TODO (end of boilerplate)
cargo run -p arti-bench --release -- -c "${CHUTNEY_PATH}/net/nodes/arti.toml" "$@"
"${CHUTNEY_PATH}"/chutney stop "${CHUTNEY_PATH}/$target"
./chutney/chutney stop "$target"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment