Create a hardlink to the out file with a counter and a file containing stack trace to ease debugging in case of multiple capture files present.
(self, kind)
| 262 | self.link_pcap_file(self.get_in_path(worker), "inp", self.in_history_counter) |
| 263 | |
| 264 | def generate_debug_aid(self, kind): |
| 265 | """Create a hardlink to the out file with a counter and a file |
| 266 | containing stack trace to ease debugging in case of multiple capture |
| 267 | files present.""" |
| 268 | self.test.logger.debug("Generating debug aid for %s on %s" % (kind, self._name)) |
| 269 | link_path, stack_path = [ |
| 270 | "%s/debug_%s_%s_%s.%s" |
| 271 | % (self.test.tempdir, self._name, self._out_assert_counter, kind, suffix) |
| 272 | for suffix in ["pcap", "stack"] |
| 273 | ] |
| 274 | os.link(self.out_path, link_path) |
| 275 | with open(stack_path, "w") as f: |
| 276 | f.writelines(format_stack()) |
| 277 | self._out_assert_counter += 1 |
| 278 | |
| 279 | def _get_capture(self, filter_out_fn=is_ipv6_misc): |
| 280 | """Helper method to get capture and filter it""" |