+ def generate_debug_aid(self, kind):
+ """ 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.test.logger.debug("Generating debug aid for %s on %s" %
+ (kind, self._name))
+ link_path, stack_path = ["%s/debug_%s_%s_%s.%s" %
+ (self.test.tempdir, self._name,
+ self._out_assert_counter, kind, suffix)
+ for suffix in ["pcap", "stack"]
+ ]
+ os.link(self.out_path, link_path)
+ with open(stack_path, "w") as f:
+ f.writelines(format_stack())
+ self._out_assert_counter += 1
+