1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

core/tests: fix monero runner script

This commit is contained in:
matejcik 2020-01-21 15:24:54 +01:00
parent a3d309eca2
commit 0496e49507

View File

@ -10,13 +10,17 @@ upy_pid=""
# run emulator if RUN_TEST_EMU
if [[ $RUN_TEST_EMU > 0 ]]; then
t=$(mktemp)
../emu.py \
--disable-animation \
--temporary-profile \
--headless \
--output=../../tests/trezor.log &
upy_pid=$!
trezorctl -v wait-for-emulator
--output=../../tests/trezor.log \
> $t &
trezorctl wait-for-emulator
source $t
upy_pid=$(cat $TREZOR_PROFILE_DIR/trezor.pid)
rm $t
fi
DOCKER_ID=""
@ -24,7 +28,7 @@ DOCKER_ID=""
# Test termination trap
terminate_test() {
if [[ $# > 0 ]]; then error=$1; fi
if [ -n "$upy_pid" ]; then kill -- -$upy_pid 2> /dev/null; fi
if [ -n "$upy_pid" ]; then kill $upy_pid 2> /dev/null; fi
if [ -n "$DOCKER_ID" ]; then docker kill $DOCKER_ID 2>/dev/null >/dev/null; fi
exit $error
}