From bc33489e76084dd9aa84604ddb7dfa572b4c6cc7 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 10 Oct 2021 20:18:14 +0000 Subject: [PATCH] daemon.py, test suite: Windows fixes --- mmgen/daemon.py | 4 ++-- test/overlay/__init__.py | 8 +++++--- test/test_py_d/ts_ethdev.py | 4 +++- test/test_py_d/ts_ref_altcoin.py | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mmgen/daemon.py b/mmgen/daemon.py index 7792294a..248ffe08 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -290,7 +290,7 @@ class MoneroWalletDaemon(RPCDaemon): [f'--daemon-port={self.daemon_port}', not self.daemon_addr], [f'--proxy={self.proxy}', self.proxy], [f'--pidfile={self.pidfile}', self.platform == 'linux'], - ['--detach', not self.opt.no_daemonize], + ['--detach', not (self.opt.no_daemonize or self.platform=='win')], ['--stagenet', self.network == 'testnet'], ) @@ -622,7 +622,7 @@ class monero_daemon(CoinDaemon): ['--no-igd'], [f'--data-dir={self.datadir}', self.non_dfl_datadir], [f'--pidfile={self.pidfile}', self.platform == 'linux'], - ['--detach', not self.opt.no_daemonize], + ['--detach', not (self.opt.no_daemonize or self.platform=='win')], ['--offline', not self.opt.online], ) diff --git a/test/overlay/__init__.py b/test/overlay/__init__.py index 72d5dfcd..a89ee58a 100644 --- a/test/overlay/__init__.py +++ b/test/overlay/__init__.py @@ -1,4 +1,4 @@ -import sys,os +import sys,os,shutil def overlay_setup(repo_root): @@ -13,19 +13,21 @@ def overlay_setup(repo_root): d == 'mmgen' and fn.startswith('secp256k1') ): if fn in fakemods: - os.symlink( + make_link( os.path.join(fakemod_dir,fn), os.path.join(destdir,fn) ) link_fn = fn.removesuffix('.py') + '_orig.py' else: link_fn = fn - os.symlink( + make_link( os.path.join(srcdir,fn), os.path.join(destdir,link_fn) ) overlay_dir = os.path.join(repo_root,'test','overlay','tree') fakemod_dir = os.path.join(repo_root,'test','overlay','fakemods') fakemods = os.listdir(fakemod_dir) + make_link = os.symlink if sys.platform == 'linux' else shutil.copy2 + if not os.path.exists(os.path.join(overlay_dir,'mmgen','main.py')): for d in ( 'mmgen', diff --git a/test/test_py_d/ts_ethdev.py b/test/test_py_d/ts_ethdev.py index 3c5ad0cb..a4dc296c 100755 --- a/test/test_py_d/ts_ethdev.py +++ b/test/test_py_d/ts_ethdev.py @@ -55,7 +55,7 @@ erigon_devkey_fn = 'erigon.devkey' tested_solc_ver = '0.8.7' def check_solc_ver(): - cmd = 'scripts/create-token.py --check-solc-version' + cmd = 'python3 scripts/create-token.py --check-solc-version' try: cp = run(cmd.split(),check=False,stdout=PIPE) except Exception as e: @@ -370,6 +370,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared): if not opt.no_daemon_autostart: if g.daemon_id == 'geth': self.geth_setup() + set_vt100() if not start_test_daemons( self.proto.coin+'_rt', remove_datadir = not g.daemon_id in ('geth','erigon') ): @@ -746,6 +747,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared): try: os.mkdir(odir) except: pass cmd = [ + 'python3', 'scripts/exec_wrapper.py', 'scripts/create-token.py', '--coin=' + self.proto.coin, diff --git a/test/test_py_d/ts_ref_altcoin.py b/test/test_py_d/ts_ref_altcoin.py index 9264e9d0..12c772ba 100755 --- a/test/test_py_d/ts_ref_altcoin.py +++ b/test/test_py_d/ts_ref_altcoin.py @@ -104,6 +104,7 @@ class TestSuiteRefAltcoin(TestSuiteRef,TestSuiteBase): proto = MMGenTxFile.get_proto(txfile,quiet_open=True) if proto.sign_mode == 'daemon': start_test_daemons(proto.network_id) + set_vt100() t = self.spawn( 'mmgen-txsign', ['--outdir=test/trash','--yes', f'--passwd-file={passfile}', dfl_words_file, txfile],