diff options
-rw-r--r-- | test/framework.py | 6 | ||||
-rw-r--r-- | test/test_ip4.py | 6 | ||||
-rw-r--r-- | test/util.py | 2 | ||||
-rw-r--r-- | test/vpp_interface.py | 7 | ||||
-rw-r--r-- | test/vpp_papi_provider.py | 3 |
5 files changed, 12 insertions, 12 deletions
diff --git a/test/framework.py b/test/framework.py index fb1446572ee..c1bfaa7630f 100644 --- a/test/framework.py +++ b/test/framework.py @@ -175,14 +175,16 @@ def pump_output(testclass): if testclass.vpp.stderr.fileno() in readable: read = os.read(testclass.vpp.stderr.fileno(), 102400) if len(read) > 0: - split = read.splitlines(True) + split = read.decode('ascii', + errors='backslashreplace').splitlines(True) if len(stderr_fragment) > 0: split[0] = "%s%s" % (stderr_fragment, split[0]) - if len(split) > 0 and split[-1].endswith(b"\n"): + if len(split) > 0 and split[-1].endswith("\n"): limit = None else: limit = -1 stderr_fragment = split[-1] + testclass.vpp_stderr_deque.extend(split[:limit]) if not testclass.cache_vpp_output: for line in split[:limit]: diff --git a/test/test_ip4.py b/test/test_ip4.py index 60bc023a280..af0c319d4a1 100644 --- a/test/test_ip4.py +++ b/test/test_ip4.py @@ -100,7 +100,7 @@ class TestIPv4(VppTestCase): :param int packet_size: Required packet size. :param Scapy pkt: Packet to be modified. """ - dst_if_idx = packet_size / 10 % 2 + dst_if_idx = int(packet_size / 10 % 2) dst_if = self.flows[src_if][dst_if_idx] info = self.create_packet_info(src_if, dst_if) payload = self.info_to_payload(info) @@ -377,7 +377,7 @@ class TestICMPEcho(VppTestCase): icmp_id = 0xb icmp_seq = 5 - icmp_load = '\x0a' * 18 + icmp_load = b'\x0a' * 18 p_echo_request = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) / @@ -1938,7 +1938,7 @@ class TestIPv4Frag(VppTestCase): packets = self.dst_if.get_capture(3) # Assume VPP sends the fragments in order - payload = '' + payload = b'' for p in packets: payload_offset = p.frag * 8 if payload_offset > 0: diff --git a/test/util.py b/test/util.py index 96d3c6068ef..ed6c40959f1 100644 --- a/test/util.py +++ b/test/util.py @@ -58,7 +58,7 @@ def ip4n_range(ip4n, s, e): # wrapper around scapy library function. def mk_ll_addr(mac): - euid = in6_mactoifaceid(mac) + euid = in6_mactoifaceid(str(mac)) addr = "fe80::" + euid return addr diff --git a/test/vpp_interface.py b/test/vpp_interface.py index 1e047f5f700..431a03a6858 100644 --- a/test/vpp_interface.py +++ b/test/vpp_interface.py @@ -33,7 +33,7 @@ class VppInterface(object): @property def local_mac(self): """MAC-address of the VPP interface.""" - return self._local_mac + return str(self._local_mac) @property def local_addr(self): @@ -260,9 +260,8 @@ class VppInterface(object): r = self.test.vapi.sw_interface_dump(sw_if_index=self.sw_if_index) for intf in r: if intf.sw_if_index == self.sw_if_index: - self._name = intf.interface_name.split(b'\0', - 1)[0].decode('utf8') - self._local_mac = bytes(intf.l2_address) + self._name = intf.interface_name + self._local_mac = intf.l2_address self._dump = intf break else: diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py index d80f2ed4400..297c1592dbf 100644 --- a/test/vpp_papi_provider.py +++ b/test/vpp_papi_provider.py @@ -369,8 +369,7 @@ class VppPapiProvider(object): :param cli: CLI to execute :returns: CLI output """ - return cli + "\n" + self.cli(cli).encode('ascii', - errors='backslashreplace') + return cli + "\n" + self.cli(cli) def want_ip4_arp_events(self, enable_disable=1, ip="0.0.0.0"): return self.api(self.papi.want_ip4_arp_events, |