summaryrefslogtreecommitdiff
path: root/tests/chutney/setup.sh
blob: d44c1a433c7ced47b1796959c53ed5a96cafc1a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -xe

target="${1:-chutney/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"


if [ -x ./target/x86_64-unknown-linux-gnu/debug/arti ]; then
	cmd=./target/x86_64-unknown-linux-gnu/debug/arti
else
	cargo build
	cmd=./target/debug/arti
fi

(
	set +e
	"$cmd" proxy -c chutney/net/nodes/arti.toml &
	pid=$!
	echo "target=$target" > tests/chutney/arti.run
	echo "pid=$pid" >> tests/chutney/arti.run
	wait "$pid"
	echo "result=$?" >> tests/chutney/arti.run
) & disown
sleep 5