Browse Source

daemon.py, test suite: Windows fixes

The MMGen Project 3 years ago
parent
commit
bc33489e76
4 changed files with 11 additions and 6 deletions
  1. 2 2
      mmgen/daemon.py
  2. 5 3
      test/overlay/__init__.py
  3. 3 1
      test/test_py_d/ts_ethdev.py
  4. 1 0
      test/test_py_d/ts_ref_altcoin.py

+ 2 - 2
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],
 		)
 

+ 5 - 3
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',

+ 3 - 1
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,

+ 1 - 0
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],