aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-25 08:36:47 -0800
committerOle Trøan <otroan@employees.org>2018-11-27 09:02:02 +0000
commitf1f2aa6bf999b833bce20a54c1759893f92d91da (patch)
tree06f3efde1741746c7992ad30700f6c808bd70225
parent6e4c6ad92e59045f0babf5af5093cb8402ec37fb (diff)
VPP-1508 python3 tests: use six.iteritems
This replaces dictionary.iteritems() on Python 2 and dictionary.items() on Python 3. Change-Id: I58a3ded7d284c59e28d484b0c285aac435bfc229 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--test/remote_test.py2
-rw-r--r--test/test_reassembly.py12
2 files changed, 8 insertions, 6 deletions
diff --git a/test/remote_test.py b/test/remote_test.py
index 40e798444b1..8ebc8a00d1b 100644
--- a/test/remote_test.py
+++ b/test/remote_test.py
@@ -134,7 +134,7 @@ class RemoteClass(Process):
isinstance(val, RemoteClassAttr):
mutable_args[i] = val.get_remote_value()
args = tuple(mutable_args)
- for key, val in kwargs.iteritems():
+ for key, val in six.iteritems(kwargs):
if isinstance(val, RemoteClass) or \
isinstance(val, RemoteClassAttr):
kwargs[key] = val.get_remote_value()
diff --git a/test/test_reassembly.py b/test/test_reassembly.py
index d7cc627a318..95fefdb5aa1 100644
--- a/test/test_reassembly.py
+++ b/test/test_reassembly.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python
+
+import six
import unittest
from random import shuffle
@@ -77,7 +79,7 @@ class TestIPv4Reassembly(VppTestCase):
def create_fragments(cls):
infos = cls._packet_infos
cls.pkt_infos = []
- for index, info in infos.iteritems():
+ for index, info in six.iteritems(infos):
p = info.data
# cls.logger.debug(ppp("Packet:", p.__class__(str(p))))
fragments_400 = fragment_rfc791(p, 400)
@@ -414,7 +416,7 @@ class TestIPv6Reassembly(VppTestCase):
def create_fragments(cls):
infos = cls._packet_infos
cls.pkt_infos = []
- for index, info in infos.iteritems():
+ for index, info in six.iteritems(infos):
p = info.data
# cls.logger.debug(ppp("Packet:", p.__class__(str(p))))
fragments_400 = fragment_rfc8200(p, info.index, 400)
@@ -805,7 +807,7 @@ class TestIPv4ReassemblyLocalNode(VppTestCase):
def create_fragments(cls):
infos = cls._packet_infos
cls.pkt_infos = []
- for index, info in infos.iteritems():
+ for index, info in six.iteritems(infos):
p = info.data
# cls.logger.debug(ppp("Packet:", p.__class__(str(p))))
fragments_300 = fragment_rfc791(p, 300)
@@ -984,7 +986,7 @@ class TestFIFReassembly(VppTestCase):
self.extend_packet(p, size, self.padding)
info.data = p[IP] # use only IP part, without ethernet header
- fragments = [x for _, p in self._packet_infos.iteritems()
+ fragments = [x for _, p in six.iteritems(self._packet_infos)
for x in fragment_rfc791(p.data, 400)]
encapped_fragments = \
@@ -1050,7 +1052,7 @@ class TestFIFReassembly(VppTestCase):
self.extend_packet(p, size, self.padding)
info.data = p[IPv6] # use only IPv6 part, without ethernet header
- fragments = [x for _, i in self._packet_infos.iteritems()
+ fragments = [x for _, i in six.iteritems(self._packet_infos)
for x in fragment_rfc8200(
i.data, i.index, 400)]