(self, path, direction, counter)
| 173 | self.test.vapi.pg_delete_interface(sw_if_index=self.sw_if_index) |
| 174 | |
| 175 | def link_pcap_file(self, path, direction, counter): |
| 176 | if not config.keep_pcaps: |
| 177 | return |
| 178 | filename = os.path.basename(path) |
| 179 | test_name = ( |
| 180 | self.test_name |
| 181 | if hasattr(self, "test_name") |
| 182 | else f"suite{self.test.__name__}" |
| 183 | ) |
| 184 | name = f"{self.test.tempdir}/{test_name}.[timestamp:{time.time():.8f}].{self.name}-{direction}-{counter:04}.{filename}" |
| 185 | if os.path.isfile(name): |
| 186 | self.test.logger.debug( |
| 187 | f"Skipping hard link creation: {name} already exists!" |
| 188 | ) |
| 189 | return |
| 190 | try: |
| 191 | if os.path.isfile(path): |
| 192 | self.test.logger.debug(f"Creating hard link {path}->{name}") |
| 193 | os.link(path, name) |
| 194 | except OSError: |
| 195 | self.test.logger.debug( |
| 196 | f"OSError: Could not create hard link {path}->{name}" |
| 197 | ) |
| 198 | |
| 199 | def remove_old_pcap_file(self, path): |
| 200 | self.wait_for_pg_stop() |
no outgoing calls
no test coverage detected