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

3141 Commits

Author SHA1 Message Date
Zdenek Kabelac
c1cecc3dc5 aux: lvmdbus checks for JSONDecodeError
Skip lvmdbus testing with too old python.
2023-02-23 16:46:35 +01:00
Zdenek Kabelac
d11e12264f tests: add missing quotes
Add quotes around paths and also add fixme for checking
system is actually usable for a test with all running
services.
2023-02-23 16:46:35 +01:00
Zdenek Kabelac
f5acdc2d79 tests: use aux mdadm wrapper
Wrapper takes care of proper MD device name around its various
incarnations.
2023-02-23 16:46:35 +01:00
Zdenek Kabelac
d7c4fb7743 tests: remove option chunk for mdadm raid1
Not sure why, but --chunk specification for mdadm raid1 is no longer
'wanted' ???
2023-02-23 16:46:35 +01:00
Zdenek Kabelac
6943afe9d5 tests: add fixme 2023-02-23 16:01:50 +01:00
Zdenek Kabelac
d5c0b68dde tests: some skips with 6.2 kernel
Fix did not managed to get to final release so skip test on this kernel.
2023-02-23 16:01:50 +01:00
Tony Asleson
993bd2ffc8 lvmdbustest: Check and remove lvm debug collection files
In setup/teardown ensure we check for and remove any lvm debug
collection, to prevent FS from filling up.
2023-02-20 12:01:53 -06:00
Zdenek Kabelac
13b216fbdf tests: safety first... 2023-02-17 00:08:50 +01:00
Zdenek Kabelac
1788b4b3aa tests: lvmdbus testing use --debug optinally now
To shorten down logging output of lvmdbus - use for now lvmdbus
with --debug option only when LVM_DEBUG_LVMDBUS=1 is set.
2023-02-17 00:08:50 +01:00
Zdenek Kabelac
06c5c29443 tests: check failing vdo conversion
When we detect not usable vdo on a machine, check lvconvert fails.
2023-02-17 00:08:50 +01:00
Zdenek Kabelac
8630a19d1e tests: use PWD for dbus testing
lvmdbusd ATM is leaking too many log files.
At least try to keep them removed with test failure.
2023-02-13 14:30:43 +01:00
Zdenek Kabelac
7ea62f640c tests: skip test without mkfs.ext4 2023-02-13 13:41:59 +01:00
Zdenek Kabelac
7d419b374a tests: reduce shellcheck warns
Reduce warnings in tests.
2023-02-10 17:50:27 +01:00
Zdenek Kabelac
773bc01377 tests: cleanup some shellcheck warns
Reduce shellcheck warnings about missing {} for possible array
dereference.

Make sure we are not loosing error code when assigning local vars
and explicitely ignore 'errors' from standalone lines when needed.

Add some missing quotes.

Use $() instead of ancient ``

