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

2928 Commits

Author SHA1 Message Date
Zdenek Kabelac
7575c7ae5c tests: set known locking dir
Tests running in the system may use locking dir of the system.
2021-03-23 01:15:29 +01:00
Zdenek Kabelac
077040199d tests: remove unused wait_md_create 2021-03-22 22:51:24 +01:00
Zdenek Kabelac
7166bbd9c2 tests: avoid sleep on kill path
Before sleeping, check if pid is still there.
2021-03-22 22:51:24 +01:00
Zdenek Kabelac
a7d7471906 tests: convert to use mdadm_create
Flip usage from prepare_md_dev to mdadm_create.
2021-03-22 22:50:36 +01:00
Zdenek Kabelac
b1483dcbac tests: more usage of new aux mdadm_create
Condense tests and use the new mdadm_create.
2021-03-22 22:49:11 +01:00
Zdenek Kabelac
76d203517b tests: use mdadm support
Use for testing new mdadm_create  aux wrapper.
Place functionality into a 2 pass loop - one for 'auto' other for 'start'.
Share same tests between raid level 0 and level 1 version of raid.
2021-03-22 22:46:21 +01:00
Zdenek Kabelac
ada99f939f tests: new aux mdadm_create
Add generic wrapper for mdadm --create which takes
normal 'mdadm' args - but allows us to handle differences of
mdadm usage across various version of mdadm tool.

Resulting MD device is availalble in  $(< MD_DEV).

Automatic cleaning is made through   cleanup_md_dev

Calling of mdadm_create cleans previous MD dev if it exists.
2021-03-22 22:42:52 +01:00
Zdenek Kabelac
77432ee137 tests: remove local changes
Use aux for preparing profile.
Avoid playing with LVM_BINARY localy - we already
preset this variable in lib/utils.
2021-03-22 22:36:37 +01:00
Zdenek Kabelac
daca6e2c22 tests: even more aggressive throttling
Try if the test gets slowed down with slower mirroring (1)
or we would need something better to beat the race.
2021-03-22 22:36:37 +01:00
Zdenek Kabelac
bee8027cfa tests: skip only portion of test
Seems this kernel bug is taking more time to get it fixed,
so skipping only failing portion of test and ending with WARNING.
2021-03-22 22:36:37 +01:00
Zdenek Kabelac
8d2ad4419a tests: more system defaults for installed tests
When testing installed binaries on system, use more 'built-in'
predefined settings to usethem with their  compiled-in values.

Also it's better to use same locking dir so the system's pvscan
is not unexpectedly interferring with test commands.
2021-03-22 22:36:37 +01:00
Zdenek Kabelac
f1858d209d tests: remove incorrect check
We would need to be check same status value - otherwise
we can hit race in validating 2 different states.
2021-03-22 22:36:37 +01:00
Zdenek Kabelac
d6bc11bf72 tests: use mirror throttling
With small mirrors its better to throttle speed of mirror in dm-mirror.
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
2dd43a7314 tests: slow down device more
Make the race with too fast merging less likely to occure.
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
94c4af232c tests: prohibit 4K brd device with integrity
Older kernels hit these errors:

device-mapper: integrity: Bio not aligned on 8 sectors: 0x8ffc, 0x4
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
179f59a0ca tests: add FIXME to raid test
We have here some kind of catch-22 - since older kernels do
use 'resync' while new 'recover' for initial raid synchronization.

So now - how do we recognize in which state of raid we are.
ATM seems to be simplest to simply keep disabled droping of primary raid
leg unless we are in sync.

FIXME: we should add a target version check and enable removal
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
edcc410835 tests: fix condition for exclusion of /dev 2021-03-20 00:28:13 +01:00
Zdenek Kabelac
d5b37f24f4 tests: aux reject /dev as testing dir
If LVM_TEST_DIR would be set to /dev, reject such selection.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
e27baa791f tests: drop status workaround
lvconvert should now recognize resync from older kernels.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
ed90a3d9b4 tests: copy more data
Give pvmove --abort bigger aborting window.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
fe3ef6867f tests: require newer raid version
Tests needs reshape support - so require newer target version
as quick fix.

