[DTS][PATCH V2 4/5] tests/vf_offload: fix error when no packet captured.

Ke Xu ke1.xu at intel.com
Mon Feb 13 08:58:11 CET 2023


Signed-off-by: Ke Xu <ke1.xu at intel.com>
---
 tests/TestSuite_vf_offload.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py
index 7522ade6..8801401c 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -262,7 +262,7 @@ class TestVfOffload(TestCase):
     def filter_packets(self, packets):
         return [
             p
-            for p in packets
+            for p in (packets if packets else [])
             if len(p.layers()) >= 3
             and p.layers()[1] in {IP, IPv6, Dot1Q}
             and p.layers()[2] in {IP, IPv6, Dot1Q, UDP, TCP, SCTP, GRE, MPLS}
-- 
2.25.1



More information about the dts mailing list