Closed tonyo closed 9 years ago
HopOpaqueField.mac
was changed from int to bytes. The tests do not reflect that, @mskd96 is fixing it.
Some files have been modified after the unittests were written.
On Tue, Jun 9, 2015 at 12:41 PM, Anton Ovchinnikov <notifications@github.com
wrote:
Currently, some tests from opaque_field_test.py and lib_packet_base_test.py fail. @prateshg https://github.com/prateshg @pratyakshs https://github.com/pratyakshs
....................................................................E....................................................................................FF.EFF......................................................
ERROR: test.lib_packet_base_test.TestPacketBaseLen.test_basic
Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/tonyo/scion_ethz/scion/test/lib_packet_base_test.py", line 159, in test_basic header = ExtensionHeader(b'data') File "/home/tonyo/scion_ethz/scion/lib/packet/ext_hdr.py", line 41, in init self.parse(raw) File "/home/tonyo/scion_ethz/scion/lib/packet/ext_hdr.py", line 50, in parse self.next_ext, self.hdr_len = struct.unpack("!BB", raw) struct.error: unpack requires a bytes object of length 2
ERROR: test.opaque_field_test.TestHopOpaqueFieldPack.test_basic
Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/tonyo/scion_ethz/scion/test/opaque_field_test.py", line 169, in testbasic ntools.eq(hop_op_fld.pack(),bytes.fromhex('0e 2a 0a 0b 0c 0d 0e 0f')) File "/home/tonyo/scion_ethz/scion/lib/packet/opaque_field.py", line 162, in pack data += self.mac TypeError: can't concat bytes to int
FAIL: test.opaque_field_test.TestHopOpaqueFieldFromValues.test_less_arg
Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/tonyo/scion_ethz/scion/test/opaque_field_test.py", line 155, in test_lessarg ntools.eq(hop_op_fld.mac, 0) AssertionError: b'\x00\x00\x00' != 0
FAIL: test.opaque_field_test.TestHopOpaqueFieldInit.test_basic
Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/tonyo/scion_ethz/scion/test/opaque_field_test.py", line 105, in testbasic ntools.eq(hop_op_fld.mac, 0) AssertionError: b'\x00\x00\x00' != 0
FAIL: test.opaque_field_test.TestHopOpaqueFieldParse.test_basic
Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/tonyo/scion_ethz/scion/test/opaque_field_test.py", line 125, in testbasic ntools.eq(hop_op_fld.mac, 0x0d0e0f) AssertionError: b'\r\x0e\x0f' != 855567
FAIL: test.opaque_field_test.TestHopOpaqueFieldParse.test_len
Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/tonyo/scion_ethz/scion/test/opaque_field_test.py", line 136, in testlen ntools.eq(hop_op_fld.mac, 0) nose.proxy.AssertionError: b'\x00\x00\x00' != 0 -------------------- >> begin captured logging << -------------------- root: WARNING: HOF: Data too short for parsing, len: 7 --------------------- >> end captured logging << ---------------------
Ran 213 tests in 54.900s
FAILED (errors=2, failures=4)
— Reply to this email directly or view it on GitHub https://github.com/netsec-ethz/scion/issues/147.
opaque_field_test.py
updated
Sorry guys, it's my fault as I merged #128 with neither notifying you nor correcting the tests.
As a general comment, has anyone thought of setting up some Continuous Integration platform/service (Travis, Jenkins)? Using one of those would help to catch test failures after each commit/PR.
Yes, @kormat thought about that, and AFAIK he started to looking at Travis.
Also setting up Landscape.io (checks code quality) and Coveralls (checks coverage of tests) would be useful. Thoughts?
Well, too many services might be not the best idea either: people usually start to rely on them too much, and become too lazy to do code-reviews ;) I would suggest starting from one (automated testing/builds sounds like the most reasonable option) and see how it goes.
Looks like everything is ok now, closing.
Currently, some tests from
opaque_field_test.py
andlib_packet_base_test.py
fail. @prateshg @pratyakshs