diff options
author | IWAMOTO Toshihiro <iwamoto@valinux.co.jp> | 2015-07-03 11:27:17 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-03 11:38:03 +0900 |
commit | c31d6e86690020e3ae23e3897cfb1b55a0daa4f5 (patch) | |
tree | 5b527f320ec4117d4dde0a99ea0aa064a623c20f | |
parent | 675a7dbc377d362ba5fbbe6565aab9f9718c7a65 (diff) |
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>
-rw-r--r-- | ryu/tests/unit/packet/test_packet.py | 2 | ||||
-rw-r--r-- | ryu/tests/unit/packet/test_slow.py | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ryu/tests/unit/packet/test_packet.py b/ryu/tests/unit/packet/test_packet.py index 652d3265..a793a5fa 100644 --- a/ryu/tests/unit/packet/test_packet.py +++ b/ryu/tests/unit/packet/test_packet.py @@ -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' diff --git a/ryu/tests/unit/packet/test_slow.py b/ryu/tests/unit/packet/test_slow.py index 81749339..9e077fd2 100644 --- a/ryu/tests/unit/packet/test_slow.py +++ b/ryu/tests/unit/packet/test_slow.py @@ -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 |