-
Notifications
You must be signed in to change notification settings - Fork 108
Unit tests fail en masse on s390x (and presumably other bigendian archs) #227
Copy link
Copy link
Closed
Description
Since v1.8.0, many unit tests fail due to what appear to be endian decoding issues:
$ go version
go version go1.24.4 linux/s390x
$ go test -skip TestIntegration ./...
--- FAIL: TestMarshalAttributes (0.00s)
--- FAIL: TestMarshalAttributes/one_attribute,_no_data (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x04 0x00 0x01 0x00]
- got: [0x00 0x04 0x00 0x01]
--- FAIL: TestMarshalAttributes/one_attribute,_no_data,_length_calculated (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x04 0x00 0x01 0x00]
- got: [0x00 0x04 0x00 0x01]
--- FAIL: TestMarshalAttributes/one_attribute,_padded (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x05 0x00 0x01 0x00 0xff 0x00 0x00 0x00]
- got: [0x00 0x05 0x00 0x01 0xff 0x00 0x00 0x00]
--- FAIL: TestMarshalAttributes/one_attribute,_padded,_length_calculated (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x05 0x00 0x01 0x00 0xff 0x00 0x00 0x00]
- got: [0x00 0x05 0x00 0x01 0xff 0x00 0x00 0x00]
--- FAIL: TestMarshalAttributes/one_attribute,_aligned (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x08 0x00 0x02 0x00 0xaa 0xbb 0xcc 0xdd]
- got: [0x00 0x08 0x00 0x02 0xaa 0xbb 0xcc 0xdd]
--- FAIL: TestMarshalAttributes/one_attribute,_aligned,_length_calculated (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x08 0x00 0x02 0x00 0xaa 0xbb 0xcc 0xdd]
- got: [0x00 0x08 0x00 0x02 0xaa 0xbb 0xcc 0xdd]
--- FAIL: TestMarshalAttributes/multiple_attributes (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x05 0x00 0x01 0x00 0xff 0x00 0x00 0x00 0x08 0x00 0x02 0x00 0xaa 0xbb 0xcc 0xdd 0x04 0x00 0x03 0x00 0x10 0x00 0x04 0x00 0x11 0x11 0x11 0x11 0x22 0x22 0x22 0x22 0x33 0x33 0x33 0x33]
- got: [0x00 0x05 0x00 0x01 0xff 0x00 0x00 0x00 0x00 0x08 0x00 0x02 0xaa 0xbb 0xcc 0xdd 0x00 0x04 0x00 0x03 0x00 0x10 0x00 0x04 0x11 0x11 0x11 0x11 0x22 0x22 0x22 0x22 0x33 0x33 0x33 0x33]
--- FAIL: TestMarshalAttributes/multiple_attributes,_length_calculated (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x05 0x00 0x01 0x00 0xff 0x00 0x00 0x00 0x08 0x00 0x02 0x00 0xaa 0xbb 0xcc 0xdd 0x04 0x00 0x03 0x00 0x10 0x00 0x04 0x00 0x11 0x11 0x11 0x11 0x22 0x22 0x22 0x22 0x33 0x33 0x33 0x33]
- got: [0x00 0x05 0x00 0x01 0xff 0x00 0x00 0x00 0x00 0x08 0x00 0x02 0xaa 0xbb 0xcc 0xdd 0x00 0x04 0x00 0x03 0x00 0x10 0x00 0x04 0x11 0x11 0x11 0x11 0x22 0x22 0x22 0x22 0x33 0x33 0x33 0x33]
--- FAIL: TestMarshalAttributes/max_type_space,_length_0 (0.00s)
attribute_test.go:227: unexpected bytes:
- want: [0x04 0x00 0xff 0xff]
- got: [0x00 0x04 0xff 0xff]
--- FAIL: TestUnmarshalAttributes (0.00s)
--- FAIL: TestUnmarshalAttributes/one_attribute,_not_aligned (0.00s)
attribute_test.go:399: unexpected error:
- want: <nil>
- got: invalid attribute; length too short or too large
--- FAIL: TestUnmarshalAttributes/one_attribute,_no_data (0.00s)
attribute_test.go:399: unexpected error:
- want: <nil>
- got: invalid attribute; length too short or too large
--- FAIL: TestUnmarshalAttributes/one_attribute,_padded (0.00s)
attribute_test.go:399: unexpected error:
- want: <nil>
- got: invalid attribute; length too short or too large
--- FAIL: TestUnmarshalAttributes/one_attribute,_aligned (0.00s)
attribute_test.go:399: unexpected error:
- want: <nil>
- got: invalid attribute; length too short or too large
--- FAIL: TestUnmarshalAttributes/multiple_attributes (0.00s)
attribute_test.go:399: unexpected error:
- want: <nil>
- got: invalid attribute; length too short or too large
--- FAIL: TestUnmarshalAttributes/max_type_space,_length_0 (0.00s)
attribute_test.go:399: unexpected error:
- want: <nil>
- got: invalid attribute; length too short or too large
--- FAIL: TestAttributeDecoderOK (0.00s)
--- FAIL: TestAttributeDecoderOK/do (0.00s)
panic: unexpected struct (-want +got):
netlink.cstruct{
- A: 44510,
+ A: 57005,
B: 190,
}
[recovered]
panic: unexpected struct (-want +got):
netlink.cstruct{
- A: 44510,
+ A: 57005,
B: 190,
}
goroutine 71 [running]:
testing.tRunner.func1.2({0x2fef60, 0xc0000234a0})
/usr/lib/go-1.24/src/testing/testing.go:1734 +0x2b4
testing.tRunner.func1()
/usr/lib/go-1.24/src/testing/testing.go:1737 +0x3d6
panic({0x2fef60, 0xc0000234a0})
/usr/lib/go-1.24/src/runtime/panic.go:792 +0x11a
github.com/mdlayher/netlink.panicf(...)
/home/dswarbrick/netlink/debug.go:68
github.com/mdlayher/netlink.TestAttributeDecoderOK.func6.1(...)
/home/dswarbrick/netlink/attribute_test.go:700
github.com/mdlayher/netlink.(*AttributeDecoder).Do(...)
/home/dswarbrick/netlink/attribute.go:438
github.com/mdlayher/netlink.TestAttributeDecoderOK.func6(0xc0000ab730)
/home/dswarbrick/netlink/attribute_test.go:691 +0x4d6
github.com/mdlayher/netlink.TestAttributeDecoderOK.func10(0xc000187500)
/home/dswarbrick/netlink/attribute_test.go:841 +0x294
testing.tRunner(0xc000187500, 0xc000013a00)
/usr/lib/go-1.24/src/testing/testing.go:1792 +0x132
created by testing.(*T).Run in goroutine 63
/usr/lib/go-1.24/src/testing/testing.go:1851 +0x4e4
FAIL github.com/mdlayher/netlink 0.005s
--- FAIL: TestUint16 (0.00s)
--- FAIL: TestUint16/0x0001 (0.00s)
int_test.go:244: unexpected bytes:
- want: [0x01 0x00]
- got: [0x00 0x01]
--- FAIL: TestUint16/0x0102 (0.00s)
int_test.go:244: unexpected bytes:
- want: [0x02 0x01]
- got: [0x01 0x02]
--- FAIL: TestUint16/0x1234 (0.00s)
int_test.go:244: unexpected bytes:
- want: [0x34 0x12]
- got: [0x12 0x34]
--- FAIL: TestUint32 (0.00s)
--- FAIL: TestUint32/0x00000001 (0.00s)
int_test.go:303: unexpected bytes:
- want: [0x01 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x01]
--- FAIL: TestUint32/0x00000102 (0.00s)
int_test.go:303: unexpected bytes:
- want: [0x02 0x01 0x00 0x00]
- got: [0x00 0x00 0x01 0x02]
--- FAIL: TestUint32/0x00001234 (0.00s)
int_test.go:303: unexpected bytes:
- want: [0x34 0x12 0x00 0x00]
- got: [0x00 0x00 0x12 0x34]
--- FAIL: TestUint32/0x0000ffff (0.00s)
int_test.go:303: unexpected bytes:
- want: [0xff 0xff 0x00 0x00]
- got: [0x00 0x00 0xff 0xff]
--- FAIL: TestUint32/0x01020304 (0.00s)
int_test.go:303: unexpected bytes:
- want: [0x04 0x03 0x02 0x01]
- got: [0x01 0x02 0x03 0x04]
--- FAIL: TestUint32/0x1a2a3a4a (0.00s)
int_test.go:303: unexpected bytes:
- want: [0x4a 0x3a 0x2a 0x1a]
- got: [0x1a 0x2a 0x3a 0x4a]
--- FAIL: TestUint64 (0.00s)
--- FAIL: TestUint64/0x0000000000000001 (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01]
--- FAIL: TestUint64/0x0000000000000102 (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x02 0x01 0x00 0x00 0x00 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x02]
--- FAIL: TestUint64/0x0000000000001234 (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x34 0x12 0x00 0x00 0x00 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x00 0x00 0x00 0x12 0x34]
--- FAIL: TestUint64/0x000000000000ffff (0.00s)
int_test.go:370: unexpected bytes:
- want: [0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff]
--- FAIL: TestUint64/0x0000000001020304 (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x04 0x03 0x02 0x01 0x00 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x00 0x01 0x02 0x03 0x04]
--- FAIL: TestUint64/0x000000001a2a3a4a (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x4a 0x3a 0x2a 0x1a 0x00 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x00 0x1a 0x2a 0x3a 0x4a]
--- FAIL: TestUint64/0x0102030405060708 (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x08 0x07 0x06 0x05 0x04 0x03 0x02 0x01]
- got: [0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08]
--- FAIL: TestUint64/0x1a2a3a4a5a6a7a8a (0.00s)
int_test.go:370: unexpected bytes:
- want: [0x8a 0x7a 0x6a 0x5a 0x4a 0x3a 0x2a 0x1a]
- got: [0x1a 0x2a 0x3a 0x4a 0x5a 0x6a 0x7a 0x8a]
--- FAIL: TestInt32 (0.00s)
--- FAIL: TestInt32/0x00000001 (0.00s)
int_test.go:437: unexpected bytes:
- want: [0x01 0x00 0x00 0x00]
- got: [0x00 0x00 0x00 0x01]
--- FAIL: TestInt32/0x00000102 (0.00s)
int_test.go:437: unexpected bytes:
- want: [0x02 0x01 0x00 0x00]
- got: [0x00 0x00 0x01 0x02]
--- FAIL: TestInt32/0x00001234 (0.00s)
int_test.go:437: unexpected bytes:
- want: [0x34 0x12 0x00 0x00]
- got: [0x00 0x00 0x12 0x34]
--- FAIL: TestInt32/0x0000ffff (0.00s)
int_test.go:437: unexpected bytes:
- want: [0xff 0xff 0x00 0x00]
- got: [0x00 0x00 0xff 0xff]
--- FAIL: TestInt32/0x01020304 (0.00s)
int_test.go:437: unexpected bytes:
- want: [0x04 0x03 0x02 0x01]
- got: [0x01 0x02 0x03 0x04]
--- FAIL: TestInt32/0x1a2a3a4a (0.00s)
int_test.go:437: unexpected bytes:
- want: [0x4a 0x3a 0x2a 0x1a]
- got: [0x1a 0x2a 0x3a 0x4a]
--- FAIL: TestInt32/0x-0000002 (0.00s)
int_test.go:437: unexpected bytes:
- want: [0xfe 0xff 0xff 0xff]
- got: [0xff 0xff 0xff 0xfe]
FAIL
FAIL github.com/mdlayher/netlink/nlenc 0.002s
--- FAIL: TestError (0.00s)
--- FAIL: TestError/ENOENT (0.00s)
nltest_test.go:279: unexpected output messages:
- want: [{{24 error request 1 100} [254 255 255 255 17 34 51 68]}]
- got: [{{24 error request 1 100} [255 255 255 254 17 34 51 68]}]
FAIL
FAIL github.com/mdlayher/netlink/nltest 0.003s
FAIL
A git bisect reveals the culprit to be #220.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels