_______ SocketCANTest.test_build_bcm_header_sizeof_long_8_alignof_long_8 _______
self = <test.test_socketcan.SocketCANTest testMethod=test_build_bcm_header_sizeof_long_8_alignof_long_8>
@unittest.skipIf(
not (
ctypes.sizeof(ctypes.c_long) == 8 and ctypes.alignment(ctypes.c_long) == 8
),
"Should only run on platforms where sizeof(long) == 8 and alignof(long) == 8",
)
def test_build_bcm_header_sizeof_long_8_alignof_long_8(self):
expected_result = (
b"\x02\x00\x00\x00\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00"
b"\x01\x04\x00\x00\x01\x00\x00\x00"
)
> self.assertEqual(
expected_result,
build_bcm_header(
opcode=CAN_BCM_TX_DELETE,
flags=0,
count=0,
ival1_seconds=0,
ival1_usec=0,
ival2_seconds=0,
ival2_usec=0,
can_id=0x401,
nframes=1,
),
)
E AssertionError: b'\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00[176 chars]\x00' != b'\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00[176 chars]\x01'
test_socketcan.py:290: AssertionError
Describe the bug
it seems that
python-canfails the test-suite on big-endian machines.See https://ci.debian.net/data/autopkgtest/testing/s390x/p/python-can/24833388/log.gz (see below for an excerpt)
To Reproduce
run the test-suite on a big-endian architecture.
Expected behavior
big-endian is supported.
Additional context
Traceback and logs