TODO: inspect indiviual supportable conversion with older versions.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
26fb6b5e8d tests: check for raid sync in progress
TODO: this needs to be built-in in lvm command itself.
2021-03-18 19:12:00 +01:00
Zdenek Kabelac
accf324ccb tests: add check for lvconvert without zeroing
Check lvconvert -Zn does not zero thin-pool metadata.
Also check --type zero is usable for thin-pool data.
2021-03-18 18:57:45 +01:00
Zdenek Kabelac
c06325263f tests: check mixing striped with error and zero 2021-03-18 18:57:45 +01:00
Zdenek Kabelac
1880b573f3 tests: aux always shift emulated devices by 1MiB
Always shift created virtual PVs on backing device by 1MiB
and leave 1MiB free space at the end of device.

This way the system doesn't see same PV headers at multiple devices.
2021-03-18 18:57:45 +01:00
Zdenek Kabelac
583cf413d5 tests: avoid leaking unkilled commands
Between each new test here we want to kill previous commands,
otherwise they will influence results of next test.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
fda7bc1297 tests: wait for Aa status 2021-03-17 00:59:50 +01:00
Zdenek Kabelac
80d0f200d0 tests: increase version of targets for progress 2021-03-17 00:59:50 +01:00
Zdenek Kabelac
e793ff1e18 tests: workaround for some raid targets
Problem with some target is that shortly after initialization it
returns incorrect status letters.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
db37905d7f tests: no further fixes likely to be expected
Skip tests for these kernels.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
87659256f0 tests: require newer version of raid target 2021-03-17 00:59:50 +01:00
Zdenek Kabelac
92ee16f7c0 tests: update mirror test
Log results of uniq.
Remove few unneeded lvs calls.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
53bad89a7b tests: added check for kernel version
With older kernels this test can't work reliable,
since 'suspend' used to clean all dirty blocks
(taking even several seconds).
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
b4a74d1008 tests: add test for merging
Check we handle mething of thin snapshot that is itself thick snapshot
origin.
Also use  lvpoll to better wait for finish of merging.
2021-03-15 11:13:24 +01:00
Zdenek Kabelac
800a93d4ac tests: wait till fs is synchronized
Adding full filesystem sync, trying to fight with strange error from losetup:

losetup: loopa: failed to set up loop device: Resource temporarily unavailable

loop0: detected capacity change from 0 to 4096
loop_set_block_size: loop0 () has still dirty pages (nrpages=13)

Also reuse internal aux wipefs_a
2021-03-15 11:13:24 +01:00
Zdenek Kabelac
78406ef617 tests: update handling of thin-pool removal
We shall no longer activate thin-pool, when
it's going away together with all thin volumes.
2021-03-15 11:13:24 +01:00
Zdenek Kabelac
e5e957e330 shellcheck: avoid assign warnings
Shellcheck seems to be happier when assigning variables with quotes.
2021-03-15 11:13:24 +01:00
Wu Guanghao
262008f1ce unit-test: modify for systems with PGSIZE of 64K
This modification supports dynamically obtaining the value of PAGE_SIZE,
which is compatible with systems with PAGE_SIZE of (4K/64K)

Signed-off-by: wuguanghao <wuguanghao3@huawei.com>
2021-03-11 00:56:43 +01:00
Zdenek Kabelac
4bbaff1fa6 tests: settle after wiping
Add call to settle after wiping device so there is reduced
change to meet watch rule race during tests.
2021-03-11 00:18:01 +01:00
Marian Csontos
d4293b579d tests: Skip test killing kernel
Fix the pattern and for now skip all RHEL-8.4 kernels

Bug 1916891
2021-03-10 16:31:04 +01:00
David Teigland
d5f3239de4 tests: check_devicesfile
make check_devicesfile T=...

(A number of tests should probably get a new
SKIP_WITH_DEVICES_FILE.)
2021-03-08 17:19:26 -06:00
Zdenek Kabelac
8d3ce32880 tests: make test complaint to local dev dir
For test running in 'local' dev dir we want to see loop devices there.
Also add missing notification to lvmetad after wipefs.
2021-03-02 22:24:51 +01:00
Zdenek Kabelac
7528a33630 tests: update setting LVM_BINARY for testing
When testing is running on uninstealled system - prefer our own binary
in tests.
2021-03-02 22:24:51 +01:00
David Teigland
aa34da6ecc Revert "tests: enable tests for lvmlockd"
This reverts commit 99b6173f10.

