/ tests / chutney / arti-bench
arti-bench
 1  #!/usr/bin/env bash
 2  set -xeuo pipefail
 3  
 4  # Set and fully resolve chutney bin if not already set.
 5  : "${CHUTNEY_BIN:=$(type -P chutney)}"
 6  if [ -z "${CHUTNEY_BIN:-}" ]; then
 7      echo "Couldn't locate chutney bin. Ensure it's on PATH or set CHUTNEY_BIN."
 8      echo "You can install with:"
 9      echo "python3 -m pip install git+https://gitlab.torproject.org/tpo/core/chutney.git"
10      exit 1
11  elif [ ! -x "$CHUTNEY_BIN" ]; then
12      echo "CHUTNEY_BIN='$CHUTNEY_BIN' doesn't exist or isn't executable"
13      exit 1
14  else
15      # CHUTNEY_BIN is set; tell the user so.
16      echo "Using chutney at '${CHUTNEY_BIN}'"
17  fi
18  
19  export CHUTNEY_DATA_DIR="${CHUTNEY_DATA_DIR:-$(pwd)}"
20  
21  if [ -z "${RUST_LOG:-}" ]; then
22      echo "Setting RUST_LOG=info for your convenience."
23      export RUST_LOG=info
24  fi
25  
26  target="basic"
27  cd "$(git rev-parse --show-toplevel)"
28  
29  ./tests/chutney/setup
30  
31  cargo run -p arti-bench --locked --release -- -c "${CHUTNEY_DATA_DIR}/nodes/arti.toml" "$@"
32  
33  "${CHUTNEY_BIN}" stop "$target"