diff --git a/test/framework.py b/test/framework.py
index 572207d..7d03eeb 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -1275,6 +1275,18 @@
             self.logger.debug(self.vapi.cli("show trace"))
         return rx
 
+    def send_and_expect_load_balancing(self, input, pkts, outputs,
+                                       worker=None, trace=True):
+        self.pg_send(input, pkts, worker=worker, trace=trace)
+        rxs = []
+        for oo in outputs:
+            rx = oo._get_capture(1)
+            self.assertNotEqual(0, len(rx))
+            rxs.append(rx)
+        if trace:
+            self.logger.debug(self.vapi.cli("show trace"))
+        return rxs
+
     def send_and_expect_only(self, intf, pkts, output, timeout=None):
         self.pg_send(intf, pkts)
         rx = output.get_capture(len(pkts))
diff --git a/test/test_ip4.py b/test/test_ip4.py
index 3735052..de2cac0 100644
--- a/test/test_ip4.py
+++ b/test/test_ip4.py
@@ -1118,24 +1118,6 @@
             i.admin_down()
         super(TestIPLoadBalance, self).tearDown()
 
-    def send_and_expect_load_balancing(self, input, pkts, outputs):
-        self.vapi.cli("clear trace")
-        input.add_stream(pkts)
-        self.pg_enable_capture(self.pg_interfaces)
-        self.pg_start()
-        rxs = []
-        for oo in outputs:
-            rx = oo._get_capture(1)
-            self.assertNotEqual(0, len(rx))
-            rxs.append(rx)
-        return rxs
-
-    def send_and_expect_one_itf(self, input, pkts, itf):
-        input.add_stream(pkts)
-        self.pg_enable_capture(self.pg_interfaces)
-        self.pg_start()
-        rx = itf.get_capture(len(pkts))
-
     def total_len(self, rxs):
         n = 0
         for rx in rxs:
@@ -1243,7 +1225,7 @@
         self.send_and_expect_load_balancing(self.pg0, src_mpls_pkts,
                                             [self.pg1, self.pg2])
 
-        self.send_and_expect_one_itf(self.pg0, port_ip_pkts, self.pg2)
+        self.send_and_expect_only(self.pg0, port_ip_pkts, self.pg2)
 
         #
         # change the flow hash config back to defaults
@@ -1367,7 +1349,7 @@
         # inject the packet on pg0 - rx only on via routes output interface
         #
         self.vapi.cli("clear trace")
-        self.send_and_expect_one_itf(self.pg0, port_pkts, self.pg3)
+        self.send_and_expect_only(self.pg0, port_pkts, self.pg3)
 
         #
         # Add a LB route in the presence of a down link - expect no
@@ -1390,7 +1372,7 @@
                              UDP(sport=1234, dport=1234 + ii) /
                              Raw(b'\xa5' * 100))
 
-        self.send_and_expect_one_itf(self.pg0, port_pkts, self.pg4)
+        self.send_and_expect_only(self.pg0, port_pkts, self.pg4)
 
         # bring the link back up
         self.pg3.link_up()
diff --git a/test/test_ip6.py b/test/test_ip6.py
index d1fb86d..2c318cd 100644
--- a/test/test_ip6.py
+++ b/test/test_ip6.py
@@ -1965,25 +1965,6 @@
             i.disable_mpls()
         super(TestIP6LoadBalance, self).tearDown()
 
-    def pg_send(self, input, pkts):
-        self.vapi.cli("clear trace")
-        input.add_stream(pkts)
-        self.pg_enable_capture(self.pg_interfaces)
-        self.pg_start()
-
-    def send_and_expect_load_balancing(self, input, pkts, outputs):
-        self.pg_send(input, pkts)
-        rxs = []
-        for oo in outputs:
-            rx = oo._get_capture(1)
-            self.assertNotEqual(0, len(rx))
-            rxs.append(rx)
-        return rxs
-
-    def send_and_expect_one_itf(self, input, pkts, itf):
-        self.pg_send(input, pkts)
-        rx = itf.get_capture(len(pkts))
-
     def test_ip6_load_balance(self):
         """ IPv6 Load-Balancing """
 
@@ -2107,7 +2088,7 @@
         # The packets with Entropy label in should not load-balance,
         # since the Entropy value is fixed.
         #
-        self.send_and_expect_one_itf(self.pg0, port_ent_pkts, self.pg1)
+        self.send_and_expect_only(self.pg0, port_ent_pkts, self.pg1)
 
         #
         # change the flow hash config so it's only IP src,dst
@@ -2121,7 +2102,7 @@
                                             [self.pg1, self.pg2])
         self.send_and_expect_load_balancing(self.pg0, src_mpls_pkts,
                                             [self.pg1, self.pg2])
-        self.send_and_expect_one_itf(self.pg0, port_ip_pkts, self.pg2)
+        self.send_and_expect_only(self.pg0, port_ip_pkts, self.pg2)
 
         #
         # change the flow hash config back to defaults
@@ -2206,7 +2187,7 @@
         # inject the packet on pg0 - expect load-balancing across all 4 paths
         #
         self.vapi.cli("clear trace")
-        self.send_and_expect_one_itf(self.pg0, port_pkts, self.pg3)
+        self.send_and_expect_only(self.pg0, port_pkts, self.pg3)
 
 
 class IP6PuntSetup(object):
diff --git a/test/test_l3xc.py b/test/test_l3xc.py
index d7a8297..2bcb6d5 100644
--- a/test/test_l3xc.py
+++ b/test/test_l3xc.py
@@ -90,16 +90,6 @@
             i.admin_down()
         super(TestL3xc, self).tearDown()
 
-    def send_and_expect_load_balancing(self, input, pkts, outputs):
-        self.pg_send(input, pkts)
-        rxs = []
-        for oo in outputs:
-            rx = oo._get_capture(1)
-            self.assertNotEqual(0, len(rx))
-            for r in rx:
-                rxs.append(r)
-        return rxs
-
     def test_l3xc4(self):
         """ IPv4 X-Connect """
 
