diff --git a/lvm2.spec b/lvm2.spec index 1e1d9e0..7e51263 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -6,7 +6,7 @@ %global enable_lvmpolld 1 %global enable_thin 1 %global enable_dmfilemapd 1 -%global enable_testsuite 1 +%global enable_testsuite 0 %global enable_vdo 1 %global enable_writecache 1 %global enable_integrity 1 @@ -42,7 +42,7 @@ %global shortcommit %(c=%{commit}; echo ${c:0:7}) %endif #%%global rel_suffix .bz2141837 -%global rel_suffix .1 +#%%global rel_suffix .1 # Do not reset Release to 1 unless both lvm2 and device-mapper # versions are increased together. @@ -55,7 +55,7 @@ Version: 2.03.33 %if 0%{?from_snapshot} Release: 0.1.20211115git%{shortcommit}%{?dist}%{?rel_suffix} %else -Release: 4%{?dist}%{?rel_suffix} +Release: 5%{?dist}%{?rel_suffix} %endif License: GPL-2.0-only URL: https://sourceware.org/lvm2 @@ -763,6 +763,9 @@ An extensive functional testsuite for LVM2. %endif %changelog +* Thu May 07 2026 Marian Csontos - 2.03.33-5.el9 +- Fix false positive warnings about stray FDs on s390x. + * Mon Mar 09 2026 Marian Csontos - 2.03.33-4.el9_8.1 - Fix false positive warnings about stray FDs on s390x. diff --git a/plans/gating.fmf b/plans/gating.fmf index e70836e..156ad94 100644 --- a/plans/gating.fmf +++ b/plans/gating.fmf @@ -25,8 +25,29 @@ prepare: - vdo - kmod-kvdo - lvm2 - - lvm2-testsuite + #- lvm2-testsuite - lvm2-lockd - lvm2-dbusd - device-mapper-event - cryptsetup + - git + # build requirement to build test suite: + # NOTE: it may be possible to reduce these + - make + - gcc + - gcc-c++ + - libselinux-devel + - libsepol-devel + - libblkid-devel + - ncurses-devel + - libedit-devel + - libaio-devel + - libnvme-devel + - xfsprogs-devel + - dlm-devel + - module-init-tools + - pkgconfig + - systemd-devel + - systemd-units + - device-mapper-persistent-data + #- sanlock-devel diff --git a/tests/gating/main.sh b/tests/gating/main.sh index eea8ee3..b7b1820 100755 --- a/tests/gating/main.sh +++ b/tests/gating/main.sh @@ -1,68 +1,61 @@ -#!/bin/bash -x +#!/bin/bash -ex + +BRANCH="test-rhel-9.9" TESTSUITE_OUT_FILE="lvm2-testsuite.out" -IGNORE_FAILURES=( - "lvconvert-thin.sh" - "lvcreate-cache.sh" - "lvcreate-thin-big.sh" - "lvconvert-cache-abort.sh" - "lvconvert-mirror.sh" - "dmeventd-restart.sh" - "nomda-restoremissing.sh" - "api/dbus" - "open-file-limit.sh" - "shell/integrity" - "writecache-blocksize" - "system_id.sh" - "shell/lvconvert-repair-policy.sh" - "shell/lvconvert-repair-thin.sh" - "shell/thin-foreign-dmeventd.sh" - "shell/lvresize-fs-crypt.sh" -) - -SKIP_TESTS=( - "api/dbustest.sh" - "read-ahead.sh" - "shell/inconsistent-metadata.sh" - "lvconvert-cache-abort.sh" - "shell/000-basic.sh" - "shell/fsadm-crypt.sh" - "lvconvert-raid-reshape.sh" - "shell/lvconvert-raid-takeover.sh" - "shell/lvm-on-md.sh" - "shell/thin-flags.sh" - "shell/inconsistent-metadata.sh" - "shell/vgchange-many.sh" -) - -skip_tests_regex="$(printf "%s|" "${SKIP_TESTS[@]}")" -skip_tests_regex="${skip_tests_regex%|}" # Remove trailing pipe - -ignore_failures_pattern="$(printf "%s|" "${IGNORE_FAILURES[@]}")" -ignore_failures_pattern="${ignore_failures_pattern%|}" # Remove trailing pipe - free df lsblk -systemctl stop lvm2-lvmpolld.service -systemctl stop lvm2-lvmpolld.socket -systemctl stop lvm2-monitor.service -systemctl stop dm-event.socket -systemctl stop dm-event.service -systemctl stop lvm2-pvscan@.service -systemctl mask lvm2-pvscan@.service -sed -i 's/monitoring *= *.*/monitoring = 0/' /etc/lvm/lvm.conf +for service in \ + lvm2-lvmpolld.service \ + lvm2-lvmpolld.socket \ + lvm2-monitor.service \ + dm-event.socket \ + dm-event.service \ + "lvm2-pvscan@.service" \ + ; \ +do + systemctl stop "$service" || : + systemctl mask "$service" || : +done +sed -i 's/monitoring *= *.*/monitoring = 0/' /etc/lvm/lvm.conf || : -cd /usr/share/lvm2-testsuite || exit 1 -lvm2_tests="$(find . -name "*.sh" | sed 's/^\.\///' | grep -vE "($skip_tests_regex)" | sort)" +# TODO: change the branch depending on the OS major.minor version +# Install lvm2 tests from upstream branch: +git clone --depth=1 --branch "$BRANCH" -- "https://gitlab.com/lvmteam/lvm2.git" lvm2-test + +# Make the test suite: +cd lvm2-test +./configure +make -C test +# NOTE: testsuite works either when installed OR with make check +make -C test install +# NOTE: clean up to remove built binaries, just in case! +make clean + +RUNNER="/usr/bin/lvm2-testsuite" +TEST_PATH="/usr/share/lvm2-testsuite" +[[ -x "$RUNNER" ]] +[[ -d "$TEST_PATH" ]] + +chmod 755 ci/tests.sh +chmod 755 ci/ignore.sh + +lvm2_tests="$(ci/tests.sh)" +if [[ -z $lvm2_tests ]]; then + echo "ERROR: Found no tests to run" >&2 + exit 1 +fi echo "$lvm2_tests" -cd - || exit 1 -cd /usr/share/lvm2-testsuite/lib || exit 1 -flavours="$(ls -1 flavour-udev-* | grep -v "lvmlockd-dlm\|lvmlockd-sanlock" | grep "vanilla" | sed 's/^flavour-//')" + +flavours="$(cd "$TEST_PATH/lib" && ls -1 flavour-udev-* | grep -v "lvmlockd-dlm\|lvmlockd-sanlock" | grep "vanilla" | sed 's/^flavour-\(.*\)/\1/')" +if [[ -z $flavours ]]; then + echo "ERROR: Found no flavours to run" >&2 + exit 1 +fi echo "$flavours" -cd - || exit 1 # Run testsuite in RAM disk: mkdir -p /dev/shm/lvm2-slave @@ -70,13 +63,30 @@ export LVM_TEST_DIR=/dev/shm/lvm2-slave mount -o remount,dev /dev/shm for test_script in $lvm2_tests; do - lvm2-testsuite --batch --flavours "$flavours" --only "$test_script" 2>&1 | tee -a "$TESTSUITE_OUT_FILE" - RESULT="${PIPESTATUS[0]}" - if [[ $RESULT -ne 0 ]]; then - tmt-file-submit -l "${flavours}:${test_script//\//_}.txt" - fi + echo "################################################################################" > /dev/console + echo "# Running test $test_script" > /dev/console + echo "################################################################################" > /dev/console + for flavour in $flavours; do + # TODO: Repeat failure if ??? + "$RUNNER" --batch --continue --flavours "$flavour" --only "$test_script" 2>&1 | tee -a "$TESTSUITE_OUT_FILE" + RESULT="${PIPESTATUS[0]}" + if [[ $RESULT -ne 0 ]]; then + tmt-file-submit -l "${flavour}:${test_script//\//_}.txt" + fi + done done +tmt-file-submit -l "journal" +tmt-file-submit -l "list" tmt-file-submit -l "$TESTSUITE_OUT_FILE" -! grep -v "\(passed\|skipped\|warnings\|running 1 tests\)" "$TESTSUITE_OUT_FILE" | grep -Ev "(${ignore_failures_pattern})" | grep -v "^[[:space:]]*$" -exit $? + +echo -e "\nFailures:" +grep -v "\(passed\|skipped\|warnings\)$" list || : + +echo -e "\nSummary:" +cut -d" " -f2 "list" | sort | uniq -c + +echo -e "\nFailures to check:" +if ci/ignore.sh < "list" | grep -v "^[[:space:]]*$"; then + exit 1 +fi