(tmp_path)
| 174 | |
| 175 | @pytest.fixture |
| 176 | def 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() |
nothing calls this directly
no test coverage detected