These tests are disabled with lvmlockd because they use
snapshots without an origin which is not permitted in a
shared vg.
2021-02-24 10:30:51 -06:00
David Teigland
6fad7f2eac tests: real_devs remove mistakenly added test
devicesfile-realdevs is the correct one
2021-02-24 10:21:18 -06:00
David Teigland
b36b4b82d8 tests: for devices file 2021-02-23 16:43:38 -06:00
David Teigland
135c226e26 tests: allow tests to use real devices
user creates a file listing real devices they want
lvm tests to use, and sets LVM_TEST_DEVICE_LIST.
lvm tests can use these with prepare_real_devs
and get_real_devs.
Other aux functions do not work with these devs.
2021-02-23 16:43:37 -06:00
Zdenek Kabelac
e43b5f1e3c tests: remove local setting of LVM_BINARY
To better test actually fsadm in test suite - avoid setting
LVM_BINARY locally - since test setup already modifies
PATH to find test's lvm binary as the 1st. in path.
2021-02-23 14:56:47 +01:00
Marian Csontos
3cba071254 tests: Skip test killing kernel
Bug 1916891
2021-02-17 13:28:56 +01:00
Zdenek Kabelac
b9846bdc3e tests: readonly snapshot thick origin can't be merged
When user sets snapshot thick origin as read-only - lvconvert --merge refuses
to merge until user swiches origin to 'read-write'.
2021-02-17 11:53:19 +01:00
Zdenek Kabelac
fbaf5a32bb tests: lvconvert vdo profile support 2021-02-17 11:53:19 +01:00
Zdenek Kabelac
19e1373580 tests: check resize of cached vdopool 2021-02-17 11:53:18 +01:00
Zdenek Kabelac
3ef0861355 tests: lvdisplay does not crash for merged thin 2021-02-17 11:21:35 +01:00
Zdenek Kabelac
3af61d8646 tests: lvconvert thin profile conversion 2021-02-17 11:21:35 +01:00
Zdenek Kabelac
6373f39092 tests: check event_activation can be disabled 2021-02-08 23:43:38 +01:00
Zdenek Kabelac
b86eb913c1 tests: support for resized cached LVs
Support for cached LVs is now enabled.
2021-02-08 23:43:38 +01:00
David Teigland
87ee401eea md component detection changes
Move extra md component detection into the label scan phase.
It had been in set_pv_devices which was deep within the vg_read
phase, which wasn't a good place (better to detect that earlier.)
Now that pv metadata info is available in the scan phase, the pv
details (size and device_hint) can be used for extra md checking.

Use the device_hint from the pv metadata to trigger a full md
component check if the device_hint begins with /dev/md.

Stop triggering full md component checks based on missing
udev info for a dev.

Changes to tests to reflect that the code is now detecting
md components in some test case that it wasn't before.
2021-02-05 16:23:51 -06:00
David Teigland
cb54d0801d cachevol: allow forced detaching of damaged or invalid cachevol
A cachevol can be forcibly detached when it's missing devices.
Also allow this if it's damaged/invalid and unrepairable.
This would be needed to recover data from the origin LV after
a cachevol is lost or damaged beyond repair.
2021-02-02 14:31:23 -06:00
Zdenek Kabelac
ae2af1d5ed test: check read_only_volume_list tagging works 2021-02-02 21:23:39 +01:00
David Teigland
8454ce66c5 writecache: let block_size setting override device block sizes
In cases where lvconvert does not detect a fs block size on the
device, it falls back to choosing a writecache block size based
on the device's LBS and PBS (tries to match those.)

If the user specifies a writecache block size on the command
line (--cachesettings block_size=4096|512), lvconvert currently
fails and reports an error if the user-specified value does not
match the value lvconvert would have chosen based on LBS and PBS.

The purpose of allowing a user-specified value on the command line
is to override what lvconvert would otherwise do, so change this
to just print a warning that the user value does not match the
value that would be chosen based on the LBS/PBS, and then take
the user-specified value as the writecache block size.
2021-02-02 13:52:31 -06:00
Zdenek Kabelac
48dfc388f7 tests: increase required target version
Require 1.7.0 for raid0.
2021-02-01 20:10:07 +01:00
Zdenek Kabelac
6e8a32e4fd tests: avoid killing test machines with kernel bug
Bug 1916891  still applies:

