From 2bd2a2c9d9169f68057d297964e05f9d628ad096 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 2 Jun 2021 13:09:47 +0100 Subject: [PATCH] Skip tests/test-memory-allocator-malloc-mlock.sh on RHEL 9 / aarch64 related: rhbz#1950632 Test failure: FAIL: test-memory-allocator-malloc-mlock.sh =========================================== /builddir/build/BUILD/nbdkit-1.25.8/server/nbdkit -v -P memory-allocator-malloc-mlock.pid -U /tmp/nbdkit-test-sock.QSUxq3 -- /builddir/build/BUILD/nbdkit-1.25.8/plugins/memory/.libs/nbdkit-memory-plugin.so 2048 allocator=malloc,mlock=true nbdkit: debug: nbdkit 1.25.8 (nbdkit-1.25.8-2.el9) nbdkit: debug: TLS disabled: could not load TLS certificates nbdkit: debug: registering plugin /builddir/build/BUILD/nbdkit-1.25.8/plugins/memory/.libs/nbdkit-memory-plugin.so nbdkit: debug: registered plugin /builddir/build/BUILD/nbdkit-1.25.8/plugins/memory/.libs/nbdkit-memory-plugin.so (name memory) nbdkit: debug: memory: load nbdkit: debug: memory: config key=size, value=2048 nbdkit: debug: memory: config key=allocator, value=malloc,mlock=true nbdkit: debug: memory: config_complete nbdkit: debug: using thread model: parallel nbdkit: debug: memory: get_ready nbdkit: debug: allocator: malloc,mlock=true nbdkit: debug: allocator parameter: mlock=true nbdkit: error: allocator=malloc: mlock: Cannot allocate memory ./test-memory-allocator-malloc-mlock.sh: run cleanup hooks: exit code 1 FAIL test-memory-allocator-malloc-mlock.sh (exit status: 1) (cherry picked from commit c05c44cc7bc78cca7a92bbc85b8f940a6f5477c9) --- nbdkit.spec | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index a8592dd..8c51afb 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -817,22 +817,40 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/nbdkit-S3-plugin.1* %check %ifnarch %{broken_test_arches} +function skip_test () +{ + for f in "$@"; do + rm -f "$f" + echo 'exit 77' > "$f" + chmod +x "$f" + done +} + # Workaround for broken libvirt (RHBZ#1138604). mkdir -p $HOME/.cache/libvirt # tests/test-captive.sh is racy especially on s390x. We need to # rethink this test upstream. -truncate -s 0 tests/test-captive.sh +skip_test tests/test-captive.sh %ifarch s390x # Temporarily kill tests/test-cache-max-size.sh since it fails # sometimes on s390x for unclear reasons. -truncate -s 0 tests/test-cache-max-size.sh +skip_test tests/test-cache-max-size.sh %endif # Temporarily kill test-nbd-tls.sh and test-nbd-tls-psk.sh # https://www.redhat.com/archives/libguestfs/2020-March/msg00191.html -truncate -s 0 tests/test-nbd-tls.sh tests/test-nbd-tls-psk.sh +skip_test tests/test-nbd-tls.sh tests/test-nbd-tls-psk.sh + +# This test fails on RHEL 9 & aarch64 with the error: +# nbdkit: error: allocator=malloc: mlock: Cannot allocate memory +# It could be the mlock limit on the builder is too low. +%if 0%{?rhel} +%ifarch aarch64 +skip_test tests/test-memory-allocator-malloc-mlock.sh +%endif +%endif # Make sure we can see the debug messages (RHBZ#1230160). export LIBGUESTFS_DEBUG=1