Fix test packet data generation
They are bugs found during python3 compatibility work. Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
675a7dbc37
commit
c31d6e8669
@ -1395,7 +1395,7 @@ class TestPacket(unittest.TestCase):
|
||||
p.serialize()
|
||||
|
||||
# ethernet !6s6sH
|
||||
e_buf = self.dst_mac + self.src_mac + b'\x05\xdc'
|
||||
e_buf = self.dst_mac_bin + self.src_mac_bin + b'\x05\xdc'
|
||||
|
||||
# llc !BBB
|
||||
l_buf = (b'\x42'
|
||||
|
@ -15,10 +15,11 @@
|
||||
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
import unittest
|
||||
import logging
|
||||
import copy
|
||||
import logging
|
||||
from struct import pack, unpack_from
|
||||
import unittest
|
||||
|
||||
from nose.tools import ok_, eq_, raises
|
||||
from ryu.ofproto import ether
|
||||
from ryu.lib.packet.ethernet import ethernet
|
||||
@ -143,7 +144,8 @@ class Test_slow(unittest.TestCase):
|
||||
slow.parser(self.buf)
|
||||
|
||||
def test_not_implemented_subtype(self):
|
||||
not_implemented_buf = str(SLOW_SUBTYPE_MARKER) + self.buf[1:]
|
||||
not_implemented_buf = pack(
|
||||
slow._PACK_STR, SLOW_SUBTYPE_MARKER) + self.buf[1:]
|
||||
(instance, nexttype, last) = slow.parser(not_implemented_buf)
|
||||
assert None == instance
|
||||
assert None == nexttype
|
||||
|
Loading…
Reference in New Issue
Block a user