diff options
author | Hadi Rayan Al-Sandid <halsandi@cisco.com> | 2024-11-26 17:25:27 +0100 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2024-11-27 08:20:17 +0000 |
commit | 7d469364c5d9f7dc1b42143a6c6a4a7aafe89b34 (patch) | |
tree | ba3d36471c0cdb5e4026488b8746fb249bf40998 /test | |
parent | 1beb88ed3ba28b5e51b1a8d8d5573645c048031a (diff) |
api: fix bug in pcap capture api
pcap api cleanup can cause crash in certain scenarios
e.g.missing/invalid 'filename' parameter.
Type: fix
Change-Id: I92417765960de84e30ed7cb945d40c50d722fb6c
Signed-off-by: Hadi Rayan Al-Sandid <halsandi@cisco.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/test_pcap.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_pcap.py b/test/test_pcap.py index b73a601bcc8..1169dcccfc1 100644 --- a/test/test_pcap.py +++ b/test/test_pcap.py @@ -163,6 +163,16 @@ class TestPcap(VppTestCase): os.remove("/tmp/trace_any_filter.pcap") os.remove("/tmp/trace_drop_err.pcap") + # Attempting to start a trace with no filename should return an error + with self.vapi.assert_negative_api_retval(): + self.vapi.pcap_trace_on( + capture_rx=True, + capture_tx=True, + filter=True, + max_packets=1000, + sw_if_index=0, + ) + if __name__ == "__main__": unittest.main(testRunner=VppTestRunner) |