diff --git a/test/framework.py b/test/framework.py
index 85bd661..efb1e6b 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -144,12 +144,14 @@
 def _is_skip_aarch64_set():
     return os.getenv('SKIP_AARCH64', 'n').lower() in ('yes', 'y', '1')
 
+
 is_skip_aarch64_set = _is_skip_aarch64_set()
 
 
 def _is_platform_aarch64():
     return platform.machine() == 'aarch64'
 
+
 is_platform_aarch64 = _is_platform_aarch64()
 
 
@@ -157,6 +159,7 @@
     s = os.getenv("EXTENDED_TESTS", "n")
     return True if s.lower() in ("y", "yes", "1") else False
 
+
 running_extended_tests = _running_extended_tests()
 
 
@@ -164,6 +167,7 @@
     os_id = os.getenv("OS_ID", "")
     return True if "centos" in os_id.lower() else False
 
+
 running_on_centos = _running_on_centos
 
 
@@ -926,8 +930,8 @@
                 for cf in checksum_fields:
                     if hasattr(layer, cf):
                         if ignore_zero_udp_checksums and \
-                                        0 == getattr(layer, cf) and \
-                                        layer.name in udp_layers:
+                                0 == getattr(layer, cf) and \
+                                layer.name in udp_layers:
                             continue
                         delattr(layer, cf)
                         checksums.append((counter, cf))
@@ -1005,7 +1009,7 @@
             counter_value = self.statistics.get_counter(counter)
         else:
             counters = self.vapi.cli("sh errors").split('\n')
-            counter_value = -1
+            counter_value = 0
             for i in range(1, len(counters) - 1):
                 results = counters[i].split()
                 if results[1] == counter:
@@ -1014,18 +1018,9 @@
         return counter_value
 
     def assert_packet_counter_equal(self, counter, expected_value):
-        if counter.startswith("/"):
-            counter_value = self.statistics.get_counter(counter)
-            self.assert_equal(counter_value, expected_value,
-                              "packet counter `%s'" % counter)
-        else:
-            counters = self.vapi.cli("sh errors").split('\n')
-            counter_value = -1
-            for i in range(1, len(counters) - 1):
-                results = counters[i].split()
-                if results[1] == counter:
-                    counter_value = int(results[0])
-                    break
+        counter_value = self.get_packet_counter(counter)
+        self.assert_equal(counter_value, expected_value,
+                          "packet counter `%s'" % counter)
 
     def assert_error_counter_equal(self, counter, expected_value):
         counter_value = self.statistics.get_err_counter(counter)
@@ -1455,5 +1450,6 @@
         self.logger.info(single_line_delim)
         self.result = self.process.returncode
 
+
 if __name__ == '__main__':
     pass
diff --git a/test/template_ipsec.py b/test/template_ipsec.py
index 84b8784..87565ed 100644
--- a/test/template_ipsec.py
+++ b/test/template_ipsec.py
@@ -527,7 +527,9 @@
 
 class IpsecTun4(object):
     """ verify methods for Tunnel v4 """
-    def verify_counters(self, p, count):
+    def verify_counters4(self, p, count, n_frags=None):
+        if not n_frags:
+            n_frags = count
         if (hasattr(p, "spd_policy_in_any")):
             pkts = p.spd_policy_in_any.get_stats()['packets']
             self.assertEqual(pkts, count,
@@ -544,7 +546,7 @@
                              "incorrect SA out counts: expected %d != %d" %
                              (count, pkts))
 
-        self.assert_packet_counter_equal(self.tun4_encrypt_node_name, count)
+        self.assert_packet_counter_equal(self.tun4_encrypt_node_name, n_frags)
         self.assert_packet_counter_equal(self.tun4_decrypt_node_name, count)
 
     def verify_decrypted(self, p, rxs):
@@ -600,7 +602,7 @@
             self.logger.info(self.vapi.ppcli("show error"))
             self.logger.info(self.vapi.ppcli("show ipsec all"))
 
-        self.verify_counters(p, count)
+        self.verify_counters4(p, count, n_rx)
 
     def verify_tun_64(self, p, count=1):
         self.vapi.cli("clear errors")
@@ -638,7 +640,7 @@
             self.logger.info(self.vapi.ppcli("show error"))
             self.logger.info(self.vapi.ppcli("show ipsec all"))
 
-        self.verify_counters(p, count)
+        self.verify_counters4(p, count)
 
 
 class IpsecTun4Tests(IpsecTun4):