Avoid writing some temporary data into /tmp - test need to store
files within its own 'testdir' - so it can be properly discarded.
2023-02-10 17:50:27 +01:00
Zdenek Kabelac
cc2293f18e tests: avoid using length
Use ${#  for length instead.
2023-02-10 17:50:27 +01:00
Zdenek Kabelac
30b9d4d4aa tests: remove blank line 2023-02-10 17:50:27 +01:00
Zdenek Kabelac
b29b8e0bb2 tests: fix cutandpaste bug in wrapper
Use correct variable name for assign.
2023-02-10 17:50:27 +01:00
David Teigland
be124ae810 vgimportclone: fix non-duplicate PV with non-unique basevgname arg
Fix hang of vgimportclone command when:
the PV(s) being imported are not actually clones/duplicates, and
the -n vgname arg is the same as the current vgname.

(Not the intended use of the command, but it should still work.)

In this case, the old and new vgnames ended up being the same, when
the code expected they would be different.  A file lock on both the
old and new vgnames is used, so when both flocks are on the same
file, the second blocks indefinitely.

Fix the new vgname to be the old name plus a numeric suffix, which
is the expected result.
2023-02-09 17:37:22 -06:00
David Teigland
dc99f0def1 device_id: ignore quotes in device id
A t10 wwid string was found containing a " character
which breaks vg metadata parsing.  Ignore any quotation
marks in device id strings.
2023-02-06 12:24:18 -06:00
David Teigland
5374a44c57 lvresize: fail early if mounted LV was renamed
If a mounted LV is renamed, then fs resizing utilities will fail,
so detect this condition and fail the command before any changes
are made.
2023-01-26 14:02:20 -06:00
David Teigland
3bb5576528 lvresize: only resize crypt when fs resize is enabled
There were a couple of cases where lvresize, without --fs resize,
was resizing the crypt layer above the LV.  Resizing the crypt
layer should only be done when fs resizing is enabled (even if the
fs is already small enough due to being independently reduced.)

Also, check the size of the crypt device to see if it's already
been reduced independently, and skip the cryptsetup resize if
it's not needed.
2023-01-19 11:52:14 -06:00
Zdenek Kabelac
aa09232dc4 tests: vdo resizing 2023-01-16 12:37:40 +01:00
lilinjie
bb34ebd4e4 fix typo
Signed-off-by: lilinjie <lilinjie@uniontech.com>
(cherry picked from commit 81b1f5bc3bac0e2e9099b67162da7d1a4995c5f4)
2023-01-11 13:52:12 +01:00
David Teigland
789904bd57 tests: vgimportclone with incomplete pv list and nomda pv 2023-01-05 14:47:49 -06:00
David Teigland
2580f007f0 tests: lvresize-fs-crypt using helper only for crypt dev 2023-01-03 14:35:26 -06:00
David Teigland
6613a61d3b device_id: fix segfault verifying serial for non-pv
The recent change that verifies sys_serial system.devices entries
using the PVID did not exclude non-PV devices from being checked.
The verification code would attempt to use du->pvid which was null
for the non-PVs causing a segfault.
2022-12-02 12:25:10 -06:00
Tony Asleson
61917fbac2 lvmdbustest: Add test to ensure error collection
Recreates https://bugzilla.redhat.com/show_bug.cgi?id=2145114
2022-11-29 12:56:55 -06:00
David Teigland
2da4ca7ce1 tests: devicesfile-vpd-ids add nvme wwid 2022-11-21 10:57:30 -06:00
Zdenek Kabelac
0fed9b0971 tests: update test to handle different status
Since now we change deduplication with V4 table line change,
the modification tends to be faster and we can capture for a few ms
also 'status' about opening or closing deduplication index.
Use 'grep -E' to handle both words.
2022-11-08 11:10:21 +01:00
David Teigland
761b922178 device_id: handle duplicate serial numbers
Handle multiple devices using the same serial number as
their device id.  After matching devices to devices file
entries, if there is a discrepency between the ondisk PVID
and the devices file PVID, then rematch devices to
devices file entries using PVID, looking at all disks
on the system with the same serial number.
2022-11-07 08:56:02 -06:00
Tony Asleson
736547e7bb lvmdbustest: Add test for copy signature
Add test to ensure we detect when a PV signature is copied to a block
device.
2022-10-20 15:10:35 -05:00
Tony Asleson
5a6ae2d4d8 lvmdbustest: Add test for wipefs
Ensure that if an external program or user calles wipefs on a PV that we
correctly update the state of the daemon.
2022-10-20 15:10:35 -05:00
David Teigland
f6f2737015 lvreduce: require active LV when no fs option is used
Without an --fs option set, make lvreduce of an inactive LV
fail and report that the LV must be active.
2022-10-11 12:48:31 -05:00
David Teigland
fc52e87f06 tests: add comments to fsadm-renamed
to explain the what and why of the steps that are
not obvious
2022-10-11 12:48:31 -05:00
David Teigland
fc01dd8900 tests: skip lvresize tests without mkfs.xfs 2022-10-10 13:25:50 -05:00
David Teigland
c4e6d675de tests: device ids using vpd data 2022-10-10 11:47:29 -05:00
Tony Asleson
599cbd7dd3 lvmdbusd: Correct env. variable
Make this match the unit test expectation and the form we use for
other env. variables.
2022-09-30 11:51:23 -05:00
Tony Asleson
fd05b79aad lvmdbustest: Add test to stress mode changing
Add a test to toggle from fork & exec to lvm shell repeatedly, to stress
test it.
2022-09-22 17:14:10 -05:00
Tony Asleson
897b326ccc lvmdbustest: Re-work setUp
Place the addCleanup at the end as we don't want to go through clean up
if we don't make it through setUp.  If we don't do this we can remove VGs
that we didn't create in the unit test.
2022-09-22 17:10:13 -05:00
Tony Asleson
7966f1dd18 lvmdbustest: Refuse to remove a VG we didn't create
One of our previous commits introduced the side effect that we could
inadvertently remove a VG we didn't create, and lose data.
2022-09-22 16:19:16 -05:00
Tony Asleson
40018cbf53 lvmdbustest: Make vg name suffix more unique 2022-09-22 16:17:20 -05:00
Zdenek Kabelac
3a7aeebf7d tests: validate CONFIG_HZ_1000
If we plan to use dm throttling for mirror targets - we actually
have to check whether kernel runs with CONFIG_HZ_1000 - if it does
not the whole idea of throttling is actually not working in the
testsuite as within a single 'tick' with HZ 100 way too much date
is being moved on any modern hardware - and since there is no plan
to change this in kernel - we simply avoid using throttling on such
kernel and test needs to work differently - either ignore results
or use much larger mirror sizes...
2022-09-21 14:58:34 +02:00
Zdenek Kabelac
96f303eb08 tests: discard update 2022-09-21 14:58:34 +02:00
Zdenek Kabelac
1bf1aca544 tests: integrity switch to ext4
Since we would need to create a lot of 300M filesystem,
switch this test suite to ext4.
2022-09-21 14:58:34 +02:00
Tony Asleson
3d3c517b0b lvmdbustest: Add wrapper for injecting errors
Useful for forcing lvmdbusd down error paths.
2022-09-16 10:49:37 -05:00
Tony Asleson
a326e35cda lvmdbustest: Check for self.pvs
If we don't make it through setUp, self.pvs will not exist.
2022-09-16 10:49:37 -05:00
Tony Asleson
ead80d134d lvmdbustest: Move signals to last
When we do the signal testing we default back to fork & exec.  Put these
on the end to maximize our lvm shell testing until we fix this proper.
2022-09-16 10:49:37 -05:00
Tony Asleson
b6dc96d8ef lvmdbustest: Utilize addCleanup in unit test
Register the clean up with addCleanup so we ensure clean_up gets run
regardless of what happens in setUp.
2022-09-16 10:49:37 -05:00
Tony Asleson
f5876a1f3f lvmdbustest: Skip test_nesting if scan_lvs is not enabled 2022-09-16 10:49:37 -05:00
Tony Asleson
f65f7da760 lvmdbustest: Skip test_singleton_daemon running systemd svc. 2022-09-16 10:49:37 -05:00