2016-11-24 13:27:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-07-28 17:44:06 +00:00
|
|
|
if [ \! -d device_tests ]; then
|
|
|
|
curl -s -L https://github.com/trezor/python-trezor/archive/master.tar.gz | tar -xvz --strip-components=2 python-trezor-master/tests/device_tests
|
2016-11-24 13:27:30 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# run emulator
|
|
|
|
|
|
|
|
cd ../src
|
2017-08-07 14:56:41 +00:00
|
|
|
../build/unix/micropython -O0 main.py >/dev/null &
|
2016-11-24 13:27:30 +00:00
|
|
|
UPY_PID=$!
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
2017-07-28 17:44:06 +00:00
|
|
|
cd ../tests/device_tests
|
2016-11-24 13:27:30 +00:00
|
|
|
|
|
|
|
error=0
|
|
|
|
|
2017-05-08 16:11:03 +00:00
|
|
|
: '
|
2017-04-16 20:21:21 +00:00
|
|
|
not passing:
|
|
|
|
|
2017-05-09 10:22:31 +00:00
|
|
|
test_bip32_speed.py \
|
|
|
|
test_debuglink.py \
|
|
|
|
test_msg_applysettings.py \
|
|
|
|
test_msg_clearsession.py \
|
2017-04-16 20:21:21 +00:00
|
|
|
test_msg_changepin.py \
|
2017-05-09 10:22:31 +00:00
|
|
|
test_msg_ethereum_signtx.py \
|
|
|
|
test_msg_getaddress_show.py \
|
|
|
|
test_msg_loaddevice_xprv.py \
|
|
|
|
test_msg_ping.py \
|
|
|
|
test_msg_resetdevice.py \
|
|
|
|
test_msg_recoverydevice.py \
|
|
|
|
test_msg_signtx_segwit.py \
|
|
|
|
test_msg_signtx_zcash.py \
|
|
|
|
test_multisig_change.py \
|
|
|
|
test_multisig.py \
|
|
|
|
test_protect_call.py \
|
|
|
|
test_protection_levels.py \
|
2017-05-08 16:11:03 +00:00
|
|
|
'
|
2017-04-16 20:21:21 +00:00
|
|
|
|
2016-11-24 13:27:30 +00:00
|
|
|
for i in \
|
2017-04-16 20:21:21 +00:00
|
|
|
test_basic.py \
|
2016-11-24 13:27:30 +00:00
|
|
|
test_msg_cipherkeyvalue.py \
|
|
|
|
test_msg_ethereum_getaddress.py \
|
|
|
|
test_msg_getaddress.py \
|
2017-05-09 10:22:31 +00:00
|
|
|
test_msg_getentropy.py \
|
2016-11-24 13:27:30 +00:00
|
|
|
test_msg_getpublickey.py \
|
2017-05-09 10:22:31 +00:00
|
|
|
test_msg_loaddevice.py \
|
2017-04-16 20:21:21 +00:00
|
|
|
test_msg_signidentity.py \
|
2016-11-24 13:27:30 +00:00
|
|
|
test_msg_signmessage.py \
|
|
|
|
test_msg_signtx.py \
|
|
|
|
test_msg_verifymessage.py \
|
2016-12-17 12:20:57 +00:00
|
|
|
test_msg_wipedevice.py \
|
2017-04-16 20:21:21 +00:00
|
|
|
test_op_return.py \
|
|
|
|
test_zerosig.py \
|
2016-11-24 13:27:30 +00:00
|
|
|
; do
|
2017-04-25 14:18:44 +00:00
|
|
|
|
2017-07-28 16:19:43 +00:00
|
|
|
if pytest -q $i ; then
|
2017-04-25 14:18:44 +00:00
|
|
|
results+=("OK $i")
|
|
|
|
else
|
|
|
|
results+=("FAIL $i")
|
|
|
|
error=1
|
2016-11-24 13:27:30 +00:00
|
|
|
fi
|
2017-04-25 14:18:44 +00:00
|
|
|
|
2016-11-24 13:27:30 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# kill emulator
|
|
|
|
kill $UPY_PID
|
|
|
|
|
2017-04-25 14:18:44 +00:00
|
|
|
echo
|
|
|
|
echo 'Summary:'
|
|
|
|
printf '%s\n' "${results[@]}"
|
2016-11-24 13:27:30 +00:00
|
|
|
exit $error
|