Browse Source

XMR test suite: datadir, RPC port fixes

The MMGen Project 1 year ago
parent
commit
5b4f9471e5

+ 2 - 1
mmgen/proto/xmr/daemon.py

@@ -88,6 +88,7 @@ class MoneroWalletDaemon(RPCDaemon):
 	networks = ('mainnet','testnet')
 	networks = ('mainnet','testnet')
 	rpc_ports = _nw(13131, 13141, None) # testnet is non-standard
 	rpc_ports = _nw(13131, 13141, None) # testnet is non-standard
 	_reset_ok = ('debug','wait','pids','force_kill')
 	_reset_ok = ('debug','wait','pids','force_kill')
+	test_suite_datadir = os.path.join('test','daemons','xmrtest','wallet_rpc')
 
 
 	def __init__(
 	def __init__(
 			self,
 			self,
@@ -118,7 +119,7 @@ class MoneroWalletDaemon(RPCDaemon):
 			self.rpc_port += port_shift
 			self.rpc_port += port_shift
 
 
 		id_str = f'{self.exec_fn}-{self.bind_port}'
 		id_str = f'{self.exec_fn}-{self.bind_port}'
-		self.datadir = os.path.join((datadir or self.exec_fn),('','test_suite')[test_suite])
+		self.datadir = datadir or (self.test_suite_datadir if test_suite else self.exec_fn)
 		self.pidfile = os.path.join(self.datadir,id_str+'.pid')
 		self.pidfile = os.path.join(self.datadir,id_str+'.pid')
 		self.logfile = os.path.join(self.datadir,id_str+'.log')
 		self.logfile = os.path.join(self.datadir,id_str+'.log')
 
 

+ 1 - 0
test/test_py_d/ts_autosign.py

@@ -105,6 +105,7 @@ class TestSuiteAutosignBase(TestSuiteBase):
 					os.path.join(self.tmpdir,self.mountpoint_basename)
 					os.path.join(self.tmpdir,self.mountpoint_basename)
 				),
 				),
 				'wallet_dir': None if self.live else self.wallet_dir,
 				'wallet_dir': None if self.live else self.wallet_dir,
+				'test_suite': True,
 				'test_suite_xmr_autosign': self.name == 'TestSuiteXMRAutosign',
 				'test_suite_xmr_autosign': self.name == 'TestSuiteXMRAutosign',
 			})
 			})
 		)
 		)

+ 1 - 0
test/test_py_d/ts_xmr_autosign.py

@@ -103,6 +103,7 @@ class TestSuiteXMRAutosign(TestSuiteXMRWallet,TestSuiteAutosignBase):
 			'outdir': self.users['alice'].udir,
 			'outdir': self.users['alice'].udir,
 			'wallet_dir': self.users['alice'].udir,
 			'wallet_dir': self.users['alice'].udir,
 			'wallet_rpc_password': 'passwOrd',
 			'wallet_rpc_password': 'passwOrd',
+			'test_suite': True,
 		})
 		})
 
 
 		self.burn_addr = make_burn_addr()
 		self.burn_addr = make_burn_addr()

+ 0 - 1
test/test_py_d/ts_xmrwallet.py

@@ -272,7 +272,6 @@ class TestSuiteXMRWallet(TestSuiteBase):
 				user       = 'foo',
 				user       = 'foo',
 				passwd     = 'bar',
 				passwd     = 'bar',
 				port_shift = shift,
 				port_shift = shift,
-				datadir    = os.path.join('test','daemons'),
 				monerod_addr = f'127.0.0.1:{md.rpc_port}',
 				monerod_addr = f'127.0.0.1:{md.rpc_port}',
 			)
 			)
 			wd_rpc = MoneroWalletRPCClient(
 			wd_rpc = MoneroWalletRPCClient(

+ 1 - 0
test/unit_tests_d/ut_rpc.py

@@ -192,6 +192,7 @@ class unit_tests:
 						proto      = proto,
 						proto      = proto,
 						test_suite = True,
 						test_suite = True,
 						wallet_dir = os.path.join('test','trash2'),
 						wallet_dir = os.path.join('test','trash2'),
+						datadir    = os.path.join('test','trash2','wallet_rpc'),
 						passwd     = 'ut_rpc_passw0rd' )
 						passwd     = 'ut_rpc_passw0rd' )
 				) for proto in (init_proto( cfg, 'xmr', network=network ) for network in networks) ]
 				) for proto in (init_proto( cfg, 'xmr', network=network ) for network in networks) ]