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

Function tcp_capture

tests/fixtures.py:176–190  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

174
175@pytest.fixture
176def tcp_capture(tmp_path):
177 # You will need permissions. Most distributions have a group which has
178 # permissions to use dumpcap:
179 # $ ls -l /usr/bin/dumpcap
180 # -rwxr-xr-- 1 root wireshark 229112 Apr 16 2024 /usr/bin/dumpcap
181 # $ getcap /usr/bin/dumpcap
182 # /usr/bin/dumpcap cap_net_admin,cap_net_raw=eip
183 # So you just need to be in the wireshark group.
184 if not dumpcap_usable():
185 pytest.skip("dumpcap/tshark not available or insufficient privileges")
186
187 cap = TcpCapture(tmp_path)
188 yield cap
189 cap.stop()
190 cap.assert_constant_payload()

Callers

nothing calls this directly

Calls 4

stopMethod · 0.95
dumpcap_usableFunction · 0.85
TcpCaptureClass · 0.85

Tested by

no test coverage detected