1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

3413 Commits

Author SHA1 Message Date
Zdenek Kabelac
d8e52aed87 tests: use non inlined copy constructor
gcc would like to see code without trying to inline large
copy constructor used for std::vector
2024-04-08 14:52:28 +02:00
Zdenek Kabelac
88ad83e3d6 makefiles: use SHOW 2024-04-08 14:52:23 +02:00
Zdenek Kabelac
04e8f8c93d tests: add sleep
mdadm may eventually be too slow...
2024-04-07 20:47:28 +02:00
Zdenek Kabelac
7fbd3bac71 tests: skip convertions tests for usptream driver 2024-04-05 14:25:27 +02:00
Zdenek Kabelac
6305db53c1 tests: add correct condition for skip of lvmpolld tests
Check when flavour want to test  lvmlockd & lvmpolld tests and
in for case ignore SKIP_WITH_LVMPOLLD from test script.
2024-04-05 14:14:50 +02:00
Zdenek Kabelac
000f55a1a2 tests: updated check for dm-vdo module
With new kernels dm-vdo is now correct name,
so use standard loading and just try extra for kvdo.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
ecacb2b544 tests: inittest fix skipping condition 2024-04-04 19:38:21 +02:00
Zdenek Kabelac
466265eaa6 tests: better constructor 2024-03-29 01:36:48 +01:00
Tony Asleson
59b46fc8cd tests: lvmdbusest.py faster test_z_sigint
Reduce #lv and intervals.

We are trying to ensure that the daemon stops while it's busy processing
its internal queues.  Decrease the number of LVs and intervals to allow
this test to complete in less time.
2024-03-28 18:18:37 +01:00
Tony Asleson
f2edc96bb6 tests: lvmdbustest.py skip if g_tmo != 0
This test doesn't have any additional value when running when g_tmo != 0.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
69f9fcfd20 tests: skip some mirror tests for polld and lockd
Leave just lvconvert-mirror-basic-1 test
for polld and lockd testing.
2024-03-27 01:26:57 +01:00
Zdenek Kabelac
1c2dff2655 tests: missed reduction of raid check 2024-03-25 17:17:40 +01:00
Zdenek Kabelac
7e5e98e4f2 tests: fix improper merge within last update 2024-03-25 15:01:48 +01:00
Zdenek Kabelac
75e532417e tests: check for raid shrink support
Shrink of raid LVs supported from 1.9
2024-03-25 14:46:02 +01:00
Zdenek Kabelac
781bf867cc tests: update lvconvert-raid.sh
Handle case of removal of orig leg while it's being synchronized.
2024-03-25 11:18:29 +01:00
Zdenek Kabelac
658c446f13 tests: update raid_leg_status check
Do not wait for progres (non zero processed amount of blocks),
when the raid status already reported 'resync' or 'recover'.
2024-03-25 11:18:29 +01:00
Zdenek Kabelac
e8b7b53db1 tests: aux avoid discarding created loop devices
Usually it's not a big deal, but couple test creates
large devices and here discard operation just excersice
CPU and consumes time.
2024-03-25 11:18:29 +01:00
Zdenek Kabelac
68939136c1 tests: reduction needs to ignore fs
Drop 'should' usage and use  --fs ignore when reducing raid LV.
2024-03-25 11:18:29 +01:00
Zdenek Kabelac
d7f6d5b9da tests: update extend of raid
Here we actually need to slowdown only $dev2 - since repair operation
is only reading data from this device and compares it with origin $dev1,
and if they match there is no write...
2024-03-25 11:15:58 +01:00
Zdenek Kabelac
c5827b2013 tests: check cachevol makes one table line for -cmeta
When using cache with cachevol, make sure the subdevice -cmeta
creates just one line.
2024-03-21 22:35:47 +01:00
Zdenek Kabelac
4efe8e83cf tests: add more sleep time
Give some more waiting time to testing loop.
2024-03-20 11:19:26 +01:00
Zdenek Kabelac
9c9c37aa11 tests: external origin chaining
Add tests for stacked usage of external origins.
2024-03-17 13:17:53 +01:00
David Teigland
4f9215e70f devices file: rename unused system.devices
If lvm.conf has use_devicesfile=0 and /etc/lvm/device/system.devices
exists, then rename it to system.devices-unused.YYYYMMDD.HHMMSS.
This prevents an old, incorrect system.devices from being used in
the future if lvm.conf is changed to use_devicesfile=1.
2024-02-15 11:40:37 -06:00
David Teigland
e59027e4f7 devices file: back up each version
Create backup copies of system.devices in /etc/lvm/devices/backup
named system.devices-YYYYMMDD.HHMMSS.NNNN.  NNNN is the version
counter from the file.

