Test that TCP packets between nodes are constant size. This will be skipped unless you can run `dumpcap` (usually means you have to be in the `wireshark` group).
(node_factory, tcp_capture)
| 5080 | |
| 5081 | |
| 5082 | def test_constant_packet_size(node_factory, tcp_capture): |
| 5083 | """ |
| 5084 | Test that TCP packets between nodes are constant size. This will be skipped unless |
| 5085 | you can run `dumpcap` (usually means you have to be in the `wireshark` group). |
| 5086 | """ |
| 5087 | l1, l2, l3, l4 = node_factory.get_nodes(4, opts={'message-padding': True}) |
| 5088 | |
| 5089 | # Encrypted setup BOLT 8 has some short packets. |
| 5090 | l1.connect(l2) |
| 5091 | l2.connect(l3) |
| 5092 | |
| 5093 | tcp_capture.start(l2.port) |
| 5094 | |
| 5095 | # This gives us gossip send a recv, and channel establishment. |
| 5096 | node_factory.join_nodes([l1, l2, l3, l4], wait_for_announce=True) |
| 5097 | |
| 5098 | # Forwarding, incoming and outgoing payments. |
| 5099 | for src, dest in (l1, l2), (l2, l3), (l1, l4): |
| 5100 | inv = dest.rpc.invoice(10000000, "test_constant_packet_size", "test_constant_packet_size") |
| 5101 | src.rpc.xpay(inv['bolt11']) |
| 5102 | |
| 5103 | # Padding pings don't elicit a response |
| 5104 | assert not l2.daemon.is_in_log("connectd: Unexpected pong") |
| 5105 | |
| 5106 | |
| 5107 | def test_connect_proxy_maxlen_hostname(node_factory): |