From 5b4f9471e55f132f453f12232621bd93cb72e0cb Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 7 May 2023 17:11:53 +0000 Subject: [PATCH] XMR test suite: datadir, RPC port fixes --- mmgen/proto/xmr/daemon.py | 3 ++- test/test_py_d/ts_autosign.py | 1 + test/test_py_d/ts_xmr_autosign.py | 1 + test/test_py_d/ts_xmrwallet.py | 1 - test/unit_tests_d/ut_rpc.py | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mmgen/proto/xmr/daemon.py b/mmgen/proto/xmr/daemon.py index eeec8113..75116999 100755 --- a/mmgen/proto/xmr/daemon.py +++ b/mmgen/proto/xmr/daemon.py @@ -88,6 +88,7 @@ class MoneroWalletDaemon(RPCDaemon): networks = ('mainnet','testnet') rpc_ports = _nw(13131, 13141, None) # testnet is non-standard _reset_ok = ('debug','wait','pids','force_kill') + test_suite_datadir = os.path.join('test','daemons','xmrtest','wallet_rpc') def __init__( self, @@ -118,7 +119,7 @@ class MoneroWalletDaemon(RPCDaemon): self.rpc_port += port_shift 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.logfile = os.path.join(self.datadir,id_str+'.log') diff --git a/test/test_py_d/ts_autosign.py b/test/test_py_d/ts_autosign.py index 8cacf917..acfa46fd 100755 --- a/test/test_py_d/ts_autosign.py +++ b/test/test_py_d/ts_autosign.py @@ -105,6 +105,7 @@ class TestSuiteAutosignBase(TestSuiteBase): os.path.join(self.tmpdir,self.mountpoint_basename) ), 'wallet_dir': None if self.live else self.wallet_dir, + 'test_suite': True, 'test_suite_xmr_autosign': self.name == 'TestSuiteXMRAutosign', }) ) diff --git a/test/test_py_d/ts_xmr_autosign.py b/test/test_py_d/ts_xmr_autosign.py index 88d986ce..f8422f2d 100755 --- a/test/test_py_d/ts_xmr_autosign.py +++ b/test/test_py_d/ts_xmr_autosign.py @@ -103,6 +103,7 @@ class TestSuiteXMRAutosign(TestSuiteXMRWallet,TestSuiteAutosignBase): 'outdir': self.users['alice'].udir, 'wallet_dir': self.users['alice'].udir, 'wallet_rpc_password': 'passwOrd', + 'test_suite': True, }) self.burn_addr = make_burn_addr() diff --git a/test/test_py_d/ts_xmrwallet.py b/test/test_py_d/ts_xmrwallet.py index 584758ae..da3f8594 100755 --- a/test/test_py_d/ts_xmrwallet.py +++ b/test/test_py_d/ts_xmrwallet.py @@ -272,7 +272,6 @@ class TestSuiteXMRWallet(TestSuiteBase): user = 'foo', passwd = 'bar', port_shift = shift, - datadir = os.path.join('test','daemons'), monerod_addr = f'127.0.0.1:{md.rpc_port}', ) wd_rpc = MoneroWalletRPCClient( diff --git a/test/unit_tests_d/ut_rpc.py b/test/unit_tests_d/ut_rpc.py index 48951828..d56f7503 100755 --- a/test/unit_tests_d/ut_rpc.py +++ b/test/unit_tests_d/ut_rpc.py @@ -192,6 +192,7 @@ class unit_tests: proto = proto, test_suite = True, wallet_dir = os.path.join('test','trash2'), + datadir = os.path.join('test','trash2','wallet_rpc'), passwd = 'ut_rpc_passw0rd' ) ) for proto in (init_proto( cfg, 'xmr', network=network ) for network in networks) ]