Each time that an lvm command writes a new system.devices file,
it also writes the same file in the backup directory.

A new comment line is added to system.devices with HASH=<num>
where <num> is a crc calculated from the uncommented lines in
system.devices.  This lets lvm detect if the file has been
modified outside of lvm itself.

If system.devices is edited directly, the next time a command
reads the file, the crc will not match the HASH value.  The
command will then rewrite system.devices with the correct HASH
value, and create a backup reflecting the edits.

A default limit of 50 backup files is kept, configurable by
lvm.conf devicesfile_backup_limit (set to 0 to disable backups.)
2024-02-15 11:40:37 -06:00
Zdenek Kabelac
c8f9dd2368 tests: testing creation of compressed thin-pool 2024-01-10 14:02:22 +01:00
David Teigland
e38d974b50 lvmdevices: handle empty fields in new check and update
Expand the recent commit 37773c1055
"lvmdevices: new output and options for check and update"
to specifically cover entries with empty fields.
2023-11-03 15:28:26 -05:00
David Teigland
37773c1055 lvmdevices: new output and options for check and update
- add new comparison between old and new entries, and use this
  as the basis for new dedicated output for check and update
- add new --refresh option to search for missing PVIDs on all
  devices, and possibly update the device ID
- internally, only use the term "refresh" for cases where a
  new device ID may be found and assigned for a missing PVID
2023-11-02 11:46:31 -05:00
David Teigland
ec47f0763d device_id: reduce messages
Don't print messages about devices file entries that are
missing or are being updated.
2023-11-02 11:46:31 -05:00
Zdenek Kabelac
5210f6665c tests: unit test for raid status 2023-10-31 18:53:30 +01:00
Zdenek Kabelac
0e2904d2c5 tests: longer timeout 2023-10-31 18:53:30 +01:00
Tony Asleson
3fa424f893 tests: lvmdbusd handles empty LvCommon.Devices
During vdo testing with smaller block devices the test needs to determine
which PVs in a VG are unused.  This was leveraging LvCommon.Devices, but
that isn't populated when a LV is resides on a LV pool instead of a PV.
This is a known limitation of the code at this time.  For now we will walk
all the PVs in the VG looking for ones that don't have any associated LVs
and use them instead.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2023-10-31 18:53:07 +01:00
David Teigland
282d947c36 tests: add devicesfile-misc 2023-10-23 15:17:29 -05:00
Zdenek Kabelac
c7851b9c34 tests: longer delay between table reloads
It looks like there is some kernel bug/limitation
that may cause invalid table load processing:

dmsetup load LVMTEST-LV1
device-mapper: reload ioctl on LVMTEST-LV1  failed: Invalid argument
  md/raid:mdX: reshape_position too early for auto-recovery - aborting.
           md: pers->run() failed ...
device-mapper: table: 253:38: raid: Failed to run raid array (-EINVAL)
device-mapper: ioctl: error adding target to table