@@ -654,7 +656,7 @@
 
 class IpsecTun6(object):
     """ verify methods for Tunnel v6 """
-    def verify_counters(self, p, count):
+    def verify_counters6(self, p, count):
         if (hasattr(p, "tun_sa_in")):
             pkts = p.tun_sa_in.get_stats()['packets']
             self.assertEqual(pkts, count,
@@ -706,7 +708,7 @@
         finally:
             self.logger.info(self.vapi.ppcli("show error"))
             self.logger.info(self.vapi.ppcli("show ipsec all"))
-        self.verify_counters(p, count)
+        self.verify_counters6(p, count)
 
     def verify_tun_46(self, p, count=1):
         """ ipsec 4o6 tunnel basic test """
@@ -745,7 +747,7 @@
         finally:
             self.logger.info(self.vapi.ppcli("show error"))
             self.logger.info(self.vapi.ppcli("show ipsec all"))
-        self.verify_counters(p, count)
+        self.verify_counters6(p, count)
 
 
 class IpsecTun6Tests(IpsecTun6):
diff --git a/test/test_ipsec_tun_if_esp.py b/test/test_ipsec_tun_if_esp.py
index 8f1bd7c..47b138f 100644
--- a/test/test_ipsec_tun_if_esp.py
+++ b/test/test_ipsec_tun_if_esp.py
@@ -64,19 +64,25 @@
 
 class TestIpsec4TunIfEsp1(TemplateIpsec4TunIfEsp, IpsecTun4Tests):
     """ Ipsec ESP - TUN tests """
-    tun4_encrypt_node_name = "esp4-encrypt"
+    tun4_encrypt_node_name = "esp4-encrypt-tun"
     tun4_decrypt_node_name = "esp4-decrypt"
 
     def test_tun_basic64(self):
         """ ipsec 6o4 tunnel basic test """
+        self.tun4_encrypt_node_name = "esp6-encrypt-tun"
+
         self.verify_tun_64(self.params[socket.AF_INET], count=1)
 
     def test_tun_burst64(self):
         """ ipsec 6o4 tunnel basic test """
+        self.tun4_encrypt_node_name = "esp6-encrypt-tun"
+
         self.verify_tun_64(self.params[socket.AF_INET], count=257)
 
     def test_tun_basic_frag44(self):
         """ ipsec 4o4 tunnel frag basic test """
+        self.tun4_encrypt_node_name = "esp4-encrypt-tun"
+
         p = self.ipv4_params
 
         self.vapi.sw_interface_set_mtu(p.tun_if.sw_if_index,
@@ -130,15 +136,17 @@
 
 class TestIpsec6TunIfEsp1(TemplateIpsec6TunIfEsp, IpsecTun6Tests):
     """ Ipsec ESP - TUN tests """
-    tun6_encrypt_node_name = "esp6-encrypt"
+    tun6_encrypt_node_name = "esp6-encrypt-tun"
     tun6_decrypt_node_name = "esp6-decrypt"
 
     def test_tun_basic46(self):
         """ ipsec 4o6 tunnel basic test """
+        self.tun6_encrypt_node_name = "esp4-encrypt-tun"
         self.verify_tun_46(self.params[socket.AF_INET6], count=1)
 
     def test_tun_burst46(self):
         """ ipsec 4o6 tunnel burst test """
+        self.tun6_encrypt_node_name = "esp4-encrypt-tun"
         self.verify_tun_46(self.params[socket.AF_INET6], count=257)
 
 
@@ -146,7 +154,7 @@
     """ IPsec IPv4 Multi Tunnel interface """
 
     encryption_type = ESP
-    tun4_encrypt_node_name = "esp4-encrypt"
+    tun4_encrypt_node_name = "esp4-encrypt-tun"
     tun4_decrypt_node_name = "esp4-decrypt"
 
     def setUp(self):
@@ -206,7 +214,7 @@
     """ IPsec IPv4 Tunnel interface all Algos """
 
     encryption_type = ESP
-    tun4_encrypt_node_name = "esp4-encrypt"
+    tun4_encrypt_node_name = "esp4-encrypt-tun"
     tun4_decrypt_node_name = "esp4-decrypt"
 
     def config_network(self, p):
@@ -388,7 +396,7 @@
     """ IPsec IPv6 Multi Tunnel interface """
 
     encryption_type = ESP
-    tun6_encrypt_node_name = "esp6-encrypt"
+    tun6_encrypt_node_name = "esp6-encrypt-tun"
     tun6_decrypt_node_name = "esp6-decrypt"
 
     def setUp(self):
