@@ -141,18 +141,19 @@ def reckless(cmds: list, dir: PosixPath = None,
141141 return RecklessResult (r , r .returncode , stdout , stderr )
142142
143143
144- def get_reckless_node (node_factory , options = {}, start = False ):
145- '''This may be unnecessary, but a preconfigured lightning dir
146- is useful for reckless testing.'''
147- node = node_factory .get_node (options = options , start = start )
148- return node
149-
150-
151144def get_reckless_executable ():
152145 FILE_PATH = Path (os .path .dirname (os .path .realpath (__file__ )))
153146 return str (FILE_PATH .parent / 'tools' / 'reckless' )
154147
155148
149+ def get_reckless_node (node_factory , options = {}, may_fail = False , start = False ):
150+ '''This may be unnecessary, but a preconfigured lightning dir
151+ is useful for reckless testing.'''
152+ os .environ ['RECKLESS_EXECUTABLE' ] = get_reckless_executable ()
153+ node = node_factory .get_node (options = options , may_fail = may_fail , start = start )
154+ return node
155+
156+
156157def test_basic_help ():
157158 '''Validate that argparse provides basic help info.
158159 This requires no config options passed to reckless.'''
@@ -191,7 +192,7 @@ def test_reckless_version_listconfig(node_factory):
191192 # Now test via reckless-rpc plugin
192193 node .start ()
193194 # FIXME: the plugin finds the installed reckless utility rather than the build directory reckless
194- listconfig = node .rpc .reckless (command = 'listconfig' , reckless_executable = get_reckless_executable () )
195+ listconfig = node .rpc .reckless ('listconfig' )
195196 print (listconfig )
196197 assert listconfig ['result' ]['lightning_dir' ] == str (node .lightning_dir )
197198 assert listconfig ['result' ]['lightning_conf' ] == str (node .lightning_dir / NETWORK / 'config' )
@@ -485,18 +486,19 @@ def test_reckless_notifications(node_factory):
485486 reckless (['listconfig' , f'--network={ NETWORK } ' , '--json' ],
486487 dir = node .lightning_dir )
487488 node .start ()
488- listconfig_log = node .rpc .reckless (command = 'listconfig' , reckless_executable = get_reckless_executable () )['log' ]
489+ listconfig_log = node .rpc .reckless ('listconfig' )['log' ]
489490 # Some trouble escaping the clone url for searching
490491 listconfig_log .pop (1 )
491492 for log in listconfig_log :
492493 assert node .daemon .is_in_log (f"reckless_log: {{'reckless_log': {{'log': '{ log } '" , start = 0 )
493494 node .stop ()
494495
495496
497+ @pytest .mark .timeout (120 )
496498def test_reckless_usage (node_factory ):
497499 """The reckless rpc response is more useful if it can pass back incorrect
498500 usage errors."""
499- node = node_factory . get_node ( options = {}, may_fail = True , start = False )
501+ node = get_reckless_node ( node_factory , options = {}, may_fail = True , start = False )
500502 node .start (stderr_redir = True )
501503 r = reckless (['searhc' , 'testplugpass' ],
502504 dir = node .lightning_dir )
0 commit comments