From 785fcc1af569b7a90d4ae8945ed698dfef72d2da Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Tue, 13 May 2025 12:06:10 -0500 Subject: [PATCH] pytest: test reckless direct install --- tests/test_reckless.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_reckless.py b/tests/test_reckless.py index 4a1e59a93..e0244fa10 100644 --- a/tests/test_reckless.py +++ b/tests/test_reckless.py @@ -235,9 +235,8 @@ def test_local_dir_install(node_factory): """Test search and install from local directory source.""" n = get_reckless_node(node_factory) n.start() - r = reckless([f"--network={NETWORK}", "-v", "source", "add", - os.path.join(n.lightning_dir, '..', 'lightningd', 'testplugpass')], - dir=n.lightning_dir) + source_dir = str(Path(n.lightning_dir / '..' / 'lightningd' / 'testplugpass').resolve()) + r = reckless([f"--network={NETWORK}", "-v", "source", "add", source_dir], dir=n.lightning_dir) assert r.returncode == 0 r = reckless([f"--network={NETWORK}", "-v", "install", "testplugpass"], dir=n.lightning_dir) assert r.returncode == 0 @@ -246,6 +245,15 @@ def test_local_dir_install(node_factory): print(plugin_path) assert os.path.exists(plugin_path) + # Retry with a direct install passing the full path to the local source + r = reckless(['uninstall', 'testplugpass', '-v'], dir=n.lightning_dir) + assert not os.path.exists(plugin_path) + r = reckless(['source', 'remove', source_dir], dir=n.lightning_dir) + assert 'plugin source removed' in r.stdout + r = reckless(['install', '-v', source_dir], dir=n.lightning_dir) + assert 'testplugpass enabled' in r.stdout + assert os.path.exists(plugin_path) + @unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection") def test_disable_enable(node_factory):