MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_constant_packet_size

Function test_constant_packet_size

tests/test_connection.py:5082–5104  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5080
5081
5082def 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
5107def test_connect_proxy_maxlen_hostname(node_factory):

Callers

nothing calls this directly

Calls 7

get_nodesMethod · 0.80
join_nodesMethod · 0.80
is_in_logMethod · 0.80
connectMethod · 0.45
startMethod · 0.45
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected