From 728e32a6cd089acbd3d445aae08eca2fb07864d1 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 11 Sep 2026 14:10:55 +0000 Subject: [PATCH] test suite: rename *BOGUS* environment variables --- mmgen/cfg.py | 8 ++++---- mmgen/proto/btc/tx/online.py | 2 +- mmgen/tx/online.py | 2 +- test/cmdtest_d/ethdev.py | 2 +- test/cmdtest_d/include/runner.py | 2 +- test/cmdtest_d/main.py | 2 +- test/cmdtest_d/regtest.py | 2 +- test/cmdtest_d/rune.py | 2 +- test/cmdtest_d/tool.py | 2 +- test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py | 4 ++-- test/overlay/fakemods/mmgen/rpc.py | 2 +- test/overlay/fakemods/mmgen/tw/unspent.py | 2 +- test/overlay/fakemods/mmgen/tw/view.py | 2 +- test/overlay/fakemods/mmgen/tx/new.py | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mmgen/cfg.py b/mmgen/cfg.py index 0ca63aae..10c8b06e 100755 --- a/mmgen/cfg.py +++ b/mmgen/cfg.py @@ -262,14 +262,14 @@ class Config(Lockable): priority = 0 # test suite: - bogus_send = False - bogus_unspent_data = '' debug_utf8 = False exec_wrapper = False ignore_test_py_exception = False test_suite = False test_suite_autosign_led_simulate = False test_suite_autosign_threaded = False + test_suite_bogus_send = False + test_suite_bogus_unspent_data = '' test_suite_devnet_block_period = 0 test_suite_xmr_autosign = False test_suite_cfgtest = False @@ -351,8 +351,6 @@ class Config(Lockable): 'MMGEN_AES_BACKEND', 'MMGEN_BLACKLIST_DAEMONS', - 'MMGEN_BOGUS_SEND', - 'MMGEN_BOGUS_UNSPENT_DATA', 'MMGEN_COLUMNS', 'MMGEN_DAEMON_STATE_TIMEOUT', 'MMGEN_DEBUG', @@ -383,6 +381,8 @@ class Config(Lockable): 'MMGEN_TEST_SUITE', 'MMGEN_TEST_SUITE_AUTOSIGN_LED_SIMULATE', 'MMGEN_TEST_SUITE_AUTOSIGN_THREADED', + 'MMGEN_TEST_SUITE_BOGUS_SEND', + 'MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA', 'MMGEN_TEST_SUITE_CFGTEST', 'MMGEN_TEST_SUITE_DETERMINISTIC', 'MMGEN_TEST_SUITE_DEVNET_BLOCK_PERIOD', diff --git a/mmgen/proto/btc/tx/online.py b/mmgen/proto/btc/tx/online.py index cce015e1..6831a16b 100755 --- a/mmgen/proto/btc/tx/online.py +++ b/mmgen/proto/btc/tx/online.py @@ -23,7 +23,7 @@ class OnlineSigned(Signed, TxBase.OnlineSigned): self.check_correct_chain() - if not self.cfg.bogus_send: + if not self.cfg.test_suite_bogus_send: if self.has_segwit_outputs() and not self.rpc.info('segwit_is_active'): die(2, 'Transaction has Segwit outputs, but this blockchain does not support Segwit' + ' at the current height') diff --git a/mmgen/tx/online.py b/mmgen/tx/online.py index 7cf1df6f..9c8eb621 100755 --- a/mmgen/tx/online.py +++ b/mmgen/tx/online.py @@ -133,7 +133,7 @@ class OnlineSigned(Signed): ymsg('Transaction cannot be sent') else: # node send msg(f'Sending TX: {coin_txid.hl()}') - if cfg.bogus_send: + if cfg.test_suite_bogus_send: msg(f'BOGUS transaction NOT sent: {coin_txid.hl()}') else: if idx != '': diff --git a/test/cmdtest_d/ethdev.py b/test/cmdtest_d/ethdev.py index f7974f4b..2da65359 100755 --- a/test/cmdtest_d/ethdev.py +++ b/test/cmdtest_d/ethdev.py @@ -758,7 +758,7 @@ class CmdTestEthdev(CmdTestEthdevMethods, CmdTestBase, CmdTestShared): dfl_devkey+'\n') self.message = 'attack at dawn' - self.spawn_env['MMGEN_BOGUS_SEND'] = '' + self.spawn_env['MMGEN_TEST_SUITE_BOGUS_SEND'] = '' TestProxy(self, cfg) diff --git a/test/cmdtest_d/include/runner.py b/test/cmdtest_d/include/runner.py index eb34c2d8..75a117a0 100755 --- a/test/cmdtest_d/include/runner.py +++ b/test/cmdtest_d/include/runner.py @@ -108,7 +108,7 @@ class CmdTestRunner: self.spawn_env.update({ 'MMGEN_NO_LICENSE': '1', - 'MMGEN_BOGUS_SEND': '1', + 'MMGEN_TEST_SUITE_BOGUS_SEND': '1', 'MMGEN_TEST_SUITE_PEXPECT': '1', 'EXEC_WRAPPER_DO_RUNTIME_MSG':'1', # if cmdtest.py itself is running under exec_wrapper, disable writing of traceback file for spawned script diff --git a/test/cmdtest_d/main.py b/test/cmdtest_d/main.py index 3e3cce0c..5f360d1b 100755 --- a/test/cmdtest_d/main.py +++ b/test/cmdtest_d/main.py @@ -383,7 +383,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared): self.txbump_fee = {'btc':'123s', 'bch':'567s', 'ltc':'12345s'}[self.coin] self.unspent_data_file = joinpath('test', 'trash', 'unspent.json') - self.spawn_env['MMGEN_BOGUS_UNSPENT_DATA'] = self.unspent_data_file + self.spawn_env['MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'] = self.unspent_data_file @property def lbl_id(self): diff --git a/test/cmdtest_d/regtest.py b/test/cmdtest_d/regtest.py index fb26fc2a..a01941d1 100755 --- a/test/cmdtest_d/regtest.py +++ b/test/cmdtest_d/regtest.py @@ -506,7 +506,7 @@ class CmdTestRegtest(CmdTestBase, CmdTestShared): self.deterministic = True omsg('Deterministic testing enabled!') - self.spawn_env['MMGEN_BOGUS_SEND'] = '' + self.spawn_env['MMGEN_TEST_SUITE_BOGUS_SEND'] = '' self.write_to_tmpfile('wallet_password', rt_pw) self.dfl_mmtype = 'C' if coin == 'bch' else 'B' diff --git a/test/cmdtest_d/rune.py b/test/cmdtest_d/rune.py index d78e3d9d..3ef1af32 100755 --- a/test/cmdtest_d/rune.py +++ b/test/cmdtest_d/rune.py @@ -122,7 +122,7 @@ class CmdTestRune(CmdTestRuneMethods, CmdTestEthdevMethods, CmdTestBase, CmdTest from mmgen.protocol import init_proto self.proto = init_proto(cfg, network_id=self.proto.coin + '_rt', need_amt=True) - self.spawn_env['MMGEN_BOGUS_SEND'] = '' + self.spawn_env['MMGEN_TEST_SUITE_BOGUS_SEND'] = '' self.rpc_server = ThornodeRPCServer(cfg) self.rpc_server.start() diff --git a/test/cmdtest_d/tool.py b/test/cmdtest_d/tool.py index c2f6040d..96cb187e 100755 --- a/test/cmdtest_d/tool.py +++ b/test/cmdtest_d/tool.py @@ -126,7 +126,7 @@ class CmdTestTool(CmdTestMain, CmdTestBase): t = self.spawn( 'mmgen-tool', ['twview'], - env = {'MMGEN_BOGUS_UNSPENT_DATA': joinpath(ref_dir, 'bad-comment-unspent.json')}, + env = {'MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA': joinpath(ref_dir, 'bad-comment-unspent.json')}, exit_val = 2) t.expect('cannot be converted to TwComment') return t diff --git a/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py b/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py index a8772ef0..5e153c3f 100644 --- a/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py +++ b/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py @@ -1,7 +1,7 @@ import os as overlay_fake_os from .unspent_orig import * -if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'): +if overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'): class overlay_fake_BitcoinTwUnspentOutputs(BitcoinTwUnspentOutputs): @@ -10,7 +10,7 @@ if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'): from ....fileutil import get_data_from_file return json.loads(get_data_from_file( self.cfg, - overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA') + overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA') )) BitcoinTwUnspentOutputs.get_rpc_data = overlay_fake_BitcoinTwUnspentOutputs.get_rpc_data diff --git a/test/overlay/fakemods/mmgen/rpc.py b/test/overlay/fakemods/mmgen/rpc.py index 5d3c9834..c7f5bcc8 100644 --- a/test/overlay/fakemods/mmgen/rpc.py +++ b/test/overlay/fakemods/mmgen/rpc.py @@ -1,7 +1,7 @@ import os as overlay_fake_os from .rpc_orig import * -if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'): +if overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'): class overlay_fake_data: rpc_init = rpc_init diff --git a/test/overlay/fakemods/mmgen/tw/unspent.py b/test/overlay/fakemods/mmgen/tw/unspent.py index d9894f55..82818e49 100644 --- a/test/overlay/fakemods/mmgen/tw/unspent.py +++ b/test/overlay/fakemods/mmgen/tw/unspent.py @@ -1,7 +1,7 @@ import os as overlay_fake_os from .unspent_orig import * -if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'): +if overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'): class overlay_fake_TwUnspentOutputs(TwUnspentOutputs): diff --git a/test/overlay/fakemods/mmgen/tw/view.py b/test/overlay/fakemods/mmgen/tw/view.py index 2a4ae167..64c573f8 100644 --- a/test/overlay/fakemods/mmgen/tw/view.py +++ b/test/overlay/fakemods/mmgen/tw/view.py @@ -21,7 +21,7 @@ if overlay_fake_os.getenv('MMGEN_TEST_SUITE_DETERMINISTIC'): 'date_time': lambda rpc, secs: '{}-{:02}-{:02} {:02}:{:02}'.format( *time.gmtime(next(overlay_fake_data.time_iter))[:5])} -if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'): +if overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'): # 1831006505 (09 Jan 2028) = projected time of block 1000000 TwView.date_formatter['days'] = lambda rpc, secs: (2178144000 - secs) // 86400 # 9 Jan 2039 00:00:00 diff --git a/test/overlay/fakemods/mmgen/tx/new.py b/test/overlay/fakemods/mmgen/tx/new.py index 08bfcfdb..64574e52 100644 --- a/test/overlay/fakemods/mmgen/tx/new.py +++ b/test/overlay/fakemods/mmgen/tx/new.py @@ -1,7 +1,7 @@ import os as overlay_fake_os from .new_orig import * -if overlay_fake_os.getenv('MMGEN_BOGUS_UNSPENT_DATA'): +if overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'): class overlay_fake_New(New):