tests: refactor asf framework code

- Make framework.py classes a subset of asfframework.py classes
- Remove all packet related code from asfframework.py
- Add test class and test case set up debug output to log
- Repatriate packet tests from asf to test directory
- Remove non-packet related code from framework.py and
  inherit them from asfframework.py classes
- Clean up unused import variables
- Re-enable BFD tests on Ubuntu 22.04 and fix
  intermittent test failures in echo_looped_back
  testcases (where # control packets verified but
  not guaranteed to be received during test)
- Re-enable Wireguard tests on Ubuntu 22.04 and fix
  intermittent test failures in handshake ratelimiting
  testcases and event testcase
- Run Wiregard testcase suites solo
- Improve debug output in log.txt
- Increase VCL/LDP post sleep timeout to allow iperf server
  to finish cleanly.
- Fix pcap history files to be sorted by suite and testcase
  and ensure order/timestamp is correct based on creation
  in the testcase.
- Decode pcap files for each suite and testcase for all
  errors or if configured via comandline option / env var
- Improve vpp corefile detection to allow complete corefile
  generation
- Disable vm vpp interfaces testcases on debian11
- Clean up failed unittest dir when retrying failed testcases
  and unify testname directory and failed linknames into
  framwork functions

Type: test

Change-Id: I0764f79ea5bb639d278bf635ed2408d4d5220e1e
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
diff --git a/test/test_bfd.py b/test/test_bfd.py
index 67ddb4b..0842fd7 100644
--- a/test/test_bfd.py
+++ b/test/test_bfd.py
@@ -11,8 +11,7 @@
 import time
 import unittest
 from random import randint, shuffle, getrandbits
-from socket import AF_INET, AF_INET6, inet_ntop
-from struct import pack, unpack
+from socket import AF_INET, AF_INET6
 
 import scapy.compat
 from scapy.layers.inet import UDP, IP
@@ -30,10 +29,13 @@
     BFDState,
     BFD_vpp_echo,
 )
-from framework import tag_fixme_vpp_workers, tag_fixme_ubuntu2204, tag_fixme_debian11
-from framework import is_distro_ubuntu2204, is_distro_debian11
-from framework import VppTestCase, VppTestRunner
-from framework import tag_run_solo
+from framework import VppTestCase
+from asfframework import (
+    tag_fixme_vpp_workers,
+    tag_fixme_debian11,
+    tag_run_solo,
+    VppTestRunner,
+)
 from util import ppp
 from vpp_ip import DpoProto
 from vpp_ip_route import VppIpRoute, VppRoutePath
@@ -41,7 +43,6 @@
 from vpp_papi_provider import UnexpectedApiReturnValueError, CliFailedCommandError
 from vpp_pg_interface import CaptureTimeoutError, is_ipv6_misc
 from vpp_gre_interface import VppGreInterface
-from vpp_papi import VppEnum
 
 USEC_IN_SEC = 1000000
 
@@ -819,7 +820,6 @@
 
 
 @tag_run_solo
-@tag_fixme_ubuntu2204
 @tag_fixme_debian11
 class BFD4TestCase(VppTestCase):
     """Bidirectional Forwarding Detection (BFD)"""
@@ -831,10 +831,6 @@
 
     @classmethod
     def setUpClass(cls):
-        if (is_distro_ubuntu2204 == True or is_distro_debian11 == True) and not hasattr(
-            cls, "vpp"
-        ):
-            return
         super(BFD4TestCase, cls).setUpClass()
         cls.vapi.cli("set log class bfd level debug")
         try:
@@ -1324,7 +1320,6 @@
         stats_after = bfd_grab_stats_snapshot(self)
         diff = bfd_stats_diff(stats_before, stats_after)
         self.assertEqual(0, diff.rx, "RX counter bumped but no BFD packets sent")
-        self.assertEqual(bfd_control_packets_rx, diff.tx, "TX counter incorrect")
         self.assertEqual(
             0, diff.rx_echo, "RX echo counter bumped but no BFD session exists"
         )
@@ -1729,7 +1724,6 @@
 
 @tag_run_solo
 @tag_fixme_vpp_workers
-@tag_fixme_ubuntu2204
 class BFD6TestCase(VppTestCase):
     """Bidirectional Forwarding Detection (BFD) (IPv6)"""
 
@@ -1740,8 +1734,6 @@
 
     @classmethod
     def setUpClass(cls):
-        if is_distro_ubuntu2204 == True and not hasattr(cls, "vpp"):
-            return
         super(BFD6TestCase, cls).setUpClass()
         cls.vapi.cli("set log class bfd level debug")
         try:
@@ -1765,8 +1757,6 @@
 
     def setUp(self):
         super(BFD6TestCase, self).setUp()
-        if is_distro_ubuntu2204 == True and not hasattr(self, "vpp"):
-            return
         self.factory = AuthKeyFactory()
         self.vapi.want_bfd_events()
         self.pg0.enable_capture()
@@ -1892,7 +1882,6 @@
         stats_after = bfd_grab_stats_snapshot(self)
         diff = bfd_stats_diff(stats_before, stats_after)
         self.assertEqual(0, diff.rx, "RX counter bumped but no BFD packets sent")
-        self.assertEqual(bfd_control_packets_rx, diff.tx, "TX counter incorrect")
         self.assertEqual(
             0, diff.rx_echo, "RX echo counter bumped but no BFD session exists"
         )