2016-11-24 13:27:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -d python-trezor ]; then
|
|
|
|
cd python-trezor ; git pull ; cd ..
|
|
|
|
else
|
|
|
|
git clone https://github.com/trezor/python-trezor.git
|
|
|
|
fi
|
|
|
|
|
|
|
|
# run emulator
|
|
|
|
|
|
|
|
cd ../src
|
|
|
|
../vendor/micropython/unix/micropython -O0 main.py &
|
|
|
|
UPY_PID=$!
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
2016-12-08 15:31:25 +00:00
|
|
|
cd ../tests/python-trezor/tests/device_tests
|
|
|
|
export PYTHONPATH="../.."
|
2016-11-24 13:27:30 +00:00
|
|
|
|
|
|
|
error=0
|
|
|
|
|
2016-12-08 15:31:25 +00:00
|
|
|
PYTHON="${PYTHON:-python2}"
|
|
|
|
|
2016-11-24 13:27:30 +00:00
|
|
|
for i in \
|
|
|
|
test_msg_cipherkeyvalue.py \
|
|
|
|
test_msg_estimatetxsize.py \
|
|
|
|
test_msg_ethereum_getaddress.py \
|
|
|
|
test_msg_getaddress.py \
|
|
|
|
test_msg_getpublickey.py \
|
|
|
|
test_msg_signmessage.py \
|
|
|
|
test_msg_signtx.py \
|
|
|
|
test_msg_verifymessage.py \
|
2016-12-17 12:20:57 +00:00
|
|
|
test_msg_wipedevice.py \
|
|
|
|
test_msg_changepin.py \
|
2016-11-24 13:27:30 +00:00
|
|
|
; do
|
2016-12-08 15:31:25 +00:00
|
|
|
if ! $PYTHON $i ; then
|
2016-11-24 13:27:30 +00:00
|
|
|
error=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# kill emulator
|
|
|
|
kill $UPY_PID
|
|
|
|
|
|
|
|
exit $error
|