However ATM there is not much we can do then make delays bigger.
TODO: fixing md core...
2023-10-20 00:21:13 +02:00
Zdenek Kabelac
5d4b2f9ea9 tests: skip on problematic kernel 2023-10-20 00:21:13 +02:00
Zdenek Kabelac
2e56778038 tests: aux kills lvmdbusd more agressively
It's not exactly trivial to kill 'frozen' lvmdbusd.
So skip the test testing interruption and also add killall use.
2023-10-18 01:48:50 +02:00
Zdenek Kabelac
beae68890c tests: wait till snapshot merge is finished
In case test runs with lvmpolld (and lvmlockd) wait till snapshot
merge is finished.
2023-10-18 01:47:13 +02:00
Zdenek Kabelac
8b8c9dea8a tests: init of dmevent may take upto a second
Dynamic load of plugins takes a while...
2023-10-17 23:24:03 +02:00
Zdenek Kabelac
249446e0aa tests: avoid busy looping
While waiting for the change, don't busy loop on CPU.
TODO: fix missing notification about device removal.
2023-10-17 16:49:23 +02:00
Zdenek Kabelac
cb2873ba1c tests: ensure file is removed
Make sure there are no previous loop results.
2023-10-17 16:49:23 +02:00
David Teigland
a836872199 device_id: accept wwids containing QEMU HARDDISK
A wwid may be useful even when it contains the string
"QEMU HARDDISK", so allow these to be used.
2023-10-16 15:21:22 -05:00
Zdenek Kabelac
d12e843e4a tests: aux mdadm_assemble skip path
If the old mdadm fails to assembly array due to its internal buggy logic
skip the test instead of failure.
2023-10-16 00:11:35 +02:00
Zdenek Kabelac
f55dc3006e tests: simplify line counting
No need for pipes
2023-10-15 21:48:22 +02:00
Zdenek Kabelac
098bc780a2 tests: better synchronization 2023-10-15 21:48:22 +02:00
Zdenek Kabelac
dfaa891281 tests: fsck with yes
Fsck may need to update metadata even after clean unmount.
2023-10-15 19:51:43 +02:00
Zdenek Kabelac
d5e58768aa tests: check for blkid
When libblkid is not present (older systems) we can't use new -fs tests at
all so skip these tests.
2023-10-15 14:43:13 +02:00
Zdenek Kabelac
63885da5b9 tests: shorting batch line output 2023-10-15 14:42:14 +02:00
Zdenek Kabelac
5cc54458b7 tests: old way to disable copy contructor
Mark them private.
2023-10-14 23:37:38 +02:00
Zdenek Kabelac
d2d8d0ab5a tests: io stream class saver
Restore io stream when changed by modifiers.
Also simplify getenv access.
2023-10-14 23:14:26 +02:00
Zdenek Kabelac
1a67bfe396 tests: extend the usability for older systems
Extend the test a bit futher so we can keep logic of resize
working similarly well for older and newer systems.

Test uses new 'aux have_fsinfo'function to regnize compiled
version of lvm.
2023-10-14 23:13:46 +02:00
Zdenek Kabelac
26766dcf73 tests: aux add have_fsinfo
Add function to detect whether lvm2 was compiled with
blkid.h with BLKID_SUBLKS_FSINFO

Currently it can be detected by support of '--fs checksize'.
2023-10-14 23:12:57 +02:00
Zdenek Kabelac
0b11b08b6e tests: handle empty table better 2023-10-13 15:00:55 +02:00
Zdenek Kabelac
9fa364414c tests: skip for missing mkfs.xfs 2023-10-13 14:33:56 +02:00
Zdenek Kabelac
1605d39b93 tests: comment about version checking to aux.sh
If there would be futher version checking needed,
make a notice there are now two -V formats.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
be2b3d5ab8 tests: increase delay 2023-10-13 14:25:02 +02:00
Zdenek Kabelac
061c008e15 tests: some minor enhancement of udev test
Reduce pgrep usage.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
53da646495 tests: fail tests when machine have suspended devs
If the machine has suspended devices present in the DM table,
it's better to fail the test.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
627535f33e tests: use function to restart dmeventd
Move restart to single function.
2023-10-13 14:25:02 +02:00
Bryn M. Reeves
0ff027ae2c dmstats: only generate aux data separator if group tag is defined
Fix a bug in _stats_set_aux() that causes bogus data to appear
in the 'userdata' field of stats reports when previously grouped
regions are ungrouped:

/var/tmp/File With Spaces: Created new group with 1 region(s) as group ID 0.

Removed group ID 0 on fedora-root

Name             GrpID RgID ObjType RgStart RgSize  #Areas ArSize  ProgID  UserData
fedora-root          -    0 region    6.39g 100.00m      1 100.00m dmstats #-
                                                                           ^^
