Hi,
I got the same error on the 32bit machine.
Env: 32bit machine
type(ip_addrress) is long type.
Env: 64 bit machine
type(ip_address) is int type.
I passed the tests with following workaround patch:
--
diff --git a/ryu/lib/packet/vrrp.py b/ryu/lib/packet/vrrp.py
index 8b6140a..e67c8ac 100644
--- a/ryu/lib/packet/vrrp.py
+++ b/ryu/lib/packet/vrrp.py
@@ -166,7 +166,7 @@ VRRP_V2_MAX_ADVER_INT_MAX = 0xff
def is_ipv6(ip_address):
- if type(ip_address) == int:
+ if type(ip_address) == int or type(ip_address) == long:
return False
assert type(ip_address) == str
@@ -579,7 +579,8 @@ class vrrpv3(vrrp):
@staticmethod
def serialize_static(vrrp_, prev):
if isinstance(prev, ipv4.ipv4):
- assert type(vrrp_.ip_addresses[0]) == int
+ assert (type(vrrp_.ip_addresses[0]) == int or
+ type(vrrp_.ip_addresses[0]) == long)
ip_address_pack_raw = vrrpv3._IPV4_ADDRESS_PACK_STR_RAW
elif isinstance(prev, ipv6.ipv6):
assert type(vrrp_.ip_addresses[0]) == str
diff --git a/ryu/tests/unit/packet/test_vrrp.py
b/ryu/tests/unit/packet/test_vrrp.py
index 282c9fa..10d2c01 100644
--- a/ryu/tests/unit/packet/test_vrrp.py
+++ b/ryu/tests/unit/packet/test_vrrp.py
@@ -84,7 +84,7 @@ class Test_vrrpv2(unittest.TestCase):
eq_(self.max_adver_int, vrrpv2.max_adver_int)
eq_(self.checksum, vrrpv2.checksum)
eq_(1, len(vrrpv2.ip_addresses))
- eq_(int, type(vrrpv2.ip_addresses[0]))
+ #eq_(int, type(vrrpv2.ip_addresses[0]))
eq_(self.ip_address, vrrpv2.ip_addresses[0])
eq_(self.auth_data, vrrpv2.auth_data)
@@ -226,7 +226,7 @@ class Test_vrrpv3_ipv4(unittest.TestCase):
eq_(self.max_adver_int, vrrpv3.max_adver_int)
eq_(self.checksum, vrrpv3.checksum)
eq_(1, len(vrrpv3.ip_addresses))
- eq_(int, type(vrrpv3.ip_addresses[0]))
+ #eq_(int, type(vrrpv3.ip_addresses[0]))
eq_(self.ip_address, vrrpv3.ip_addresses[0])
def test_serialize(self):
2013/6/11 Oren Spector <[email protected]>:
> I tested both in the distro environment and with the virtual environment. In
> both cases the AssertionError test failed. I also asked one of my colleagues
> to try it on his Ubuntu VM and he got the same error.
>
> My network uses subnet 192.168.1.X. I changed 192.168.0.1 to 192.168.1.1 and
> 192.168.0.2 to 192.168.1.3 in test_vrrp.py in case the test pings these
> addresses, but still the test fails exactly as before.
>
> -----Original Message-----
> From: Isaku Yamahata [mailto:[email protected]]
> Sent: Tuesday, June 11, 2013 11:52 AM
> To: Oren Spector
> Cc: [email protected]
> Subject: Re: [Ryu-devel] AssertionError test failed
>
> Did you test with your distro environment?
> In order to check if the environment causes or not, Can you please test with
> virtual environment?
>
> i.e.
> Does the test result differ with or without virtualenv?
>
> run_test.sh -V
> and
> run_test.sh -N
>
> According to the stacktrace, it seems that
> "type(netaddr.IPAddress('192.168.0.1').value) == int" returned false in your
> testing environment.
>
> thanks,
>
> On Tue, Jun 11, 2013 at 08:14:19AM +0300, Oren Spector wrote:
>> I found that Ubuntu python-netaddr was not installed on my machine.
>> After installing it (version 0.7.5) the test still failed. I then
>> upgraded it using pip to version 0.7.10, but still the test fails.
>>
>> -----Original Message-----
>> From: Isaku Yamahata [mailto:[email protected]]
>> Sent: Tuesday, June 11, 2013 12:52 AM
>> To: Oren Spector
>> Cc: [email protected]
>> Subject: Re: [Ryu-devel] AssertionError test failed
>>
>> Which version of netaddr are you using?
>>
>>
>> On Mon, Jun 10, 2013 at 03:59:44PM +0300, Oren Spector wrote:
>> > Hi,
>> >
>> >
>> >
>> > I cloned a fresh copy of Ryu from github and when I ran the
>> > run_tests.sh script the AssertionError test failed. I remember that
>> > last week all the tests passed OK, so some recent change in the
>> > repository
>> probably caused the issue.
>> >
>> >
>> >
>> > Oren
>> >
>> >
>> >
>> > ====================================================================
>> > ==
>> >
>> > FAIL: Failure: AssertionError ()
>> >
>> > --------------------------------------------------------------------
>> > --
>> >
>> > Traceback (most recent call last):
>> >
>> > File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line
>> > 413, in loadTestsFromName
>> >
>> > addr.filename, addr.module)
>> >
>> > File "/usr/local/lib/python2.7/dist-packages/nose/importer.py",
>> > line 47, in importFromPath
>> >
>> > return self.importFromDir(dir_path, fqname)
>> >
>> > File "/usr/local/lib/python2.7/dist-packages/nose/importer.py",
>> > line 94, in importFromDir
>> >
>> > mod = load_module(part_fqname, fh, filename, desc)
>> >
>> > File "/home/oliver/tmp/ryu/ryu/tests/unit/packet/test_vrrp.py",
>> > line 38, in <module>
>> >
>> > class Test_vrrpv2(unittest.TestCase):
>> >
>> > File "/home/oliver/tmp/ryu/ryu/tests/unit/packet/test_vrrp.py",
>> > line 52, in
>> > Test_vrrpv2
>> >
>> > [ip_address])
>> >
>> > File "/home/oliver/tmp/ryu/ryu/lib/packet/vrrp.py", line 440, in
>> > create
>> >
>> > auth_data=VRRP_AUTH_DATA)
>> >
>> > File "/home/oliver/tmp/ryu/ryu/lib/packet/vrrp.py", line 308, in
>> > create_version
>> >
>> > auth_type=auth_type, auth_data=auth_data)
>> >
>> > File "/home/oliver/tmp/ryu/ryu/lib/packet/vrrp.py", line 272, in
>> > __init__
>> >
>> > self._is_ipv6 = is_ipv6(self.ip_addresses[0])
>> >
>> > File "/home/oliver/tmp/ryu/ryu/lib/packet/vrrp.py", line 172, in
>> > is_ipv6
>> >
>> > assert type(ip_address) == str
>> >
>> > AssertionError
>> >
>> >
>> >
>> > --------------------------------------------------------------------
>> > --
>> >
>> > Ran 1272 tests in 11.588s
>> >
>> >
>> >
>> > FAILED (failures=1)
>> >
>>
>> > --------------------------------------------------------------------
>> > --
>> > -------- How ServiceNow helps IT people transform IT departments:
>> > 1. A cloud service to automate IT design, transition and operations 2.
>> > Dashboards that offer high-level views of enterprise services 3. A
>> > single system of record for all IT processes
>> > http://p.sf.net/sfu/servicenow-d2d-j
>> > _______________________________________________
>> > Ryu-devel mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
>> --
>> yamahata
>>
>> ----------------------------------------------------------------------
>> ------
>> --
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Ryu-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
>> ----------------------------------------------------------------------
>> -------- This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Ryu-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>
> --
> yamahata
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
--
OHMURA Kei <[email protected]>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel