[V1,4/5] tests/vf_offload: fix error when no packet captured.

Message ID 20230207032313.404935-5-ke1.xu@intel.com (mailing list archive)
State Superseded
Headers
Series Update vf_offload cases for DPDK-v23.03 validation. |

Commit Message

Ke Xu Feb. 7, 2023, 3:23 a.m. UTC
  Signed-off-by: Ke Xu <ke1.xu@intel.com>
---
 tests/TestSuite_vf_offload.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py
index 93b28afd..e9f70562 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -266,7 +266,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}