gating: Use upstream branch for testing

Related: RHEL-163449
This commit is contained in:
Marian Csontos 2026-04-29 15:15:51 +02:00
parent 5116822522
commit 923a5397d8
3 changed files with 80 additions and 63 deletions

View File

@ -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

View File

@ -24,8 +24,29 @@ prepare:
- mdadm
- vdo
- 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

View File

@ -1,68 +1,61 @@
#!/bin/bash -x
#!/bin/bash -ex
BRANCH="test-rhel-10.3"
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 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,16 @@ 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
for flavour in $flavours; do
# TODO: Repeat failure if ???
"$RUNNER" --batch --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 "$TESTSUITE_OUT_FILE"
! grep -v "\(passed\|skipped\|warnings\|running 1 tests\)" "$TESTSUITE_OUT_FILE" | grep -Ev "(${ignore_failures_pattern})" | grep -v "^[[:space:]]*$"
! ci/ignore.sh < "$TESTSUITE_OUT_FILE" | grep -v "^[[:space:]]*$"
exit $?