Test startup options `clnrest-host`, `clnrest-protocol` and `clnrest-certs`.
(node_factory)
| 432 | |
| 433 | |
| 434 | def test_options(node_factory): |
| 435 | """Test startup options `clnrest-host`, `clnrest-protocol` and `clnrest-certs`.""" |
| 436 | # with invalid port |
| 437 | rest_port = 1000 |
| 438 | l1 = node_factory.get_node(options={'clnrest-port': rest_port}) |
| 439 | assert l1.daemon.is_in_log(f'plugin-clnrest: Killing plugin: disabled itself at init: `clnrest-port` {rest_port}, should be a valid available port between 1024 and 65535.') |
| 440 | |
| 441 | # with invalid protocol |
| 442 | rest_port = str(node_factory.get_unused_port()) |
| 443 | rest_protocol = 'htttps' |
| 444 | l1 = node_factory.get_node(options={'clnrest-port': rest_port, |
| 445 | 'clnrest-protocol': rest_protocol}) |
| 446 | assert l1.daemon.is_in_log(r'plugin-clnrest: Killing plugin: disabled itself at init: `clnrest-protocol` can either be http or https.') |
| 447 | |
| 448 | # with invalid host |
| 449 | rest_port = str(node_factory.get_unused_port()) |
| 450 | rest_host = '127.0.0.12.15' |
| 451 | l1 = node_factory.get_node(options={'clnrest-port': rest_port, |
| 452 | 'clnrest-host': rest_host}) |
| 453 | assert l1.daemon.is_in_log(r'plugin-clnrest: Killing plugin: disabled itself at init: `clnrest-host` should be a valid IP.') |
| 454 | |
| 455 | |
| 456 | def test_http_headers(node_factory): |
nothing calls this directly
no test coverage detected