From f95e8f7f50f21e452b5edd2f8926cff51e16db65 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 15 Sep 2026 10:51:04 +0000 Subject: [PATCH] move `test_suite_autosign_led_simulate` cfg var to test suite --- mmgen/autosign/__init__.py | 3 ++- test/cmdtest_d/autosign.py | 2 +- test/overlay/fakemods/mmgen/autosign/__init__.py | 3 +++ test/overlay/fakemods/mmgen/cfg.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mmgen/autosign/__init__.py b/mmgen/autosign/__init__.py index d4af2379..878bce42 100755 --- a/mmgen/autosign/__init__.py +++ b/mmgen/autosign/__init__.py @@ -30,6 +30,7 @@ class Autosign: wallet_subdir = 'autosign' linux_blkid_cmd = 'sudo blkid -s LABEL -o value' keylist_fn = 'keylist.mmenc' + simulate_led = False cmds = ('setup', 'xmr_setup', 'sign', 'wait') @@ -544,7 +545,7 @@ class Autosign: from ..led import LEDControl self.led = LEDControl( enabled = self.cfg.led, - simulate = self.cfg.test_suite_autosign_led_simulate) + simulate = self.simulate_led) self.led.set('off') def setup_non_mmgen_keys(self): diff --git a/test/cmdtest_d/autosign.py b/test/cmdtest_d/autosign.py index 5b6d6b98..53c583da 100755 --- a/test/cmdtest_d/autosign.py +++ b/test/cmdtest_d/autosign.py @@ -1126,7 +1126,7 @@ class CmdTestAutosignLive(CmdTestAutosignBTC): t.kill(2) # 2 = SIGINT if self.simulate_led and led_opts: - t.expect(f'Resetting {self.color} LED') + t.expect('Stopping LED') return t class CmdTestAutosignLiveSimulate(CmdTestAutosignLive): diff --git a/test/overlay/fakemods/mmgen/autosign/__init__.py b/test/overlay/fakemods/mmgen/autosign/__init__.py index a1e28ad4..bf4355ad 100644 --- a/test/overlay/fakemods/mmgen/autosign/__init__.py +++ b/test/overlay/fakemods/mmgen/autosign/__init__.py @@ -20,3 +20,6 @@ Autosign.dev_label = 'MMGEN_TS_TX' # autosign_live only (Linux) Autosign.linux_mount_subdir = 'mmgen_ts_autosign' Autosign.macOS_ramdisk_name = 'TestAutosignRamDisk' Autosign.init_fixup = overlay_fake_Autosign.init_fixup + +if os.getenv('MMGEN_TEST_SUITE_AUTOSIGN_LED_SIMULATE'): + Autosign.simulate_led = True diff --git a/test/overlay/fakemods/mmgen/cfg.py b/test/overlay/fakemods/mmgen/cfg.py index 75365639..4e21d287 100644 --- a/test/overlay/fakemods/mmgen/cfg.py +++ b/test/overlay/fakemods/mmgen/cfg.py @@ -33,7 +33,6 @@ for k, v in { 'test_suite_cfgtest': False, # cfgfile - using getattr() with dfl val - OK 'test_suite_popen_spawn': False, # line_input() - using getattr() with dfl val - OK 'test_suite_hold_protect_disable': False, # init_term() - using getattr() with dfl val - OK - 'test_suite_autosign_led_simulate': False, # autosign - OK 'test_suite_autosign_threaded': False, # autosign - OK 'test_suite_xmr_autosign': False, # autosign - OK 'test_suite_root_pfx': '', # autosign - OK @@ -41,6 +40,7 @@ for k, v in { 'test_datadir': os.path.join('test', 'tmp', 'data_dir'), # cfg - OK # these are referenced in test suite only: + 'test_suite_autosign_led_simulate': False, 'test_suite_exec_wrapper': False, 'test_suite_bogus_unspent_data': '', 'test_suite_debug_utf8': False,