From 647c7a2601adca322b4f4800a72a19da06a38d46 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 8 Oct 2024 12:55:57 +0000 Subject: [PATCH] cmdtest.py regtest: cleanups --- mmgen/proto/btc/regtest.py | 7 ++++--- test/cmdtest_py_d/ct_regtest.py | 6 ++++-- test/test-release.d/cfg.sh | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mmgen/proto/btc/regtest.py b/mmgen/proto/btc/regtest.py index e47a0f9d..47c9dc2b 100755 --- a/mmgen/proto/btc/regtest.py +++ b/mmgen/proto/btc/regtest.py @@ -169,7 +169,7 @@ class MMGenRegtest(MMGenObject): # BCH and LTC daemons refuse to set HD seed with empty blockchain ("in IBD" error), # so generate a block: - await self.generate(1,silent=False) + await self.generate(1) # Unfortunately, we don’t get deterministic output with BCH and LTC even with fixed # hdseed, as their 'sendtoaddress' calls produce non-deterministic TXIDs due to random @@ -182,8 +182,9 @@ class MMGenRegtest(MMGenObject): wallet = 'miner') # Broken litecoind can only mine 431 blocks in regtest mode, so generate just enough - # blocks to fund the test suite - await self.generate(392,silent=True) + # blocks to fund the test suite. Generation is slow, so divide into chunks: + for n in (100, 100, 100, 92): # 392 blocks + await self.generate(n) gmsg('Setup complete') diff --git a/test/cmdtest_py_d/ct_regtest.py b/test/cmdtest_py_d/ct_regtest.py index 9cd58f9a..5191e3e9 100755 --- a/test/cmdtest_py_d/ct_regtest.py +++ b/test/cmdtest_py_d/ct_regtest.py @@ -531,8 +531,10 @@ class CmdTestRegtest(CmdTestBase,CmdTestShared): 'mmgen-regtest', (['--bdb-wallet'] if self.use_bdb_wallet else []) + ['--setup-no-stop-daemon', 'setup']) - for s in ('Starting','Creating','Creating','Creating','Mined','Setup complete'): - t.expect(s) + t.expect('Starting') + for _ in range(3): t.expect('Creating') + for _ in range(5): t.expect('Mined') + t.expect('Setup complete') return t def daemon_version(self): diff --git a/test/test-release.d/cfg.sh b/test/test-release.d/cfg.sh index ed905fa8..bab59536 100755 --- a/test/test-release.d/cfg.sh +++ b/test/test-release.d/cfg.sh @@ -198,7 +198,7 @@ init_tests() { d_bch="overall operations with emulated RPC data (Bitcoin Cash Node)" t_bch=" - - $cmdtest_py --coin=bch --exclude regtest + - $cmdtest_py --coin=bch --exclude regtest,autosign_automount - $cmdtest_py --coin=bch --cashaddr=0 ref3_addr " @@ -213,7 +213,7 @@ init_tests() { d_ltc="overall operations with emulated RPC data (Litecoin)" t_ltc=" - - $cmdtest_py --coin=ltc --exclude regtest + - $cmdtest_py --coin=ltc --exclude regtest,autosign_automount - $cmdtest_py --coin=ltc --segwit - $cmdtest_py --coin=ltc --segwit-random - $cmdtest_py --coin=ltc --bech32