diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2023-11-27 20:23:03 -0500 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2023-11-28 03:34:49 +0000 |
commit | 87a8826d173c4e4ff3da3a613f19eb9a91673a75 (patch) | |
tree | 8c4c3edd01f155aca7c0882cebc92ca011ab2d8c /test/vpp_pg_interface.py | |
parent | 4b08632748727486e7ebfdcf4d992743595bc500 (diff) |
tests: refactor pcap file deletion to improve robustness
Type: test
Change-Id: I504c079126bd8b33c5e217a1b9086788a8c778e5
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'test/vpp_pg_interface.py')
-rw-r--r-- | test/vpp_pg_interface.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py index cb17e2d9080..cdb91ed1e41 100644 --- a/test/vpp_pg_interface.py +++ b/test/vpp_pg_interface.py @@ -172,11 +172,8 @@ class VppPGInterface(VppInterface): ) def remove_old_pcap_file(self, path): - try: - self.test.logger.debug(f"Removing {path}") - os.remove(path) - except OSError: - self.test.logger.debug(f"OSError: Could not remove {path}") + self.wait_for_pg_stop() + self.test.unlink_testcase_file(self.test, Path(path)) return def decode_pcap_files(self, pcap_dir, filename_prefix): |