From 31f981ab9761f0a3d8e3d353d4eb760a19dbdf1b Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 16 Aug 2022 20:35:49 +0000 Subject: [PATCH] BTC-only testing fix --- test/include/coin_daemon_control.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/include/coin_daemon_control.py b/test/include/coin_daemon_control.py index 20d1d975..23a26186 100755 --- a/test/include/coin_daemon_control.py +++ b/test/include/coin_daemon_control.py @@ -41,7 +41,11 @@ cmd_args = opts.init(opts_data) from mmgen.daemon import * -def run(network_id=None,proto=None,daemon_id=None): +class warn_missing_exec(oneshot_warning): + color = 'nocolor' + message = 'daemon executable {!r} not found on this system!' + +def run(network_id=None,proto=None,daemon_id=None,missing_exec_ok=True): d = CoinDaemon( network_id = network_id, @@ -58,6 +62,13 @@ def run(network_id=None,proto=None,daemon_id=None): d.debug = d.debug or opt.debug d.wait = not opt.no_wait + if missing_exec_ok: + try: + d.get_exec_version_str() + except: + if not opt.quiet: + warn_missing_exec( div=d.exec_fn, fmt_args=(d.exec_fn,) ) + return if opt.print_version: msg('{:16} {}'.format( d.exec_fn+':', d.get_exec_version_str() )) elif opt.get_state: @@ -82,7 +93,10 @@ elif 'all' in cmd_args or 'no_xmr' in cmd_args: continue for daemon_id in CoinDaemon.get_daemon_ids(coin): for network in CoinDaemon.get_daemon(coin,daemon_id).networks: - run(proto=init_proto(coin=coin,network=network),daemon_id=daemon_id) + run( + proto = init_proto(coin=coin,network=network), + daemon_id = daemon_id, + missing_exec_ok = True ) else: ids = cmd_args network_ids = CoinDaemon.get_network_ids()