diff --git a/ryu/tests/unit/packet/test_arp.py b/ryu/tests/unit/packet/test_arp.py index 5f12ae36..c9bf6e24 100644 --- a/ryu/tests/unit/packet/test_arp.py +++ b/ryu/tests/unit/packet/test_arp.py @@ -108,10 +108,10 @@ class Test_arp(unittest.TestCase): eq_(res[2], self.hlen) eq_(res[3], self.plen) eq_(res[4], self.opcode) - eq_(addrconv.mac.bin_to_text(res[5]), self.src_mac) - eq_(addrconv.ipv4.bin_to_text(res[6]), self.src_ip) - eq_(addrconv.mac.bin_to_text(res[7]), self.dst_mac) - eq_(addrconv.ipv4.bin_to_text(res[8]), self.dst_ip) + eq_(res[5], addrconv.mac.text_to_bin(self.src_mac)) + eq_(res[6], addrconv.ipv4.text_to_bin(self.src_ip)) + eq_(res[7], addrconv.mac.text_to_bin(self.dst_mac)) + eq_(res[8], addrconv.ipv4.text_to_bin(self.dst_ip)) def _build_arp(self, vlan_enabled): if vlan_enabled is True: diff --git a/ryu/tests/unit/packet/test_ethernet.py b/ryu/tests/unit/packet/test_ethernet.py index 504a560f..151e5c67 100644 --- a/ryu/tests/unit/packet/test_ethernet.py +++ b/ryu/tests/unit/packet/test_ethernet.py @@ -79,8 +79,8 @@ class Test_ethernet(unittest.TestCase): fmt = ethernet._PACK_STR res = struct.unpack(fmt, buf) - eq_(addrconv.mac.bin_to_text(res[0]), self.dst) - eq_(addrconv.mac.bin_to_text(res[1]), self.src) + eq_(res[0], addrconv.mac.text_to_bin(self.dst)) + eq_(res[1], addrconv.mac.text_to_bin(self.src)) eq_(res[2], self.ethertype) @raises(Exception) diff --git a/ryu/tests/unit/packet/test_icmpv6.py b/ryu/tests/unit/packet/test_icmpv6.py index 26b8c898..87e16960 100644 --- a/ryu/tests/unit/packet/test_icmpv6.py +++ b/ryu/tests/unit/packet/test_icmpv6.py @@ -203,7 +203,8 @@ class Test_icmpv6_neighbor_solict(unittest.TestCase): eq_(msg.code, self.code) eq_(msg.csum, self.csum) eq_(msg.data.res >> 29, self.res) - eq_(msg.data.dst, self.dst) + eq_(addrconv.ipv6.text_to_bin(msg.data.dst), + addrconv.ipv6.text_to_bin(self.dst)) eq_(n, None) if data: nd = msg.data @@ -234,7 +235,7 @@ class Test_icmpv6_neighbor_solict(unittest.TestCase): eq_(code, self.code) eq_(csum, nd_csum) eq_(res >> 29, self.res) - eq_(addrconv.ipv6.bin_to_text(dst), self.dst) + eq_(dst, addrconv.ipv6.text_to_bin(self.dst)) eq_(data, '') def test_serialize_with_data(self): @@ -257,10 +258,10 @@ class Test_icmpv6_neighbor_solict(unittest.TestCase): eq_(code, self.code) eq_(csum, nd_csum) eq_(res >> 29, self.res) - eq_(addrconv.ipv6.bin_to_text(dst), self.dst) + eq_(dst, addrconv.ipv6.text_to_bin(self.dst)) eq_(nd_type, self.nd_type) eq_(nd_length, self.nd_length) - eq_(addrconv.mac.bin_to_text(nd_hw_src), self.nd_hw_src) + eq_(nd_hw_src, addrconv.mac.text_to_bin(self.nd_hw_src)) class Test_icmpv6_neighbor_advert(Test_icmpv6_neighbor_solict): diff --git a/ryu/tests/unit/packet/test_ipv4.py b/ryu/tests/unit/packet/test_ipv4.py index 4dbc4f2b..d04c4262 100644 --- a/ryu/tests/unit/packet/test_ipv4.py +++ b/ryu/tests/unit/packet/test_ipv4.py @@ -118,8 +118,8 @@ class Test_ipv4(unittest.TestCase): eq_(res[4], self.flg_off) eq_(res[5], self.ttl) eq_(res[6], self.proto) - eq_(addrconv.ipv4.bin_to_text(res[8]), self.src) - eq_(addrconv.ipv4.bin_to_text(res[9]), self.dst) + eq_(res[8], addrconv.ipv4.text_to_bin(self.src)) + eq_(res[9], addrconv.ipv4.text_to_bin(self.dst)) eq_(option, self.option) # checksum diff --git a/ryu/tests/unit/packet/test_slow.py b/ryu/tests/unit/packet/test_slow.py index a66e6630..c7cd3bd5 100644 --- a/ryu/tests/unit/packet/test_slow.py +++ b/ryu/tests/unit/packet/test_slow.py @@ -423,7 +423,7 @@ class Test_lacp(unittest.TestCase): eq_(act_res[0], self.actor_tag) eq_(act_res[1], self.actor_length) eq_(act_res[2], self.actor_system_priority) - eq_(addrconv.mac.bin_to_text(act_res[3]), self.actor_system) + eq_(act_res[3], addrconv.mac.text_to_bin(self.actor_system)) eq_(act_res[4], self.actor_key) eq_(act_res[5], self.actor_port_priority) eq_(act_res[6], self.actor_port) @@ -432,7 +432,7 @@ class Test_lacp(unittest.TestCase): eq_(prt_res[0], self.partner_tag) eq_(prt_res[1], self.partner_length) eq_(prt_res[2], self.partner_system_priority) - eq_(addrconv.mac.bin_to_text(prt_res[3]), self.partner_system) + eq_(prt_res[3], addrconv.mac.text_to_bin(self.partner_system)) eq_(prt_res[4], self.partner_key) eq_(prt_res[5], self.partner_port_priority) eq_(prt_res[6], self.partner_port) diff --git a/ryu/tests/unit/packet/test_vrrp.py b/ryu/tests/unit/packet/test_vrrp.py index 962d56af..13b19ca1 100644 --- a/ryu/tests/unit/packet/test_vrrp.py +++ b/ryu/tests/unit/packet/test_vrrp.py @@ -116,7 +116,7 @@ class Test_vrrpv2(unittest.TestCase): eq_(res[4], vrrp.VRRP_AUTH_NO_AUTH) eq_(res[5], max_adver_int) # res[6] is checksum - eq_(addrconv.ipv4.bin_to_text(res[7]), ip_address) + eq_(res[7], addrconv.ipv4.text_to_bin(ip_address)) eq_(res[8], 0) eq_(res[9], 0) eq_(len(buf), pack_len) @@ -258,7 +258,7 @@ class Test_vrrpv3_ipv4(unittest.TestCase): eq_(res[3], len(ip_addresses)) eq_(res[4], max_adver_int) # res[5] is checksum - eq_(addrconv.ipv4.bin_to_text(res[6]), ip_address) + eq_(res[6], addrconv.ipv4.text_to_bin(ip_address)) eq_(len(buf), pack_len) print(res) @@ -403,7 +403,7 @@ class Test_vrrpv3_ipv6(unittest.TestCase): eq_(res[3], len(ip_addresses)) eq_(res[4], max_adver_int) # res[5] is checksum - eq_(addrconv.ipv6.bin_to_text(res[6]), ip_address) + eq_(res[6], addrconv.ipv6.text_to_bin(ip_address)) eq_(len(buf), pack_len) print(res)