This is the aux_data separator character followed by empty user data.
The _stats_set_aux() function should only emit the separator if
there is a valid group descriptor for the region.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
995c7b503b Add more dmstats integration tests
Add new tests for filemap, group/ungroup, histograms, precise timestamps
and userdata.
2023-10-12 11:31:14 +00:00
David Teigland
f20be398a1 device_id: refresh devname idnames if any are not found
Search for a PV on other devices if it's a devname entry
and the name doesn't exist on the system.  This restores
code that should not have been removed in commit 1901a47df
"device_id: fix conditions for device_ids_refresh"
2023-10-10 11:46:21 -05:00
Zdenek Kabelac
f960fe0578 tests: delay_dev to slowdown pvmove
throtling mirror device is becoming useless with faster CPUS,
as way to many data can be transferred before throttling steps-in.
So prefer using  dm-delay for test and keep throttling as fallback.
2023-10-06 10:51:15 +02:00
Zdenek Kabelac
2c3742039c tests: skip test if the memory cannot be allocated in kernel 2023-10-06 10:51:15 +02:00
Zdenek Kabelac
f5512315d2 tests: ignore failure from stop 2023-10-06 10:51:15 +02:00
Zdenek Kabelac
37329e4184 tests: add delay to let dmevent initalize
There is short time period needed to fully initilize dmeventd and
handle 'kill' signal.
2023-10-06 10:51:15 +02:00
Zdenek Kabelac
bccfd92f4a tests: previous patch wrongly replaced tab
Tab overwrote first char instead of insert.
Actually it should be a single function.
2023-10-05 01:11:54 +02:00
Zdenek Kabelac
ede63b5029 tests: more complex check for resize of reiserfs
Detection of how the command is supposed to behave actually depends on
the configure.h compilation and whether binary is compiled with
HAVE_BLKID_SUBLKS_FSINFO.

This makes it somewhat complicated in a way how to recognize which
behavior is expected.

