Zdenek Kabelac [Mon, 24 Nov 2025 14:09:54 +0000 (15:09 +0100)]
gitlab: ignore some test
These test are failing for kernel issue - so ATM
keep them ignored when checking if tests passed.
Zdenek Kabelac [Mon, 24 Nov 2025 09:31:10 +0000 (10:31 +0100)]
test: minor updates
Drop sleep before udev_wait.
Use 'sort -u' over 'sort | uniq'
Avoid some unnecessary 'not'.
Zdenek Kabelac [Mon, 24 Nov 2025 13:12:31 +0000 (14:12 +0100)]
test: extend loop
Add few more loop checks before considering repair is not made.
Zdenek Kabelac [Mon, 24 Nov 2025 13:28:17 +0000 (14:28 +0100)]
test: add extra write
To ensure there is some scheduled 'write' operation for faster
discovery by dmeventd there is a faulty array member for repair.
Zdenek Kabelac [Mon, 24 Nov 2025 13:08:14 +0000 (14:08 +0100)]
test: count with postponning
dmevent may postpostne test when it gets 'error' return code
from failed action.
Zdenek Kabelac [Mon, 24 Nov 2025 12:30:23 +0000 (13:30 +0100)]
test: check for lvmdbusd presence
Test checking for presence of running lvm commands would be invalid
if lvmdbusd is running in the system (which could be even unkilled
process started by the test suite itself....)
Zdenek Kabelac [Fri, 21 Nov 2025 22:01:35 +0000 (23:01 +0100)]
test: add sync before checkin failure
Zdenek Kabelac [Mon, 24 Nov 2025 09:30:43 +0000 (10:30 +0100)]
test: thin-pool is single-segment lv
Zdenek Kabelac [Mon, 24 Nov 2025 10:38:14 +0000 (11:38 +0100)]
test: fix and refactor timestamp tracking in TimedBuffer
Refactor TimedBuffer::push() to fix timestamp bugs and improve clarity.
The bug: timestamps were incorrectly updated when processing empty
content at buffer boundaries, causing stale timestamps to persist and
be used for subsequently arriving lines.
The fix: only set timestamp when starting a new line with actual content:
if ( (b != e) && incomplete.second.empty() && stamp )
Also simplified the code:
- Eliminated intermediate 'now' variable - call gettime() directly
- Converted while loop to for loop for clearer iterator progression
- Reset incomplete buffer with Timespec() instead of current time
This is important for bash 'set -v' output where command text may
arrive in chunks without immediate newlines.
i.e. test like this was giving misleading time stamps:
echo 1
sleep 1
echo 2
sleep 2
Co-Authored-By: Claude <noreply@anthropic.com>
Peter Rajnoha [Mon, 24 Nov 2025 14:02:54 +0000 (15:02 +0100)]
gitignore: update
Marian Csontos [Mon, 24 Nov 2025 13:28:00 +0000 (14:28 +0100)]
doc: fix release dates
Marian Csontos [Fri, 21 Nov 2025 19:06:45 +0000 (20:06 +0100)]
post-release
Marian Csontos [Fri, 21 Nov 2025 19:06:45 +0000 (20:06 +0100)]
pre-release 2.03.37
Marian Csontos [Fri, 21 Nov 2025 18:57:49 +0000 (19:57 +0100)]
WHATS_NEW: update
Marian Csontos [Fri, 21 Nov 2025 18:59:45 +0000 (19:59 +0100)]
make: generate
David Teigland [Fri, 21 Nov 2025 15:42:57 +0000 (09:42 -0600)]
lvscan: blockdevice option is unused
Zdenek Kabelac [Fri, 21 Nov 2025 15:35:48 +0000 (16:35 +0100)]
test: drop usage of LVM_BINARY
Actually we don't want ot define this variable to better
test real installed lvm2-testsuite package
Zdenek Kabelac [Fri, 21 Nov 2025 15:35:15 +0000 (16:35 +0100)]
spec: build rpm with timestamp of current date
David Teigland [Thu, 20 Nov 2025 21:24:50 +0000 (15:24 -0600)]
lvmpersist: remove unregister error message
If PR was already stopped, stopping PR again would
generate an "sg_persist unregiser error" message
when each sg_persist command returned an error.
The actual result of the lvmpersist stop command
is determined by checking that the key is removed,
not by the sg_persist exit code. If the key is not
removed from any device, then the command fails with
another higher level error message.
Zdenek Kabelac [Thu, 20 Nov 2025 15:50:44 +0000 (16:50 +0100)]
make: generate
Zdenek Kabelac [Thu, 20 Nov 2025 15:50:13 +0000 (16:50 +0100)]
revert "debug dmevent"
Unwanted.
Zdenek Kabelac [Wed, 19 Nov 2025 23:22:25 +0000 (00:22 +0100)]
debug dmevent
Zdenek Kabelac [Wed, 19 Nov 2025 23:21:58 +0000 (00:21 +0100)]
test: umounting by dmeventd
Correct and simplify test.
Use LVM_BINARY for path to lvm binary used by script.
Zdenek Kabelac [Wed, 19 Nov 2025 23:22:19 +0000 (00:22 +0100)]
test: aux updates
Ssend eval stderr to null as there is no need for extra trace
of eval values in teardown.
Drop passing args to lvmpoll_dump.
Zdenek Kabelac [Thu, 20 Nov 2025 09:51:09 +0000 (10:51 +0100)]
test: show lvmlockd debug info in testing
Zdenek Kabelac [Thu, 20 Nov 2025 09:49:41 +0000 (10:49 +0100)]
lvmlockd: reduce require of two SIGTERM signals in shutdown
When lvmlockd received SIGTERM, for_each_lockspace() would signal
lockspace threads to stop and then immediately check if they were
done. Due to scheduling, threads often hadn't finished yet, causing
for_each_lockspace() to return a non-zero count, which reset
daemon_quit to 0. This required a second SIGTERM to actually exit,
adding delays to daemon shutdown in tests.
Two issues were fixed:
1. Fixed mutex synchronization for thread_done flag:
The lockspace thread was setting ls->thread_done while holding
only lockspaces_mutex, but for_each_lockspace() was reading it
while holding only ls->mutex, creating a race condition. Now
thread_done is set while holding both mutexes in the correct
order (lockspaces_mutex first, then ls->mutex).
2. Added wait loop during daemon shutdown:
When daemon_quit is set and threads are signaled to stop,
for_each_lockspace() now waits up to 100ms (checking every 1ms)
for threads to actually finish before checking their status.
This wait only activates during daemon shutdown to avoid adding
delays to normal lockspace operations.
In practice, threads finish in 1-2ms, so shutdown completes quickly
with a single SIGTERM.
Co-Authored-By: Claude <noreply@anthropic.com>
David Teigland [Mon, 17 Nov 2025 21:47:42 +0000 (15:47 -0600)]
deviced_ids: extended refresh period
If an automatic device ID refresh is triggered, and does not find
some device IDs, then extend the refresh behavior for a number of
seconds, configured in lvm.conf:
device_ids_refresh=<seconds> accepts 10-600 seconds
Previous settings remain the same:
device_ids_refresh=0 disables automatic refresh
device_ids_refresh=1 enables one refresh
While the refresh period is extended, a new line appears in
system.devices: REFRESH_UNTIL=<YYYYMMDDHHMMSS>
The timestamp is written by the first lvm command to trigger the
refresh, and is set to current time + device_ids_refresh seconds.
REFRESH_UNTIL is removed when all devices are found, or when the
time expires.
Zdenek Kabelac [Wed, 19 Nov 2025 17:57:31 +0000 (18:57 +0100)]
test: tune slowdown
Here we have some tricky case - ATM we are using suspend with
flushing when changing DM tables for cache volume - but this
can take too much time with our delayed device.
So trying to minimize chance to hit this race on very fast machines.
Zdenek Kabelac [Tue, 18 Nov 2025 21:55:16 +0000 (22:55 +0100)]
test: improve lvmpolld_talk error messages
Refactor lvmpolld_talk() to provide clearer diagnostics when connection
fails. Previously misreported socket failures as "nc not available".
Now distinguishes between missing tools, missing socket, and connection
errors with actual error details.
Co-Authored-By: Claude <noreply@anthropic.com>
Zdenek Kabelac [Tue, 18 Nov 2025 22:22:55 +0000 (23:22 +0100)]
test: enhance _check_size
Grab lv_size as the first thing.
Make tests easier and drop '_not' variants.
Zdenek Kabelac [Wed, 19 Nov 2025 17:35:48 +0000 (18:35 +0100)]
cache: add debug message
Zdenek Kabelac [Tue, 18 Nov 2025 22:22:34 +0000 (23:22 +0100)]
libdaemon: log which signal triggered daemon shutdown
Capture and log the signal number that triggers daemon shutdown.
This helps diagnose unexpected daemon terminations during testing.
Zdenek Kabelac [Tue, 18 Nov 2025 11:05:52 +0000 (12:05 +0100)]
test: add more debug for abort case
Improve logging to better capture lvconvert problem.
Zdenek Kabelac [Mon, 17 Nov 2025 19:53:28 +0000 (20:53 +0100)]
dmeventd: drop unused var
fdd no longer needed.
Zdenek Kabelac [Tue, 18 Nov 2025 09:49:54 +0000 (10:49 +0100)]
signals: rename interruptible_usleep to sigint_usleep
The interruptible_usleep() function returned 1 on interruption (error)
and 0 on success, opposite to LVM2 convention where 1=success, 0=failure.
Changes:
- Rename to sigint_usleep() to align with sigint_*() function family
- Invert return: 1 if sleep completed, 0 if interrupted
- Update all call sites to use ! operator for error checking
This makes the API more intuitive as ! clearly indicates error path
and return values match standard LVM2 conventions.
Co-Authored-By: Claude <noreply@anthropic.com>
Peter Rajnoha [Tue, 18 Nov 2025 08:59:02 +0000 (09:59 +0100)]
WHATS_NEW
Peter Rajnoha [Tue, 18 Nov 2025 08:54:24 +0000 (09:54 +0100)]
make: generate
Peter Rajnoha [Fri, 14 Nov 2025 09:46:28 +0000 (10:46 +0100)]
lvmconfig: make it possible to print various config types in list mode
For example:
❯ lvmconfig --type diff
report {
compact_output=1
headings=2
}
activation {
polling_interval=1
}
❯ lvmconfig --type diff --list
report/compact_output=1
report/headings=2
activation/polling_interval=1
Peter Rajnoha [Fri, 14 Nov 2025 08:42:07 +0000 (09:42 +0100)]
config: add support for list mode for all cfg_def_tree_t types
Before, we printed only CFG_DEF_TREE_LIST as a list instead of
structured tree. But we can also print all the other types as lists
if needed which might be more suitable.
This patch adds a 'listmode' switch to struct config_def_tree_spec
so that the config printing functions (_out_prefix_fn, _out_line_fn,
_out_suffix_fn) can then decide on the actual format.
Zdenek Kabelac [Mon, 17 Nov 2025 18:13:16 +0000 (19:13 +0100)]
test: use 4k blocks for fs
Zdenek Kabelac [Mon, 17 Nov 2025 17:55:00 +0000 (18:55 +0100)]
test: correcting wait shell vars
Zdenek Kabelac [Mon, 17 Nov 2025 16:34:48 +0000 (17:34 +0100)]
test: just skip test if there are suspended devices
Zdenek Kabelac [Mon, 17 Nov 2025 15:17:38 +0000 (16:17 +0100)]
test: use should for a while
Zdenek Kabelac [Mon, 17 Nov 2025 13:44:00 +0000 (14:44 +0100)]
test: aux type
Removed extra '/'.
Zdenek Kabelac [Mon, 17 Nov 2025 13:40:05 +0000 (14:40 +0100)]
test: missed removal of clvmd testing
Zdenek Kabelac [Mon, 17 Nov 2025 13:36:38 +0000 (14:36 +0100)]
dmfilemap: stray close code reuse
Reuse header file from libdaemon directory here.
It has better code to close stray descriptors - since there
are systems with very high numbers of supported opened descriptors.
In case project would ever split header file would need to be copied.
Also use >= check for valid file descriptor.
Zdenek Kabelac [Mon, 17 Nov 2025 12:55:27 +0000 (13:55 +0100)]
WHATS_NEW: update
Zdenek Kabelac [Mon, 17 Nov 2025 00:12:03 +0000 (01:12 +0100)]
test: aux rename wait variable
Zdenek Kabelac [Sun, 16 Nov 2025 23:39:26 +0000 (00:39 +0100)]
test: rework bare wait commands
Replace bare 'wait' commands with specific PID waiting to prevent
test hangs when base shell runs process in the background.
When tests use 'wait' without arguments, it waits for ALL background
processes. This may causes tests to hang indefinitely.
Fix by capturing background job PIDs and waiting
only for those specific processes.
Pattern changed from:
some_command &
wait
To:
some_command &
SOME_PID=$!
wait "$SOME_PID" || true
The '|| true' handles cases where the process has already exited.
Co-Authored-By: Claude <noreply@anthropic.com>
Zdenek Kabelac [Mon, 17 Nov 2025 00:13:15 +0000 (01:13 +0100)]
test: aux kill_sleep_kill
Zdenek Kabelac [Sat, 15 Nov 2025 19:56:26 +0000 (20:56 +0100)]
test: remove clvmd testing infrastructure
Remove all clvmd-related test code since clvmd was removed from lvm2.
This includes prepare_clvmd(), SKIP_WITH/WITHOUT_CLVMD variables,
LOCAL_CLVMD conditional blocks, and outdated comments. Tests now run
unconditionally with non-cluster behavior.
Co-Authored-By: Claude <noreply@anthropic.com>
Zdenek Kabelac [Sat, 15 Nov 2025 13:09:52 +0000 (14:09 +0100)]
test: simplify corrupt_dev() function
Replace strings+grep with grep -oba for byte pattern search. This is
more direct and efficient - grep finds the byte offset, we extract it
with cut, and use dd to overwrite at that position. Also add
conv=notrunc to prevent truncation.
Zdenek Kabelac [Fri, 14 Nov 2025 12:45:16 +0000 (13:45 +0100)]
test: aux easier code for building config
For older bash use more simple code.
Co-Authored-By: Claude <noreply@anthropic.com>
Zdenek Kabelac [Mon, 17 Nov 2025 09:32:50 +0000 (10:32 +0100)]
daemonize: fix file descriptor leaks on error paths
Fix resource leaks in daemonization code across multiple daemons by
properly closing /dev/null file descriptor on all error paths.
Changes across all daemonizing code:
- Skip dup2() when fd already equals target (no-op optimization)
- Close fd on error paths before exit (prevents leak)
- Add Coverity annotations on both error and success paths
- Use consistent == -1 pattern for dup2() error checks
- Remove explicit close(0/1/2) in cmirrord (dup2 handles atomically)
This eliminates resource leak warnings from static analyzers while
maintaining correct daemonization behavior.
Zdenek Kabelac [Mon, 17 Nov 2025 00:04:58 +0000 (01:04 +0100)]
lvmpolld: signal child processes before pthread_cancel
Fix lvmpolld shutdown to properly terminate child lvpoll processes
before cancelling monitoring threads.
Previously, pthread_cancel was called on monitoring threads while
their child processes were still running. This could leave orphaned
lvpoll processes and cause shutdown delays.
Now send SIGTERM to child lvpoll processes first, then immediately
cancel the monitoring threads which will reap the children during
their cleanup.
This significantly reduces shutdown time in tests with lvmpolld.
Co-Authored-By: Claude <noreply@anthropic.com>
Zdenek Kabelac [Sun, 16 Nov 2025 23:45:54 +0000 (00:45 +0100)]
libdaemon: improve graceful shutdown of client threads
Optimize daemon shutdown to allow client threads to exit quickly
without blocking on socket operations, and refactor code to improve
maintainability.
Functional improvements:
1. Close listening socket BEFORE waiting for client threads
- Prevents new connections during shutdown
- Unlinks socket file earlier in shutdown sequence
2. Shutdown all client sockets with SHUT_RDWR
- Interrupts blocking read() calls in client threads
- Allows threads to exit immediately instead of hanging
- Uses shutdown() to wake blocked threads, not just close()
3. Add early exit check in client thread loop
- Check _shutdown_requested at start of while loop
- Allows threads to exit gracefully when shutdown is initiated
Code organization improvements:
4. Eliminate goto statement
- Replace "goto out" with direct function calls
- Improves code readability and control flow clarity
- Both daemon_main and daemon_init paths now follow same pattern
5. Extract _shutdown_sockets() helper function
- Centralizes all socket shutdown logic in one place
- Handles both listening socket close and client socket shutdown
- Respects _systemd_activation flag for socket file unlinking
- Includes comprehensive logging for shutdown operations
6. Extract _daemon_cleanup() helper function
- Common cleanup path for both daemon_main and normal execution
- Handles daemon_fini callback, logging, pidfile removal
- Eliminates code duplication between execution paths
This allows daemon to shutdown cleanly without client threads
blocking on socket operations, enabling faster test execution and
cleaner shutdown sequences.
Co-Authored-By: Claude <noreply@anthropic.com>
Zdenek Kabelac [Mon, 17 Nov 2025 09:47:52 +0000 (10:47 +0100)]
cov: missing free
With recent commit
f7a308d2e71e332a9cbc01d917182ba562943b77
we missed to relase allocated idname.
Zdenek Kabelac [Mon, 17 Nov 2025 09:48:01 +0000 (10:48 +0100)]
dmeventd: fix missing lock when reading _timeout_thread_id
Acquire _timeout_mutex before reading _timeout_thread_id to match
the locking pattern used when writing this variable. While the
variable is only written once and never changed, static analyzers
flag the inconsistent lock usage.
Release mutex before pthread_join() to avoid holding locks during
blocking operations.
Zdenek Kabelac [Fri, 14 Nov 2025 10:19:15 +0000 (11:19 +0100)]
make: generate
Zdenek Kabelac [Fri, 14 Nov 2025 10:04:10 +0000 (11:04 +0100)]
test: we need fs on origin as well
Last commit made fs only on snapshot - but it's needed also on origin.
Zdenek Kabelac [Thu, 13 Nov 2025 22:54:30 +0000 (23:54 +0100)]
test: bash clenaups
Various improvemetns to make shellcheck less complaining.
Zdenek Kabelac [Thu, 13 Nov 2025 14:17:18 +0000 (15:17 +0100)]
test: check simplified
We do not need to use 5 second sleep here for checking
opened device cannot be removed - just check with mounted
snapshot - which will also be seen as opened device - but
with known holder - thus 5sec retry loop is avoided.
Zdenek Kabelac [Thu, 13 Nov 2025 13:51:11 +0000 (14:51 +0100)]
test: require newer target
Zdenek Kabelac [Wed, 12 Nov 2025 22:56:00 +0000 (23:56 +0100)]
man: update pvmove for pvmove_max_segment_size_mb
Zdenek Kabelac [Thu, 13 Nov 2025 17:10:42 +0000 (18:10 +0100)]
dmeventd: cleanup
Show help options in alphabetic order.
David Teigland [Thu, 13 Nov 2025 19:55:08 +0000 (13:55 -0600)]
vgchange: limit persist stop in lockstop
"vgchange --lockstop --persist stop" should skip the
persist_stop() on a VG without PR required, otherwise
it hits errors attempting to stop PR on VGs where it's
not used.
Peter Rajnoha [Thu, 13 Nov 2025 08:53:36 +0000 (09:53 +0100)]
test: select-report: fix checking of failure scenarios
David Teigland [Wed, 12 Nov 2025 21:25:53 +0000 (15:25 -0600)]
man: update lvmdevices refresh info
Zdenek Kabelac [Tue, 11 Nov 2025 23:44:18 +0000 (00:44 +0100)]
test: fix lots of not usage
Added lots of FIXME - since these tests
are not working properly - but ATM it's unclear
what they are supposed to test.
Zdenek Kabelac [Wed, 12 Nov 2025 12:24:28 +0000 (13:24 +0100)]
test: fix use of not mimages|mirrorlog....
Zdenek Kabelac [Wed, 12 Nov 2025 12:09:09 +0000 (13:09 +0100)]
test: fix use of not is_lv_opened_
Correct the test and wait till dmeventd really umounts directory.
Zdenek Kabelac [Wed, 12 Nov 2025 11:53:20 +0000 (12:53 +0100)]
test: fix typo group to grep
We actually want to use 'not grep'.
Zdenek Kabelac [Wed, 12 Nov 2025 11:45:59 +0000 (12:45 +0100)]
test: fix use of not sel
Looks like we need to fix 101%.
Zdenek Kabelac [Wed, 12 Nov 2025 11:00:53 +0000 (12:00 +0100)]
test: fix use of not test
Fixing 'not ' and making it more readable.
Handle blkid error code 2.
Zdenek Kabelac [Wed, 12 Nov 2025 09:58:39 +0000 (10:58 +0100)]
test: fix use of not fill
Zdenek Kabelac [Wed, 12 Nov 2025 12:24:44 +0000 (13:24 +0100)]
make: generate
David Teigland [Tue, 11 Nov 2025 20:36:28 +0000 (14:36 -0600)]
config: stop logging that a default value is used
default values are not interesting to see
David Teigland [Tue, 11 Nov 2025 20:24:49 +0000 (14:24 -0600)]
lvmlockd: fix lock_args flags usage with dlm
lockd_lockargs_get_meta_flags() only applies to sanlock, and
would cause dlm lockspaces to fail beause it doesn't recognize
the cluster name in a dlm VG lock_args string.
David Teigland [Tue, 11 Nov 2025 19:46:46 +0000 (13:46 -0600)]
lvmlockd: fix to allow for no vg_args
David Teigland [Mon, 10 Nov 2025 21:51:56 +0000 (15:51 -0600)]
man: update lvmdevices
David Teigland [Fri, 7 Nov 2025 01:28:25 +0000 (19:28 -0600)]
lvmdevices: update force option
When lvmdevices --update doesn't see any reason to update
system.devices, it doesn't update. Let the user force an
update in case they see a reason to do it.
David Teigland [Thu, 6 Nov 2025 22:45:28 +0000 (16:45 -0600)]
device_id: prevent incorrect dm uuid idtype
If a dm-uuid-based device was added to system.devices, and
the wrong dm-based type was specified, then the system.devices
entry would have the correct idname but the wrong idtype. e.g.
lvmdevices --adddev /dev/mapper/mpatha --deviceidtype crypt_uuid
would add an entry with: IDTYPE=crypt_uuid IDNAME=mpath-<uuid>
rather than the correct: IDTYPE=mpath_uuid IDNAME=mpath-<uuid>
This mistaken type would not affect lvm, and the device would
be entirely usable. The dm-based types (mpath, crypt, lvmlv)
were interchangable because they all read the device id from
the same dm/uuid sysfs file.
Fix this by adding a missing check that the dm uuid prefix is
correct for the specified idtype. Also, accept an existing
system.devices file which contains this mistake.
David Teigland [Thu, 6 Nov 2025 21:30:12 +0000 (15:30 -0600)]
lvmdevices: new option --listids shows id types and names for dev
David Teigland [Mon, 10 Nov 2025 22:31:30 +0000 (16:31 -0600)]
lvmdevices: new option --delid to delete device by device_id
David Teigland [Wed, 5 Nov 2025 21:55:37 +0000 (15:55 -0600)]
lvmdevices: new option --addid to add device by device_id
Zdenek Kabelac [Mon, 10 Nov 2025 23:03:15 +0000 (00:03 +0100)]
test: aux improve daemon killing
When daemon takes multiple pids, handle them via array.
(as recently made with lvmlockd)
Zdenek Kabelac [Mon, 10 Nov 2025 23:06:32 +0000 (00:06 +0100)]
makefile: indent
Zdenek Kabelac [Mon, 10 Nov 2025 22:27:30 +0000 (23:27 +0100)]
gcc: fix fp complain about use of unit
Just quiting warning.
Zdenek Kabelac [Mon, 10 Nov 2025 22:10:31 +0000 (23:10 +0100)]
vdo: add missing synchronization
After wiping, formating and deactivating vdopool volume,
we should wait on udev before we continue and activate
same volume again with different UUID.
Zdenek Kabelac [Mon, 10 Nov 2025 18:22:31 +0000 (19:22 +0100)]
revert "test: update for new vg attr field"
This reverts commit
2855526824fd815bb0394eda3973d34cc4b985f7
for incorrect merging.
We already have
85bef39ed00dd4f657cb7781f2754f5bb5c5ac86.
Zdenek Kabelac [Mon, 10 Nov 2025 18:05:38 +0000 (19:05 +0100)]
test: use should for race-prone RAID unrepairable check
The test attempts to verify that RAID6 repair fails when too many devices
are unavailable. However, due to timing issues, the RAID array may
occasionally sync or partially repair before the test disables devices,
making the repair operation succeed when we expect it to fail.
Use 'should' to tolerate race conditions where:
- Fast RAID sync completes before devices are disabled
- Partial recovery happens despite disabled devices
- Background repair processes interfere with test expectations
This test typically fails as expected (unrepairable RAID), but can
legitimately pass in race conditions.
TODO: Implement more reliable control over RAID sync/repair timing to
ensure consistent test behavior.
Zdenek Kabelac [Mon, 10 Nov 2025 18:03:06 +0000 (19:03 +0100)]
test: use should for race-prone cache dirty state check
It's currently difficult to guarantee the cache remains dirty long enough
to trigger the expected filesystem corruption check. In rare race conditions,
the cache may flush and become clean before the uncache operation completes,
resulting in a clean filesystem when we expect corruption.
Use 'should' allow occasional test passes when the race condition results
in a clean cache.
TODO: Find a more reliable way to ensure cache stays dirty during test.
Zdenek Kabelac [Mon, 10 Nov 2025 15:36:39 +0000 (16:36 +0100)]
test: add some missing local keywords
Zdenek Kabelac [Mon, 10 Nov 2025 18:01:18 +0000 (19:01 +0100)]
spec: fix ldconfig_scriptlets macro for old RPM versions
Fix the ldconfig_scriptlets macro to work with RPM < 4.13 (Fedora < 24,
RHEL < 7.3) which don't support the %{!-option:...} conditional syntax.
Changes:
- Replace %{!-n:%{1}} with %%{?1} for positional parameter
- Add proper %% escaping: %{-n:-n} → %%{-n:-n %%{-n*}}
- Use %%{?1} instead of %{!-n:%{1}} to handle optional positional arg
The %{!-n:...} syntax (inverse conditional) was introduced in RPM 4.13.
Older versions like Fedora 19-23 (RPM 4.11-4.12) don't support it and
fail with "Package does not exist" error.
The new syntax works on both old and new RPM:
- %ldconfig_scriptlets libs
→ expands to: %post libs -p /sbin/ldconfig
- %ldconfig_scriptlets -n device-mapper-libs
→ expands to: %post -n device-mapper-libs -p /sbin/ldconfig
Fixes regression from commit
d6d13f1c9 which introduced the macro but
used syntax incompatible with old RPM versions.
Zdenek Kabelac [Mon, 10 Nov 2025 15:18:41 +0000 (16:18 +0100)]
test: check for presence of seagate_ilm command
Zdenek Kabelac [Sun, 9 Nov 2025 23:30:10 +0000 (00:30 +0100)]
test: use exit 1 call in stacktrace
Zdenek Kabelac [Sun, 9 Nov 2025 10:29:46 +0000 (11:29 +0100)]
test: remove unused --silent option from aux device functions
Remove the unused --silent parameter from aux device management functions:
- disable_dev()
- enable_dev()
- restore_from_devtable()
The --silent option was declared but is never actually used in the function
implementations - no code checked or acted upon this flag.
Updated callers in test scripts:
- lvchange-raid-transient-failures.sh
- lvconvert-repair-transient.sh
Both scripts called disable_dev/enable_dev with --silent flag, which is
now removed since it had no effect.
Zdenek Kabelac [Sun, 9 Nov 2025 13:23:17 +0000 (14:23 +0100)]
test: add declarative test requirement options
Add new inittest.sh options to declare test requirements declaratively:
New options:
--with-multi-host: Test requires LVM_TEST_MULTI_HOST to be set
--with-idm-failure: Test requires LVM_TEST_FAILURE to be set
--with-lock-type-idm: Test requires LVM_TEST_LOCK_TYPE_IDM to be set
--with-lock-type-dlm: Test requires LVM_TEST_LOCK_TYPE_DLM to be set
--with-lock-type-sanlock: Test requires LVM_TEST_LOCK_TYPE_SANLOCK to be set
Implementation:
- Initialize REQUIRE_* variables to 1 (enabled by default)
- When option is specified, read from environment variable with :-0 default
- Skip test if REQUIRE_* = 0 (environment variable not set or set to 0)
- Tests declare requirements upfront in inittest sourcing line
Benefits:
- Declarative: Requirements visible at top of test file
- Consistent: Follows --skip-with-* pattern
- No code duplication: Eliminates manual [ -z "$VAR" ] && skip checks
- Self-documenting: Clear what environment each test needs
Example usage:
Before: . lib/inittest --skip-with-lvmpolld
[ -z "$LVM_TEST_MULTI_HOST" ] && skip
After: . lib/inittest --skip-with-lvmpolld --with-multi-host
Updated 20 test scripts to use declarative options:
- Multi-host tests: multi_hosts_*.sh (8 files)
- IDM failure tests: idm_*_failure*.sh, lvmlockd_failure.sh (5 files)
- Lock type setup: aa-lvmlockd-{idm,dlm}-prepare.sh (2 files)
- Lock type removal: zz-lvmlockd-{idm,dlm}-remove.sh (2 files)
- Stress tests: stress_*.sh (3 files)
Zdenek Kabelac [Sat, 8 Nov 2025 20:19:25 +0000 (21:19 +0100)]
test: optimize lvm-wrapper.sh bash
Change shebang from /bin/sh to /usr/bin/env bash for consistency.
Convert all test commands to [[ ]] for better performance.
Zdenek Kabelac [Sat, 8 Nov 2025 20:44:54 +0000 (21:44 +0100)]
test: optimize utils.sh bash
Convert test/[ ] to [[ ]] for better performance.
Consolidate multi-line test conditions into single [[ ]] blocks.
Key changes:
- Replace all test/[ ] with [[ ]] for better performance
- Combine multiple test conditions with && into single [[ ]] blocks
- Convert test && { } patterns to if [[ ]] for multi-line blocks
- Standardize LVM_TEST_NODEBUG to use numeric comparison :-0
Notable improvements:
- STACKTRACE(): Changed from
test -z "$LVM_TEST_NODEBUG" && test -f TESTNAME && {
to
if [[ "${LVM_TEST_NODEBUG:-0}" -eq 0 && -f TESTNAME ]]; then
- Unified multi-condition checks into single [[ ]] expressions
(avoids multiple external command forks)
Performance benefits:
- [[ ]] is bash built-in, no fork overhead
- Single [[ ]] for multiple conditions more efficient than chained test
This page took 0.082351 seconds and 5 git commands to generate.