|
1 | 1 | from fixtures import * # noqa: F401,F403 |
2 | 2 | from pyln.testing.utils import TEST_NETWORK, wait_for |
3 | 3 | from pyln.client import Millisatoshi |
4 | | -import os |
5 | 4 | import requests |
6 | 5 | from pathlib import Path |
7 | 6 | from requests.adapters import HTTPAdapter |
@@ -469,43 +468,6 @@ def test_http_headers(node_factory): |
469 | 468 | assert response.headers['Access-Control-Allow-Origin'] == 'http://192.168.1.10:1010' |
470 | 469 |
|
471 | 470 |
|
472 | | -def test_old_params(node_factory): |
473 | | - """Test that we handle the v23.08-style parameters""" |
474 | | - rest_port = str(node_factory.get_unused_port()) |
475 | | - rest_host = '127.0.0.1' |
476 | | - base_url = f'https://{rest_host}:{rest_port}' |
477 | | - l1 = node_factory.get_node(options={'rest-port': rest_port, |
478 | | - 'rest-host': rest_host, |
479 | | - 'allow-deprecated-apis': True, |
480 | | - 'i-promise-to-fix-broken-api-user': ['rest-port.clnrest-prefix', 'rest-host.clnrest-prefix']}, |
481 | | - broken_log=r'DEPRECATED API USED rest-*') |
482 | | - |
483 | | - # This might happen really early! |
484 | | - l1.daemon.logsearch_start = 0 |
485 | | - l1.daemon.wait_for_logs([r'UNUSUAL lightningd: Option rest-port=.* deprecated in v23\.11, renaming to clnrest-port', |
486 | | - r'UNUSUAL lightningd: Option rest-host=.* deprecated in v23\.11, renaming to clnrest-host']) |
487 | | - l1.daemon.wait_for_log(r'plugin-clnrest: REST server running at ' + base_url) |
488 | | - |
489 | | - # Now try one where a plugin (e.g. clightning-rest) registers the option. |
490 | | - plugin = os.path.join(os.path.dirname(__file__), 'plugins/clnrest-use-options.py') |
491 | | - l2 = node_factory.get_node(options={'rest-port': rest_port, |
492 | | - 'rest-host': rest_host, |
493 | | - 'plugin': plugin, |
494 | | - 'allow-deprecated-apis': True, |
495 | | - 'i-promise-to-fix-broken-api-user': ['rest-port.clnrest-prefix', 'rest-host.clnrest-prefix']}, |
496 | | - broken_log=r'DEPRECATED API USED rest-*') |
497 | | - |
498 | | - l2.daemon.logsearch_start = 0 |
499 | | - # We still rename this one, since it's for clnrest. |
500 | | - assert l2.daemon.is_in_log(r'UNUSUAL lightningd: Option rest-host=.* deprecated in v23\.11, renaming to clnrest-host') |
501 | | - |
502 | | - # This one does not get renamed! |
503 | | - assert not l2.daemon.is_in_log(r'UNUSUAL lightningd: Option rest-port=.* deprecated in v23\.11, renaming to clnrest-host') |
504 | | - assert [p for p in l2.rpc.plugin('list')['plugins'] if p['name'].endswith('clnrest')] == [] |
505 | | - assert l2.daemon.is_in_log(r'plugin-clnrest: Killing plugin: disabled itself at init: `clnrest-port` option is not configured') |
506 | | - assert l2.daemon.is_in_log(rf'clnrest-use-options.py: rest-port is {rest_port}') |
507 | | - |
508 | | - |
509 | 471 | def test_websocket_upgrade_header(node_factory): |
510 | 472 | """Test that not setting an upgrade header leads to rejection""" |
511 | 473 | # start a node with clnrest |
|
0 commit comments