From f0be3d31cd8428c50e2e8eebcb34c5d9cb3c49f3 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sun, 5 Oct 2025 19:41:32 +0100 Subject: [PATCH] test: do not fail if order of items changes Compiling notes.c with -O0: Displaying notes found in: .note.dlopen Owner Data size Description FDO 0x00000088 FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"fido2","description":"Support fido2 for encryption and authentication.","priority":"required","soname":["libfido2.so.1"]}] FDO 0x00000084 FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"pcre2","description":"Support pcre2 for regex","priority":"suggested","soname":["libpcre2-8.so.0","libpcre2-8.so.1"]}] FDO 0x0000008e FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"lz4","description":"Support lz4 decompression in journal and coredump files","priority":"recommended","soname":["liblz4.so.1"]}] FDO 0x00000095 FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"tpm","priority":"recommended","soname":["libtss2-mu.so.0"]}, {"feature":"tpm","priority":"recommended","soname":["libtss2-esys.so.0"]}] With -O2: Displaying notes found in: .note.dlopen Owner Data size Description FDO 0x00000095 FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"tpm","priority":"recommended","soname":["libtss2-mu.so.0"]}, {"feature":"tpm","priority":"recommended","soname":["libtss2-esys.so.0"]}] FDO 0x0000008e FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"lz4","description":"Support lz4 decompression in journal and coredump files","priority":"recommended","soname":["liblz4.so.1"]}] FDO 0x00000084 FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"pcre2","description":"Support pcre2 for regex","priority":"suggested","soname":["libpcre2-8.so.0","libpcre2-8.so.1"]}] FDO 0x00000088 FDO_DLOPEN_METADATA Dlopen Metadata: [{"feature":"fido2","description":"Support fido2 for encryption and authentication.","priority":"required","soname":["libfido2.so.1"]}] So the test fails if -O2 is the default as the order is different Follow-up for c2d3548b7edd863250027fd95e7c909fdd5d8ac4 --- test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.py b/test/test.py index 20b49e0..7da5fa5 100644 --- a/test/test.py +++ b/test/test.py @@ -32,4 +32,4 @@ def test_requires(): lines = generate_rpm([notes], 'Suggests', ('pcre2', 'tpm')) expect = expected[notes.elffile.elfclass] - assert lines == expect + assert sorted(lines) == sorted(expect)