diff --git a/mmgen/util.py b/mmgen/util.py index 56793be7..04725ffd 100755 --- a/mmgen/util.py +++ b/mmgen/util.py @@ -471,6 +471,11 @@ def have_sudo(*, silent=False): except: return False +def in_nix_environment(): + for path in os.getenv('PATH').split(':'): + if path.startswith('/nix/store/'): + return True + def cached_property(orig_func): @property def new_func(self): diff --git a/test/daemontest_d/exec.py b/test/daemontest_d/exec.py index dfd78bb7..6c33bf4a 100755 --- a/test/daemontest_d/exec.py +++ b/test/daemontest_d/exec.py @@ -8,7 +8,7 @@ from subprocess import run, PIPE from collections import namedtuple from mmgen.color import orange, red -from mmgen.util import fmt_list +from mmgen.util import fmt_list, in_nix_environment from mmgen.daemon import CoinDaemon from ..include.common import cfg, qmsg, qmsg_r, vmsg, msg, msg_r @@ -108,7 +108,25 @@ class unit_tests: def avail(self, name, ut): qmsg_r('Testing availability of coin daemons...') - return self._test_cmd(['start', '--print-version', '--mainnet-only']) + from platform import machine + test_reth = not (cfg.no_altcoin_deps or cfg.fast) + test_parity = not ( + cfg.no_altcoin_deps + or machine() in ('riscv64', 'aarch64', 'armv7l') + or in_nix_environment()) + ret1 = self._test_cmd( + ['start', '--print-version', '--mainnet-only'], + network_ids = ['btc'] if cfg.no_altcoin_deps else ['btc', 'ltc', 'bch', 'xmr', 'eth'], + ok = not (test_reth or test_parity)) + ret2 = self._test_cmd( + ['start', '--print-version', '--mainnet-only', '--daemon-id=reth'], + network_ids = ['eth'], + ok = not test_parity) if test_reth else True + ret3 = self._test_cmd( + ['start', '--print-version', '--mainnet-only'], + network_ids = ['etc'], + ok = True) if test_parity else True + return ret1 and ret2 and ret3 def versions(self, name, ut): qmsg_r('Displaying coin daemon versions...')