test-release.sh 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. #!/bin/bash
  2. # Tested on Linux, MSys2
  3. trap 'echo -e "${GREEN}Exiting at user request$RESET"; exit' INT
  4. umask 0022
  5. export MMGEN_TEST_SUITE=1
  6. export MMGEN_NO_LICENSE=1
  7. export PYTHONPATH=.
  8. test_py='test/test.py -n'
  9. objtest_py='test/objtest.py'
  10. unit_tests_py='test/unit_tests.py --names --quiet'
  11. tooltest_py='test/tooltest.py'
  12. tooltest2_py='test/tooltest2.py --names'
  13. gentest_py='test/gentest.py'
  14. scrambletest_py='test/scrambletest.py'
  15. mmgen_tool='cmds/mmgen-tool'
  16. mmgen_keygen='cmds/mmgen-keygen'
  17. python='python3'
  18. rounds=100 rounds_min=20 rounds_mid=250 rounds_max=500
  19. monero_addrs='3,99,2,22-24,101-104'
  20. dfl_tests='obj unit hash alts monero eth autosign btc btc_tn btc_rt bch bch_rt ltc ltc_tn ltc_rt tool tool2 gen'
  21. add_tests='autosign_minimal autosign_live'
  22. PROGNAME=$(basename $0)
  23. while getopts hbCfiIlOpRtvV OPT
  24. do
  25. case "$OPT" in
  26. h) printf " %-16s Test MMGen release\n" "${PROGNAME}:"
  27. echo " USAGE: $PROGNAME [options] [tests]"
  28. echo " OPTIONS: '-h' Print this help message"
  29. echo " '-b' Buffer keypresses for all invocations of 'test/test.py'"
  30. echo " '-C' Run tests in coverage mode"
  31. echo " '-f' Speed up the tests by using fewer rounds"
  32. echo " '-i' Create and install Python package, then run tests. A branch"
  33. echo " must be supplied as the first argument"
  34. echo " '-I' Install the package only; don't run tests"
  35. echo " '-l' List the test name symbols"
  36. echo " '-O' Use pexpect.spawn rather than popen_spawn for applicable tests"
  37. echo " '-p' Pause between tests"
  38. echo " '-R' Don't remove temporary files after program has exited"
  39. echo " '-t' Print the tests without running them"
  40. echo " '-v' Run test/test.py with '--exact-output' and other commands with"
  41. echo " '--verbose' switch"
  42. echo " '-V' Run test/test.py and other commands with '--verbose' switch"
  43. echo " AVAILABLE TESTS:"
  44. echo " obj - data objects"
  45. echo " unit - unit tests"
  46. echo " hash - internal hash function implementations"
  47. echo " alts - operations for all supported gen-only altcoins"
  48. echo " monero - operations for Monero"
  49. echo " eth - operations for Ethereum"
  50. echo " autosign - autosign"
  51. echo " btc - bitcoin"
  52. echo " btc_tn - bitcoin testnet"
  53. echo " btc_rt - bitcoin regtest"
  54. echo " bch - bitcoin cash (BCH)"
  55. echo " bch_rt - bitcoin cash (BCH) regtest"
  56. echo " ltc - litecoin"
  57. echo " ltc_tn - litecoin testnet"
  58. echo " ltc_rt - litecoin regtest"
  59. echo " tool - tooltest (all supported coins)"
  60. echo " tool2 - tooltest2 (all supported coins)"
  61. echo " gen - gentest (all supported coins)"
  62. echo " By default, all tests are run"
  63. exit ;;
  64. b) test_py+=" --buf-keypress" ;;
  65. C) mkdir -p 'test/trace'
  66. touch 'test/trace.acc'
  67. test_py+=" --coverage"
  68. tooltest_py+=" --coverage"
  69. tooltest2_py+=" --fork --coverage"
  70. scrambletest_py+=" --coverage"
  71. python="python3 -m trace --count --file=test/trace.acc --coverdir=test/trace"
  72. unit_tests_py="$python $unit_tests_py"
  73. objtest_py="$python $objtest_py"
  74. gentest_py="$python $gentest_py"
  75. mmgen_tool="$python $mmgen_tool"
  76. mmgen_keygen="$python $mmgen_keygen" ;&
  77. f) rounds=10 rounds_min=3 rounds_mid=25 rounds_max=50 monero_addrs='3,23' unit_tests_py+=" --fast" ;;
  78. i) INSTALL=1 ;;
  79. I) INSTALL_ONLY=1 ;;
  80. l) echo -e "Default tests:\n $dfl_tests"
  81. echo -e "Additional tests:\n $add_tests"
  82. exit ;;
  83. O) test_py+=" --pexpect-spawn" ;;
  84. p) PAUSE=1 ;;
  85. R) NO_TMPFILE_REMOVAL=1 ;;
  86. t) TESTING=1 ;;
  87. v) EXACT_OUTPUT=1 test_py+=" --exact-output" ;&
  88. V) VERBOSE=1 [ "$EXACT_OUTPUT" ] || test_py+=" --verbose"
  89. tooltest_py+=" --verbose" tooltest2_py+=" --verbose"
  90. gentest_py+=" --verbose" mmgen_tool+=" --verbose"
  91. unit_tests_py="${unit_tests_py/--quiet/--verbose}"
  92. scrambletest_py+=" --verbose" ;;
  93. *) exit ;;
  94. esac
  95. done
  96. [ "$EXACT_OUTPUT" -o "$VERBOSE" ] || objtest_py+=" -S"
  97. shift $((OPTIND-1))
  98. REFDIR='test/ref'
  99. if uname -a | grep -qi mingw; then SUDO='' MINGW=1; else SUDO='sudo' MINGW=''; fi
  100. [ "$MINGW" ] || RED="\e[31;1m" GREEN="\e[32;1m" YELLOW="\e[33;1m" RESET="\e[0m"
  101. [ "$INSTALL" ] && {
  102. BRANCH=$1; shift
  103. BRANCHES=$(git branch)
  104. FOUND_BRANCH=$(for b in ${BRANCHES/\*}; do [ "$b" == "$BRANCH" ] && echo ok; done)
  105. [ "$FOUND_BRANCH" ] || { echo "Branch '$BRANCH' not found!"; exit; }
  106. }
  107. set -e
  108. check() {
  109. [ "$BRANCH" ] || { echo 'No branch specified. Exiting'; exit; }
  110. [ "$(git diff $BRANCH)" == "" ] || {
  111. echo "Unmerged changes from branch '$BRANCH'. Exiting"
  112. exit
  113. }
  114. git diff $BRANCH >/dev/null 2>&1 || exit
  115. }
  116. uninstall() {
  117. set +e
  118. eval "$SUDO ./scripts/uninstall-mmgen.py"
  119. [ "$?" -ne 0 ] && { echo 'Uninstall failed, but proceeding anyway'; sleep 1; }
  120. set -e
  121. }
  122. install() {
  123. set -x
  124. eval "$SUDO rm -rf .test-release"
  125. git clone --branch $BRANCH --single-branch . .test-release
  126. (
  127. cd .test-release
  128. ./setup.py sdist
  129. mkdir pydist && cd pydist
  130. if [ "$MINGW" ]; then unzip ../dist/mmgen-*.zip; else tar zxvf ../dist/mmgen-*gz; fi
  131. cd mmgen-*
  132. eval "$SUDO ./setup.py clean --all"
  133. [ "$MINGW" ] && ./setup.py build --compiler=mingw32
  134. eval "$SUDO ./setup.py install --force"
  135. )
  136. set +x
  137. }
  138. do_test() {
  139. set +x
  140. tests=$(eval echo \"'$'"t_$1"\")
  141. skips=$(eval echo \"'$'"t_$1_skip"\")
  142. declare -a tests_arr
  143. n=0
  144. while read test; do
  145. tests_arr[n]="$test"
  146. let n+=1
  147. done <<-EOF
  148. $tests
  149. EOF
  150. n=0
  151. for test in "${tests_arr[@]}"; do
  152. [ -z "$test" -o "${test:0:1}" == '#' ] && continue
  153. let n+=1
  154. echo $skips | grep -q "\<$n\>" && continue
  155. echo -e "${GREEN}Running:$RESET $YELLOW$test$RESET"
  156. # continue
  157. [ "$TESTING" ] || eval "$test" || {
  158. echo -e $RED"Test '$CUR_TEST' failed at command '$test'"$RESET
  159. exit
  160. }
  161. done
  162. }
  163. i_obj='Data object'
  164. s_obj='Testing data objects'
  165. t_obj="
  166. $objtest_py --coin=btc
  167. $objtest_py --coin=btc --testnet=1
  168. $objtest_py --coin=ltc
  169. $objtest_py --coin=ltc --testnet=1
  170. "
  171. f_obj='Data object test complete'
  172. i_unit='Unit'
  173. s_unit='Running unit'
  174. t_unit="$unit_tests_py"
  175. f_unit='Unit tests run complete'
  176. i_hash='Internal hash function implementations'
  177. s_hash='Testing internal hash function implementations'
  178. t_hash="
  179. $python test/hashfunc.py sha256 $rounds_max
  180. $python test/hashfunc.py sha512 $rounds_max
  181. $python test/hashfunc.py keccak $rounds_max
  182. "
  183. f_hash='Hash function tests complete'
  184. i_alts='Gen-only altcoin'
  185. s_alts='The following tests will test generation operations for all supported altcoins'
  186. t_alts="
  187. $scrambletest_py
  188. $test_py ref_altcoin # generated addrfiles verified against checksums
  189. $gentest_py --all 2:keyconv $rounds_mid
  190. # speed tests, no verification
  191. $gentest_py --coin=btc 2 $rounds
  192. $gentest_py --coin=btc --type=compressed 2 $rounds
  193. $gentest_py --coin=btc --type=segwit 2 $rounds
  194. $gentest_py --coin=btc --type=bech32 2 $rounds
  195. $gentest_py --coin=ltc 2 $rounds
  196. $gentest_py --coin=ltc --type=compressed 2 $rounds
  197. $gentest_py --coin=ltc --type=segwit 2 $rounds
  198. $gentest_py --coin=ltc --type=bech32 2 $rounds
  199. $gentest_py --coin=etc 2 $rounds
  200. $gentest_py --coin=etc --use-internal-keccak-module 2 $rounds_min
  201. $gentest_py --coin=eth 2 $rounds
  202. $gentest_py --coin=eth --use-internal-keccak-module 2 $rounds_min
  203. $gentest_py --coin=xmr 2 $rounds
  204. $gentest_py --coin=xmr --use-internal-keccak-module 2 $rounds_min
  205. $gentest_py --coin=zec 2 $rounds
  206. "
  207. # disabled, pycoin generates old-style LTC Segwit addrs:
  208. # $gentest_py --coin=ltc --type=segwit 2:ext $rounds
  209. # disabled, no pyethereum:
  210. # $gentest_py --coin=etc 2:ext $rounds
  211. # $gentest_py --coin=eth 2:ext $rounds
  212. # $gentest_py --all 2:pyethereum $rounds
  213. [ "$MINGW" ] || {
  214. t_alts="$t_alts
  215. $gentest_py --coin=zec --type=zcash_z 2 $rounds_mid
  216. $gentest_py --coin=zec --type=zcash_z 2:ext $rounds_mid
  217. $gentest_py --all 2:zcash_mini $rounds_mid
  218. $gentest_py --all 2:pycoin $rounds
  219. $gentest_py --coin=btc 2:ext $rounds
  220. $gentest_py --coin=btc --type=compressed 2:ext $rounds
  221. $gentest_py --coin=btc --type=segwit 2:ext $rounds
  222. $gentest_py --coin=ltc 2:ext $rounds
  223. $gentest_py --coin=ltc --type=compressed 2:ext $rounds
  224. $gentest_py --coin=zec 2:ext $rounds
  225. "
  226. }
  227. f_alts='Gen-only altcoin tests completed'
  228. [ "$NO_TMPFILE_REMOVAL" ] || rm -rf /tmp/mmgen-test-release*
  229. if [ "$MINGW" ]; then
  230. TMPDIR='/tmp/mmgen-test-release'
  231. else
  232. TMPDIR='/tmp/mmgen-test-release-'$(cat /dev/urandom | base32 - | head -n1 | cut -b 1-16)
  233. fi
  234. mkdir -p $TMPDIR
  235. i_monero='Monero'
  236. s_monero='Testing key-address file generation and wallet creation and sync operations for Monero'
  237. s_monero='The monerod (mainnet) daemon must be running for the following tests'
  238. t_monero="
  239. mmgen-walletgen -q -r0 -p1 -Llabel --outdir $TMPDIR -o words
  240. $mmgen_keygen -q --accept-defaults --use-internal-keccak-module --outdir $TMPDIR --coin=xmr $TMPDIR/*.mmwords $monero_addrs
  241. cs1=\$(mmgen-tool -q --accept-defaults --coin=xmr keyaddrfile_chksum $TMPDIR/*-XMR*.akeys)
  242. $mmgen_keygen -q --use-old-ed25519 --accept-defaults --outdir $TMPDIR --coin=xmr $TMPDIR/*.mmwords $monero_addrs
  243. cs2=\$(mmgen-tool -q --accept-defaults --coin=xmr keyaddrfile_chksum $TMPDIR/*-XMR*.akeys)
  244. [ \"\$cs1\" == \"\$cs2\" ]
  245. "
  246. f_monero='Monero tests completed'
  247. [ "$MINGW" ] || {
  248. t_monero="$t_monero
  249. $mmgen_tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallets $TMPDIR/*-XMR*.akeys addrs=23
  250. $mmgen_tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallets $TMPDIR/*-XMR*.akeys addrs=103-200
  251. rm $TMPDIR/*-MoneroWallet*
  252. $mmgen_tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallets $TMPDIR/*-XMR*.akeys
  253. $mmgen_tool -q --accept-defaults --outdir $TMPDIR syncmonerowallets $TMPDIR/*-XMR*.akeys addrs=3
  254. $mmgen_tool -q --accept-defaults --outdir $TMPDIR syncmonerowallets $TMPDIR/*-XMR*.akeys addrs=23-29
  255. $mmgen_tool -q --accept-defaults --outdir $TMPDIR syncmonerowallets $TMPDIR/*-XMR*.akeys
  256. "
  257. }
  258. [ "$monero_addrs" == '3,23' ] && t_monero_skip='4 8 13'
  259. i_eth='Ethereum'
  260. s_eth='Testing transaction and tracking wallet operations for Ethereum and Ethereum Classic'
  261. t_eth="
  262. $test_py --coin=eth ethdev
  263. $test_py --coin=etc ethdev
  264. "
  265. f_eth='Ethereum tests completed'
  266. i_autosign='Autosign'
  267. s_autosign='The bitcoin, bitcoin-abc and litecoin mainnet and testnet daemons must be running for the following test'
  268. t_autosign="$test_py autosign"
  269. f_autosign='Autosign test complete'
  270. i_autosign_minimal='Autosign Minimal'
  271. s_autosign_minimal='The bitcoin mainnet and testnet daemons must be running for the following test'
  272. t_autosign_minimal="$test_py autosign_minimal"
  273. f_autosign_minimal='Autosign Minimal test complete'
  274. i_autosign_live='Autosign Live'
  275. s_autosign_live="The bitcoin mainnet and testnet daemons must be running for the following test\n"
  276. s_autosign_live+="${YELLOW}Mountpoint, '/etc/fstab' and removable device must be configured "
  277. s_autosign_live+="as described in 'mmgen-autosign --help'${RESET}"
  278. t_autosign_live="$test_py autosign_live"
  279. f_autosign_live='Autosign Live test complete'
  280. i_btc='Bitcoin mainnet'
  281. s_btc='The bitcoin (mainnet) daemon must both be running for the following tests'
  282. t_btc="
  283. $test_py --exclude regtest
  284. $test_py --segwit
  285. $test_py --segwit-random
  286. $test_py --bech32
  287. $python scripts/compute-file-chksum.py $REFDIR/*testnet.rawtx >/dev/null 2>&1
  288. "
  289. f_btc='You may stop the bitcoin (mainnet) daemon if you wish'
  290. i_btc_tn='Bitcoin testnet'
  291. s_btc_tn='The bitcoin testnet daemon must both be running for the following tests'
  292. t_btc_tn="
  293. $test_py --testnet=1
  294. $test_py --testnet=1 --segwit
  295. $test_py --testnet=1 --segwit-random
  296. $test_py --testnet=1 --bech32
  297. "
  298. f_btc_tn='You may stop the bitcoin testnet daemon if you wish'
  299. i_btc_rt='Bitcoin regtest'
  300. s_btc_rt="The following tests will test MMGen's regtest (Bob and Alice) mode"
  301. t_btc_rt="$test_py regtest"
  302. f_btc_rt='Regtest (Bob and Alice) mode tests for BTC completed'
  303. i_bch='Bitcoin cash (BCH)'
  304. s_bch='The bitcoin cash daemon (Bitcoin ABC) must both be running for the following tests'
  305. t_bch="$test_py --coin=bch --exclude regtest"
  306. f_bch='You may stop the Bitcoin ABC daemon if you wish'
  307. i_bch_rt='Bitcoin cash (BCH) regtest'
  308. s_bch_rt="The following tests will test MMGen's regtest (Bob and Alice) mode"
  309. t_bch_rt="$test_py --coin=bch regtest"
  310. f_bch_rt='Regtest (Bob and Alice) mode tests for BCH completed'
  311. i_ltc='Litecoin'
  312. s_ltc='The litecoin daemon must both be running for the following tests'
  313. t_ltc="
  314. $test_py --coin=ltc --exclude regtest
  315. $test_py --coin=ltc --segwit
  316. $test_py --coin=ltc --segwit-random
  317. $test_py --coin=ltc --bech32
  318. "
  319. f_ltc='You may stop the litecoin daemon if you wish'
  320. i_ltc_tn='Litecoin testnet'
  321. s_ltc_tn='The litecoin testnet daemon must both be running for the following tests'
  322. t_ltc_tn="
  323. $test_py --coin=ltc --testnet=1 --exclude regtest
  324. $test_py --coin=ltc --testnet=1 --segwit
  325. $test_py --coin=ltc --testnet=1 --segwit-random
  326. $test_py --coin=ltc --testnet=1 --bech32
  327. "
  328. f_ltc_tn='You may stop the litecoin testnet daemon if you wish'
  329. i_ltc_rt='Litecoin regtest'
  330. s_ltc_rt="The following tests will test MMGen's regtest (Bob and Alice) mode"
  331. t_ltc_rt="$test_py --coin=ltc regtest"
  332. f_ltc_rt='Regtest (Bob and Alice) mode tests for LTC completed'
  333. i_tool2='Tooltest2'
  334. s_tool2="The following tests will run '$tooltest2_py' for all supported coins"
  335. t_tool2="
  336. $tooltest2_py --quiet
  337. $tooltest2_py --quiet --coin=btc
  338. $tooltest2_py --quiet --coin=btc --testnet=1
  339. $tooltest2_py --quiet --coin=ltc
  340. $tooltest2_py --quiet --coin=ltc --testnet=1
  341. $tooltest2_py --quiet --coin=bch
  342. $tooltest2_py --quiet --coin=bch --testnet=1
  343. $tooltest2_py --quiet --coin=zec
  344. $tooltest2_py --quiet --coin=zec --type=zcash_z
  345. $tooltest2_py --quiet --coin=xmr
  346. $tooltest2_py --quiet --coin=dash
  347. $tooltest2_py --quiet --coin=eth
  348. $tooltest2_py --quiet --coin=eth --testnet=1
  349. $tooltest2_py --quiet --coin=eth --token=mm1
  350. $tooltest2_py --quiet --coin=eth --token=mm1 --testnet=1
  351. $tooltest2_py --quiet --coin=etc
  352. "
  353. f_tool2='tooltest2 tests completed'
  354. i_tool='Tooltest'
  355. s_tool="The following tests will run '$tooltest_py' for all supported coins"
  356. t_tool="
  357. $tooltest_py --coin=btc cryptocoin
  358. $tooltest_py --coin=btc mnemonic
  359. $tooltest_py --coin=ltc cryptocoin
  360. $tooltest_py --coin=eth cryptocoin
  361. $tooltest_py --coin=etc cryptocoin
  362. $tooltest_py --coin=dash cryptocoin
  363. $tooltest_py --coin=doge cryptocoin
  364. $tooltest_py --coin=emc cryptocoin
  365. $tooltest_py --coin=zec cryptocoin
  366. $tooltest_py --coin=zec --type=zcash_z cryptocoin
  367. "
  368. [ "$MINGW" ] && t_tool_skip='10'
  369. f_tool='tooltest tests completed'
  370. i_gen='Gentest'
  371. s_gen="The following tests will run '$gentest_py' on mainnet and testnet for all supported coins"
  372. t_gen="
  373. $gentest_py -q 2 $REFDIR/btcwallet.dump
  374. $gentest_py -q --type=segwit 2 $REFDIR/btcwallet-segwit.dump
  375. $gentest_py -q --type=bech32 2 $REFDIR/btcwallet-bech32.dump
  376. $gentest_py -q 1:2 $rounds
  377. $gentest_py -q --type=segwit 1:2 $rounds
  378. $gentest_py -q --type=bech32 1:2 $rounds
  379. $gentest_py -q --testnet=1 2 $REFDIR/btcwallet-testnet.dump
  380. $gentest_py -q --testnet=1 1:2 $rounds
  381. $gentest_py -q --testnet=1 --type=segwit 1:2 $rounds
  382. $gentest_py -q --coin=ltc 2 $REFDIR/litecoin/ltcwallet.dump
  383. $gentest_py -q --coin=ltc --type=segwit 2 $REFDIR/litecoin/ltcwallet-segwit.dump
  384. $gentest_py -q --coin=ltc --type=bech32 2 $REFDIR/litecoin/ltcwallet-bech32.dump
  385. $gentest_py -q --coin=ltc 1:2 $rounds
  386. $gentest_py -q --coin=ltc --type=segwit 1:2 $rounds
  387. $gentest_py -q --coin=ltc --testnet=1 2 $REFDIR/litecoin/ltcwallet-testnet.dump
  388. $gentest_py -q --coin=ltc --testnet=1 1:2 $rounds
  389. $gentest_py -q --coin=ltc --testnet=1 --type=segwit 1:2 $rounds
  390. "
  391. f_gen='gentest tests completed'
  392. [ -d .git -a -n "$INSTALL" -a -z "$TESTING" ] && {
  393. check
  394. uninstall
  395. install
  396. cd .test-release/pydist/mmgen-*
  397. }
  398. [ "$INSTALL_ONLY" ] && exit
  399. prompt_skip() {
  400. echo -n "Enter 's' to skip, or ENTER to continue: "; read -n1; echo
  401. [ "$REPLY" == 's' ] && return 0
  402. return 1
  403. }
  404. run_tests() {
  405. for t in $1; do
  406. eval echo -e "'\n'"\${GREEN}'###' Running $(echo \$i_$t) tests\$RESET
  407. eval echo -e $(echo \$s_$t)
  408. [ "$PAUSE" ] && prompt_skip && continue
  409. CUR_TEST=$t
  410. do_test $t
  411. eval echo -e \$GREEN$(echo \$f_$t)\$RESET
  412. done
  413. }
  414. check_args() {
  415. for i in $tests; do
  416. echo "$dfl_tests $add_tests" | grep -q "\<$i\>" || { echo "$i: unrecognized argument"; exit; }
  417. done
  418. }
  419. tests=$dfl_tests
  420. [ "$*" ] && tests="$*"
  421. check_args
  422. echo "Running tests: $tests"
  423. START=$(date +%s)
  424. run_tests "$tests"
  425. TIME=$(($(date +%s)-START))
  426. MS=$(printf %02d:%02d $((TIME/60)) $((TIME%60)))
  427. [ "$NO_TMPFILE_REMOVAL" ] || rm -rf /tmp/mmgen-test-release-*
  428. echo -e "${GREEN}All OK. Total elapsed time: $MS$RESET"