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

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

Commit Message

Ke Xu Feb. 14, 2023, 6:28 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 f3af2379..9475ef22 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}