https://bugzilla.redhat.com/show_bug.cgi?id=1916891
2021-02-01 15:02:38 +01:00
Zdenek Kabelac
bfafd2b4e9 tests: check for raid target support 2021-02-01 15:01:04 +01:00
Zdenek Kabelac
25b942a8ac aux: update thin_restore_needs_more_volumes
Version 0.8.5-2.el7 needs to return 0;
2021-02-01 12:13:49 +01:00
Zdenek Kabelac
b26e565ee5 tests: check for cache support presence 2021-02-01 12:13:49 +01:00
Zdenek Kabelac
19ddad12ca tests: update thin and cache checked messages
Slightly changed messages for allocation of pool metadata.
2021-02-01 12:13:49 +01:00
Zdenek Kabelac
b17b556e26 tests: check 16G thin pool metadata size 2021-02-01 12:13:49 +01:00
Heinz Mauelshagen
f08ef23856 lvdisplay: enhance LV status output for raid(0)
In case legs of a raid0 LV are removed, the lvdisplay command still
reports 'available' though raid0 is not providing any resilience
compared to the other raid levels.

Also lvdisplay does not display '(partial)' in case of missing raid0
legs as oposed to the lvs command.

Enhance lvdisplay to report "NOT available" for any RaidLV type in case
too many legs are inaccessible hence causing data loss.  I.e. any leg
for raid0, all for raid1, more than 1 for raid4/5, more than 2 for raid6
and in case of completely lost mirror groups for raid10.

Add test/shell/lvdisplay-raid.sh.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1872678
2021-01-27 16:56:22 +01:00
Zdenek Kabelac
cddeaed6e9 tests: check support for online vdo rename
kvdo 6.2.3 module version supports online rename.
Add cache and raid stacked renames.
2021-01-22 15:30:37 +01:00
David Teigland
37227b8ad6 devs: remove invalid path name aliases
Make dev_cache_get() verify aliases and drop any
that are invalid before returning a dev for a given
name.
2021-01-15 16:31:50 -06:00
Zdenek Kabelac
ff1324d595 tests: check full zeroing of thin-pool metadata
Check zeroing works on whole thin-pool metadata device.
2021-01-13 12:54:45 +01:00
Zdenek Kabelac
71162b2b4e tests: check thin-pool corner case allocs 2021-01-13 12:54:45 +01:00
David Teigland
e9503f257a lvconvert: chunksize option was missing with cachedevice 2021-01-07 13:30:48 -06:00
David Teigland
b84a9927b7 partial flag for writecache and integrity
When a writecache sublv or an integrity metadata sublv
are partial (missing a dev), set the partial flag on
the upper level LV also, as is done for other sublvs.
2020-12-11 16:25:25 -06:00
David Teigland
5dbe2fdd9d writecache: fix uncache for two step detach
Fix the two-step writecache detach in commit c32d7fed4f.
In the case of uncache, the cachevol is removed after
detaching the writecache.  When the detach is finished
in the second step, the remove must wait until then.
2020-12-10 15:42:01 -06:00
Zdenek Kabelac
57594fe673 tests: few more fsadm checks 2020-12-08 20:32:34 +01:00
David Teigland
1cc75317f9 tests: integrity mismatch checks for all raid levels
Verify that corruption is corrected for raid levels other
than raid1.  For other raid levels, attempt to corrupt the
given file pattern on each underlying device, since we don't
know which device contains the file being corrupted.
This ensures that corruption is actually be introduced
when testing the other raid levels.

Verify that corruption is being corrected by checking
the integritymismatches count is non-zero for the raid LV,
which includes the total from all images (since we don't
know which image will have the corruption.)
2020-11-11 15:13:46 -06:00
David Teigland
2317ba3934 tests: update integrity tests
simplified the method of corrupting data, the old method
was not working reliably.  moved syncation tests to a
different file
2020-11-10 17:41:04 -06:00
David Teigland
125da10d47 Revert "tests: revert lvm shell use in pvck-dump"
This reverts commit 05d23b2dd8.

