summaryrefslogtreecommitdiff
path: root/tests/chutney/teardown.sh
blob: ece29ddc384c47c138eb706179d8dd7e0955fba7 (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
#!/bin/bash
set -xe

cd "$(git rev-parse --show-toplevel)"

source tests/chutney/arti.run

if [ -z "${CHUTNEY_PATH}" ]; then
    # Use the default chutney path we set up before.
    CHUTNEY_PATH="$(pwd)/chutney"
    export CHUTNEY_PATH
else
    # CHUTNEY_PATH is set; tell the user about that.
    echo "CHUTNEY_PATH is ${CHUTNEY_PATH}; using your local copy of chutney."
fi


# Tolerate a failure here: even in case the arti process already died
# for some reason, we still want to shut down the chutney network.
kill -s INT "$pid" || true
# wait $pid, but $pid was started by a different process
tail --pid="$pid" -f /dev/null

"${CHUTNEY_PATH}/chutney" stop "${CHUTNEY_PATH}/$target"

source tests/chutney/arti.run
exit "$result"