Currently we can eventually recognize by checking error output
of some 'random' lvresize command and see if the --fs checksize is
actually recognized and rejected.  If this changes - test needs
to be updated.
2023-10-05 00:03:30 +02:00
Zdenek Kabelac
b80404f2c6 tests: utils use read without slash mangling
Do not use backslash as escape character for path.
2023-10-04 23:58:54 +02:00
Zdenek Kabelac
470f1058a8 tests: better coredump lookup
Some bash version may have problem with contruct:
done < <(

Replace it with array reading.
2023-10-04 23:58:54 +02:00
Zdenek Kabelac
e3adccb528 tests: retry removal
After umout we may race with system udevd rule - so
just retry once again after 1s sleep - that should be
enough - otherwise we would need some loop here...
2023-10-04 22:05:22 +02:00
Zdenek Kabelac
e72e130e9d tests: convert to heredoc string
Multi-line echo command are problemat across variety of bash version
and may have produce shorter results.
Convert to stable heredoc string with 'tab' skipping <<- for better
formating.
2023-10-04 22:05:22 +02:00
Zdenek Kabelac
8f61a127b5 tests: fix reader for runner
Since we now push more data into journal, parser reading this file
for --continue mode need to be adapted.
Also properly align batch mode with '.' for max test length name.
2023-10-03 21:32:12 +02:00
Zdenek Kabelac
0e8c631f5e tests: old g++ needs explicit cast 2023-10-03 12:59:38 +02:00
Zdenek Kabelac
c818f3dabc tests: give some more time to die
VMs are not top performers here...
2023-10-03 12:46:32 +02:00
Zdenek Kabelac
48fd6d6d40 tests: restore old fsync method
New code isn't portable across wider range of c++ compilers.
2023-10-03 12:46:32 +02:00
Zdenek Kabelac
6f52091668 tests: give dmeventd some time to restart
We need to wait for a new dmeventd as fork new daemon from bash.
2023-10-03 02:01:29 +02:00
Zdenek Kabelac
d01e9de8b8 tests: add RT_LIBS for older g++ 2023-10-03 02:01:29 +02:00
Zdenek Kabelac
13bf42b8b8 tests: restore fsync for runner
Restore fsync() call For more accurate tracking by buildbot.
Try different rather tricky way of static_cast to use
already opened FD instead of seperate open(),fsync(),close().

It's pretty strange there is no way to enforce fsync() for
C++ iostreams.  Flush() is actully not equal.
2023-10-03 01:58:23 +02:00
Zdenek Kabelac
36bccbc4f3 tests: skip some tests on valgrind run
Skip some tests that takes too much time with valgrind pass.
2023-10-03 00:02:46 +02:00
Zdenek Kabelac
3c70c243c5 tests: aux use dmsetup concise
A bit faster creation of multiple devices with dmsetup --concise.
Also solves the 'cookies' handling.
2023-10-03 00:02:02 +02:00
Zdenek Kabelac
19df4510c2 tests: faster creation of 200 PVs
Use already existing optmized aux version
2023-10-03 00:01:34 +02:00
Zdenek Kabelac
80899f7010 tests: runner compatible with older g++
Avoid using some constructs available with newer C++ only.
Moving timing into to journal instead of list file.
2023-10-03 00:00:01 +02:00
Zdenek Kabelac
ffaff7afa6 tests: better handling of system dir
Use more consistenly location of etc dir in tests.
Read value of etc dir via lvm cmd.
2023-10-02 14:25:52 +02:00
Zdenek Kabelac
e3cee67d77 tests: reiserfs needs fsadm
With plain -r we currenly issue an error message.
2023-10-02 14:25:52 +02:00
Zdenek Kabelac
368ab3051f tests: reduce slowing down of device
Too high value currently may result in occasional race problem with
device deactivation.
2023-10-02 14:25:52 +02:00
Zdenek Kabelac
529fe9ef75 tests: aux reuse already pgrep of dmeventd
Test already checks if there is any dmeventd running in the system
in the inittest.
2023-10-02 14:25:52 +02:00
Zdenek Kabelac
e3dd3424fc tests: enhance runner
Add Timespec class to increase time resolution to miliseconds
(can switch to microseconds if ever needed).
Use more const and const_interators and pass by reference.
Output rusage also to list result file.
Reduce inlining of C++ constructors.
2023-10-02 14:24:04 +02:00
David Teigland
88aa285a79 devices: refresh device ids if the system changes
If the system changes, locate PVs that appear on different devices,
and update the device IDs in the devices file.  A system change is
detected by saving the DMI product_uuid or hostname in the devices
file, and comparing it to the current system value.  If a root PV
is restored or copied to a new system with different devices, then
the product_uuid or hostname should change, and trigger lvm to
locate PVIDs from system.devices on new devices.
2023-09-27 15:22:11 -05:00
Zdenek Kabelac
cb8486a9b2 tests: check exit_on works 2023-09-26 01:24:38 +02:00
Zdenek Kabelac
984c024ef2 typos: misc 2023-09-19 14:54:51 +02:00
Zdenek Kabelac
c7c51329f4 tests: check pvmove with raid legs
Check pvmove correctly handles raid legs on input
(testing previous pvmove fix).
2023-09-19 14:54:51 +02:00
Zdenek Kabelac
970e4d295e tests: add fsck after split 2023-09-14 10:08:26 +02:00
Zdenek Kabelac
9d7061f1a3 tests: skip test when lvmdbusd runs on the system
lvmdbusd changes $RUNDIR results.
2023-09-14 01:45:34 +02:00
Zdenek Kabelac
f9d17f1f6d tests: update for work in fake dev environment
No write outside of $LVM_TEST_DIR  (removed /test access).
Use 'aux prepare_scsi_debug_dev' for automated scsi_debug handling
Properly use "" around shell vars.
Smarter read of PVS values.
Relax requirement to only work with real /dev dir.
2023-09-14 01:45:34 +02:00
Zdenek Kabelac
fac2e07333 tests: enforce full fs check 2023-09-14 01:45:34 +02:00
Zdenek Kabelac
fba81cf3e9 tests: pvmove large disk area
With some faster test hw machine we need to make this test
a bit more resource consuming.
2023-09-14 01:45:34 +02:00
Zdenek Kabelac
738c4b84fb tests: missing to check for writecache support
Ono more case requires writecache presence.
2023-09-14 01:45:34 +02:00
Zdenek Kabelac
de4cb219fb tests: aux using singl lvmconf call
lvmconf can handle multiple options in a single pass.
2023-09-14 01:45:34 +02:00
Zdenek Kabelac
4276c703c5 tests: aux try with extra sleep
Since udev_wait is not really adding any major delay to wait
for any udev worker processing - add extra sleep .1.
2023-09-14 01:45:34 +02:00
Zdenek Kabelac
1885655e9a test: improve aux teardown
Handle the case of device teardown where the first pass
could have only a single, but opened device, for removal.
In such case we want to at least once go through
the udev_wait and retry removal again.

TODO: maybe a sleep .1  might be usable as well with udev_wait
2023-09-13 13:38:15 +02:00
Zdenek Kabelac
5a44135233 tests: disable logging for lvmdbusd
Since lvmdbusd testing tends to do its own logging,
try for now to disable very generic logging mechnanism
of the test suite and see the result.

Some lvmdbusd test seems to rely on some log/file logic
which is modified with the use of these shell vars.
2023-09-04 18:52:02 +02:00