this required enabling editline in configure
2020-10-28 16:45:04 -05:00
David Teigland
05d23b2dd8 tests: revert lvm shell use in pvck-dump
doesn't work on my machine
2020-10-27 15:44:56 -05:00
David Teigland
020d1edaa0 writecache: disallow partial or degraded activation
when either main or fast lvs are incomplete
2020-10-26 15:48:58 -05:00
David Teigland
830c20d33c lvchange: allow syncaction check with integrity
syncaction check will detect and correct integrity checksum mismatches.
2020-10-26 14:16:33 -05:00
Zdenek Kabelac
e793f34eb7 tests: minor update 2020-10-26 13:06:52 +01:00
Zdenek Kabelac
be94410446 tests: fsadm test continue after fs repair
Test case where filesystem has been corrected via fsck.
In such case fsck returns '1' as success and should be
handled in a same way as '0' since fs is correct.
2020-10-24 01:42:16 +02:00
David Teigland
f3b723cd8d pvscan: rework to improve PVs without metadata
Restructure the pvscan code, and add new temporary files
that list pvids in a VG, used for processing PVs that
have no metadata.

The new temp files, in /run/lvm/pvs_lookup/<vgname>, allow a
proper pvscan --cache to be done on PVs that have no metadata.
pvscan --cache <dev> is only supposed to read <dev>, but when
<dev> has no metadata, this had not been possible.  The
command had to fall back to scanning all devices to read all
VG metadata to get the list of all PVIDs needed to check for
a complete VG.  Now, the temp file can be used in place of
reading metadata from all PVs on the system.
2020-10-22 13:14:31 -05:00
David Teigland
83d0818523 tests: writecache-misc disable with lvmlockd
in a shared vg pvmove requires a named lv
2020-10-21 12:47:28 -05:00
Zdenek Kabelac
6be29e1179 tests: check dmevent with bigger reserved_stack
Check dmeventd remains working when reserved_stack
is above 300KiB.
2020-10-20 22:28:58 +02:00
Zdenek Kabelac
d2bdad28d1 tests: extend area covered by error target
Since 'BLKZEROOUT' streams out more block at once, at can easily
zero-out larger set of blocks after 1st. failing one.

So the test is adapted to fully 'hide' swap header under error target.
2020-10-19 16:53:18 +02:00
Marian Csontos
53db14171c Revert "tests: Adapt RAID test to changes"
The cpnversion of degraded RAID should still report a failure.

This reverts commit e12bdd591a.
2020-10-13 13:15:16 +02:00
Zdenek Kabelac
99b6173f10 tests: enable tests for lvmlockd 2020-10-02 22:27:00 +02:00
Zdenek Kabelac
5e26a2b74d tests: aux hides zero and error device
When ERR_DEV and ZERO_DEV are used, they are automatically
taken down when the last user no longer needs them,
so hide them from 'forgotten' device check.
2020-10-02 22:27:00 +02:00
Zdenek Kabelac
8d9b4c624f tests: rename shown debug trace
As there could be few invokes of stacktrace, avoid
repeatedly display logs from commands.
So after first display rename  debug.log* -> debug_log
so the file still can remain for reading in test dir.
2020-10-02 22:27:00 +02:00
David Teigland
ff3945777b tests: enable writecache test that uses cleaner 2020-10-01 11:33:02 -05:00
Marian Csontos
46e5908759 test: grep -q may fail and it does
The script runs with pipefail, grep -q exits immediately sending SIGPIPE
to lvm segtype which fails whole pipe.
2020-10-01 11:33:57 +02:00
Zdenek Kabelac
af8044da3a tests: thin-flags 2020-09-29 10:43:56 +02:00
David Teigland
fb96e9ab21 tests: add case for metadata checksum differences
Cover the case where two copies of metadata have the
same seqno but different checksums.  Also elaborate
on an existing fixme in the code for this case, since
we should be doing something better for this case.

This had been uncovering an issue with reopening
fds in readwrite mode.
2020-09-28 13:25:57 -05:00
Zdenek Kabelac
bbc164991a tests: add small delay
Prevent there is no i.e. udev trying to open our device.
2020-09-25 22:59:35 +02:00
Zdenek Kabelac
a89ac3bf6f tests: also add thick snap of thin volume 2020-09-25 22:59:35 +02:00
Zdenek Kabelac
ccb58c109f tests: check some common errors
Collect some cases users are hitting when working
with thin-pools which has mismatching kernel metadata content with
lvm2 metadata.
2020-09-25 22:59:35 +02:00
Zdenek Kabelac
3e003320a7 tests: vgsplit of vdo volumes 2020-09-25 22:59:35 +02:00