various testing fixes
This commit is contained in:
parent
5269b5efc0
commit
258f1b0236
6 changed files with 43 additions and 23 deletions
|
|
@ -122,9 +122,11 @@ class geth_daemon(ethereum_daemon):
|
|||
[f'--http.port={self.rpc_port}'],
|
||||
[f'--authrpc.port={self.authrpc_port}'],
|
||||
[f'--port={self.p2p_port}', self.p2p_port], # geth binds p2p port even with --maxpeers=0
|
||||
[f'--discovery.port={self.p2p_port}', self.id == 'reth' and self.p2p_port],
|
||||
['--maxpeers=0', self.id == 'geth' and not self.opt.online],
|
||||
[f'--datadir={self.datadir}', self.non_dfl_datadir],
|
||||
['--holesky', self.network=='testnet'],
|
||||
['--holesky', self.network=='testnet' and self.id == 'geth'],
|
||||
['--chain=holesky', self.network=='testnet' and self.id == 'reth'],
|
||||
['--dev', self.network=='regtest'],
|
||||
)
|
||||
|
||||
|
|
@ -132,6 +134,7 @@ class reth_daemon(geth_daemon):
|
|||
daemon_data = _dd('Reth', 1007000, '1.7.0')
|
||||
version_pat = r'reth/v(\d+)\.(\d+)\.(\d+)'
|
||||
exec_fn = 'reth'
|
||||
version_info_arg = '--version'
|
||||
datadirs = {
|
||||
'linux': [gc.home_dir, '.local', 'share', 'reth'],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ opts_data = {
|
|||
},
|
||||
}
|
||||
|
||||
cfg = Config(opts_data=opts_data)
|
||||
cfg = Config(opts_data=opts_data, init_opts={'skip_cfg_file': True})
|
||||
|
||||
from test.overlay import get_overlay_tree_dir
|
||||
overlay_tree_dir = get_overlay_tree_dir(repo_root)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from mmgen.color import orange, red
|
|||
from mmgen.util import fmt_list
|
||||
from mmgen.daemon import CoinDaemon
|
||||
|
||||
from ..include.common import cfg, qmsg, qmsg_r, vmsg, msg
|
||||
from ..include.common import cfg, qmsg, qmsg_r, vmsg, msg, msg_r
|
||||
|
||||
def test_flags(coin):
|
||||
d = CoinDaemon(cfg, network_id=coin)
|
||||
|
|
@ -64,9 +64,11 @@ class unit_tests:
|
|||
def _pre(self):
|
||||
self.daemon_ctrl_args = ['btc', 'btc_tn', 'btc_rt'] if cfg.no_altcoin_deps else ['all']
|
||||
|
||||
def _test_cmd(self, args_in, message):
|
||||
qmsg_r(message)
|
||||
args = ['python3', f'test/{args_in[0]}-coin-daemons.py'] + list(args_in[1:]) + self.daemon_ctrl_args
|
||||
def _test_cmd(self, args_in, network_ids=[], ok=True):
|
||||
args = (
|
||||
['python3', f'test/{args_in[0]}-coin-daemons.py']
|
||||
+ list(args_in[1:])
|
||||
+ (network_ids or self.daemon_ctrl_args))
|
||||
vmsg('\n' + orange(f"Running '{' '.join(args)}':"))
|
||||
cp = run(args, stdout=PIPE, stderr=PIPE, text=True)
|
||||
if cp.returncode != 0:
|
||||
|
|
@ -75,7 +77,11 @@ class unit_tests:
|
|||
if cp.stderr:
|
||||
msg(red(cp.stderr))
|
||||
return False
|
||||
qmsg('OK')
|
||||
if cfg.verbose:
|
||||
msg_r(cp.stderr.strip())
|
||||
if ok:
|
||||
vmsg('')
|
||||
qmsg('OK')
|
||||
return True
|
||||
|
||||
def flags(self, name, ut):
|
||||
|
|
@ -101,17 +107,27 @@ class unit_tests:
|
|||
return True
|
||||
|
||||
def avail(self, name, ut):
|
||||
return self._test_cmd(
|
||||
['start', '--print-version', '--mainnet-only'], 'Testing availability of coin daemons...')
|
||||
qmsg_r('Testing availability of coin daemons...')
|
||||
return self._test_cmd(['start', '--print-version', '--mainnet-only'])
|
||||
|
||||
def versions(self, name, ut):
|
||||
qmsg_r('Displaying coin daemon versions...')
|
||||
ret1 = self._test_cmd(['start', '--print-version'], ok=False)
|
||||
ret2 = self._test_cmd(['start', '--print-version', '--mainnet-only'])
|
||||
return ret1 and ret2
|
||||
|
||||
def cmds(self, name, ut):
|
||||
return self._test_cmd(['start', '--testing'], 'Testing start commands for coin daemons...')
|
||||
qmsg_r('Testing start commands for coin daemons...')
|
||||
return self._test_cmd(['start', '--testing'])
|
||||
|
||||
def start(self, name, ut):
|
||||
return self._test_cmd(['start'], 'Starting coin daemons...')
|
||||
qmsg_r('Starting coin daemons...')
|
||||
return self._test_cmd(['start'])
|
||||
|
||||
def status(self, name, ut):
|
||||
return self._test_cmd(['start'], 'Checking status of coin daemons...')
|
||||
qmsg_r('Checking status of coin daemons...')
|
||||
return self._test_cmd(['start'])
|
||||
|
||||
def stop(self, name, ut):
|
||||
return self._test_cmd(['stop', '--remove-datadir'], 'Stopping coin daemons...')
|
||||
qmsg_r('Stopping coin daemons...')
|
||||
return self._test_cmd(['stop', '--remove-datadir'])
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ Valid network IDs: {nid}, {xmrw_nid}, all, no_xmr
|
|||
}
|
||||
|
||||
class warn_missing_exec(oneshot_warning):
|
||||
color = 'nocolor'
|
||||
message = 'daemon executable {!r} not found on this system!'
|
||||
color = 'yellow'
|
||||
message = 'missing executable {!r}'
|
||||
|
||||
def run(network_id=None, proto=None, daemon_id=None, missing_exec_ok=False):
|
||||
|
||||
|
|
@ -107,7 +107,8 @@ def run(network_id=None, proto=None, daemon_id=None, missing_exec_ok=False):
|
|||
d.get_exec_version_str()
|
||||
except Exception as e:
|
||||
if not cfg.quiet:
|
||||
msg(str(e))
|
||||
if cfg.verbose:
|
||||
msg(str(e))
|
||||
warn_missing_exec(div=d.exec_fn, fmt_args=(d.exec_fn,))
|
||||
return
|
||||
if cfg.print_version:
|
||||
|
|
@ -150,4 +151,4 @@ def main():
|
|||
for network_id in ids:
|
||||
run(network_id=network_id.lower())
|
||||
|
||||
cfg = Config(opts_data=opts_data)
|
||||
cfg = Config(opts_data=opts_data, init_opts={'skip_cfg_file': True})
|
||||
|
|
|
|||
|
|
@ -19,15 +19,15 @@ groups_desc="
|
|||
"
|
||||
|
||||
init_groups() {
|
||||
dfl_tests='dep alt obj color daemon mod hash ref tool tool2 gen help autosign btc btc_tn btc_rt altref altgen bch bch_rt ltc ltc_rt geth reth etc rune xmr'
|
||||
dfl_tests='dep daemon alt obj color mod hash ref tool tool2 gen help autosign btc btc_tn btc_rt altref altgen bch bch_rt ltc ltc_rt geth reth etc rune xmr'
|
||||
extra_tests='dep dev lint pylint autosign_live ltc_tn bch_tn'
|
||||
noalt_tests='dep alt obj color daemon mod hash ref tool tool2 gen help autosign btc btc_tn btc_rt'
|
||||
quick_tests='dep alt obj color daemon mod hash ref tool tool2 gen help autosign btc btc_rt altref altgen geth etc rune xmr'
|
||||
noalt_tests='dep daemon alt obj color mod hash ref tool tool2 gen help autosign btc btc_tn btc_rt'
|
||||
quick_tests='dep daemon alt obj color mod hash ref tool tool2 gen help autosign btc btc_rt altref altgen geth etc rune xmr'
|
||||
qskip_tests='lint btc_tn bch bch_rt ltc ltc_rt'
|
||||
noalt_ok_tests='lint'
|
||||
|
||||
[ "$MSYS2" ] && SKIP_LIST='autosign autosign_live'
|
||||
[ "$ARM32" -o "$ARM64" -o "$SKIP_PARITY" ] && SKIP_LIST+=' etc'
|
||||
[ "$SKIP_PARITY" ] && SKIP_LIST+=' etc'
|
||||
|
||||
true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -379,8 +379,8 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
in_nix_environment && parity --help >/dev/null 2>&1 || SKIP_PARITY=1
|
||||
[ "$RISCV64" ] && SKIP_PARITY=1
|
||||
in_nix_environment && SKIP_PARITY=1
|
||||
[ "$SOC" ] && SKIP_PARITY=1
|
||||
|
||||
[ "$MMGEN_DISABLE_COLOR" -o ! -t 1 ] || {
|
||||
GRAY="\e[30;1m"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue