summaryrefslogtreecommitdiff
path: root/test/lib
Commit message (Collapse)AuthorAgeFilesLines
* aux: retry brd removalZdenek Kabelac2023-05-061-9/+14
| | | | | | Try to remove brd twice if there is some collision with udevd. Instanciate only 1 ramdisk. Use just 'eval' for '--nameprefixes' results.
* aux: wipefs_a takes list of devicesZdenek Kabelac2023-05-061-24/+24
| | | | | | | Enhance function to take list of device so set of devices can be wiped with a single call: aux wipefs_a "$dev1" "$dev2"
* tests: adapt waiting for pvmove startZdenek Kabelac2023-04-251-5/+0
| | | | | | Previous commit cause the pvmove could actually be started in unexpected order - so make sure, we are not starting new pvmove in same VG until the previous one is started.
* tests: utils now print also df_hZdenek Kabelac2023-04-251-4/+8
| | | | | | Add info about space usage on devices after the test. Add some more skipped dirs.
* tests: some aux correctionsZdenek Kabelac2023-04-251-6/+7
| | | | | | | Keep backups within test_dir instead of dev_dir (so it doesn't leak large files there if the tests are run over real /dev dir). Move restoring of dm_mirror throttling before test_dir is removed.
* tests: try to retry remove of scsi_debugZdenek Kabelac2023-04-251-1/+6
| | | | | | Not quite sure if this helps anything, some of testing machines can't reliably remove scsi_debug, reporting they are in use - but it's not easily reproducible...
* tests: handle multiple devs with wait_pvmove_lv_readyZdenek Kabelac2023-04-251-26/+25
| | | | | | | | | aux wait_pvmove_lv_ready() now handles multiple pvmove LVs at one go - which allows a bit fast checking - although at some point we may need to switch to use delayed devs since mirror throttling seems to be no longer working well, as CPU are getting so fast, that most of data are already pvmoved before throttling has any chance to do something...
* aux: use unused brd device for testingZdenek Kabelac2023-04-251-0/+3
| | | | | | | | | | | When 'brd' device can be removed (is unused AKA not opened), remove such device and use again for testing. Let's assume user has no unused brd device left in the system. When the 'tests' sometimes fail to cleanup devices, with this change futher cleanup from some next test may evenually release brd device and make it available for testing.
* aux: more efficient lvmlock shutdownZdenek Kabelac2023-04-251-6/+2
|
* aux: loop doesn't support zeroing discardZdenek Kabelac2023-04-231-0/+1
| | | | | To avoid logging unsupported WRITE_ZEROES with loop, disable usage for this backend device.
* tests: hide some more file in error traceZdenek Kabelac2023-04-221-1/+2
| | | | Hide unneeded dev nodes.
* aux: don't use to new dd optionsZdenek Kabelac2023-04-211-2/+2
| | | | | Actually oseek comes only with rawhide's version, just use the standard option name.
* aux: add wait_recalcZdenek Kabelac2023-04-211-0/+25
| | | | Share function across tests.
* aux: add corrupt_devZdenek Kabelac2023-04-211-0/+19
| | | | | | | Add function to corrupt some bytes in give file path presenting a device. 1st. patern in just once replaced with 2nd. pattern. Usable to simulate some bit corruption for integrity devices.
* aux: add clear_devZdenek Kabelac2023-04-211-0/+36
| | | | | Function that will use 'blkdiscard -z' and fallbacks to 'dd' when such option is not available.
* aux: lvmdbus checks for JSONDecodeErrorZdenek Kabelac2023-02-231-0/+1
| | | | Skip lvmdbus testing with too old python.
* tests: lvmdbus testing use --debug optinally nowZdenek Kabelac2023-02-171-1/+3
| | | | | To shorten down logging output of lvmdbus - use for now lvmdbus with --debug option only when LVM_DEBUG_LVMDBUS=1 is set.
* tests: cleanup some shellcheck warnsZdenek Kabelac2023-02-103-26/+32
| | | | | | | | | | | | | | | 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.
* tests: avoid using lengthZdenek Kabelac2023-02-101-1/+1
| | | | Use ${# for length instead.
* tests: fix cutandpaste bug in wrapperZdenek Kabelac2023-02-101-1/+1
| | | | Use correct variable name for assign.
* fix typolilinjie2023-01-111-1/+1
| | | | | Signed-off-by: lilinjie <lilinjie@uniontech.com> (cherry picked from commit 81b1f5bc3bac0e2e9099b67162da7d1a4995c5f4)
* tests: validate CONFIG_HZ_1000Zdenek Kabelac2022-09-211-0/+10
| | | | | | | | | | | 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...
* tests: no caching for blkid in testingZdenek Kabelac2022-09-071-1/+1
|
* tests: vdo emulation without vdo binaryZdenek Kabelac2022-09-071-1/+1
| | | | | Avoid inserting 'vdo' binary into path - and use alias and VDO_BINARY shell vars for emulation.
* tests: skip running tests for non root userZdenek Kabelac2022-06-071-0/+6
| | | | | Testing needs 'root' privileges. Only 'make run-unit-test' can work without them.
* tests: add lvm_vdo_wrapperZdenek Kabelac2022-06-071-0/+353
| | | | | | | | | | | | Introduce a replacement vdo manager wrapper for testing. When using test suite on a system without vdo manager (which has got deprecated) - we still need its functionality to prepare 'vdo volume' for testing lvm_import_vdo. Wrapper currently need 2 binaries from older 'vdo 6.2' package - to be named: oldvdoformat - format VDO metadata with older format oldvdoprepareforlvm - shift vdo metadata by 1MiB
* cov: ignoringZdenek Kabelac2021-09-271-0/+1
|
* shellcheck: warning enhancementsZdenek Kabelac2021-09-211-2/+2
|
* tests: a bit more fancy way to initialized structZdenek Kabelac2021-09-201-1/+1
| | | | Older g++ is not smart enough to figure this out, so add a bit more push.
* cov: mask some warning about leakageZdenek Kabelac2021-09-201-0/+1
| | | | Mask false-positive leak report.
* cov: ignore syscallZdenek Kabelac2021-09-202-19/+19
|
* cov: validate syscall resultZdenek Kabelac2021-09-202-2/+7
|
* cov: capture runtime exceptionZdenek Kabelac2021-09-201-1/+5
|
* cov: better defined constructorsZdenek Kabelac2021-09-201-3/+5
| | | | | Ensure C++ initializes all struct members. Also some deterministic buffer initialization.
* tests: remove all debug logs when using dieZdenek Kabelac2021-09-061-1/+1
| | | | | Since die is called from a shell script, there is no need to report any recent lvm2 command debug traces.
* tests: adjust for check_devicesfileDavid Teigland2021-08-202-13/+40
|
* tests: multi-hosts: Add VG testingLeo Yan2021-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | | This patch is to add VG testing on multi hosts. There have two scripts, the script multi_hosts_vg_hosta.sh is used to create VGs on one host, and the second script multi_hosts_vg_hostb.sh afterwards will acquire global lock and VG lock, and remove VGs. The testing flow verifies the locking operations between two hosts with lvmlockd and the backend locking manager. On the host A: make check_lvmlockd_idm \ LVM_TEST_BACKING_DEVICE=/dev/sdj3,/dev/sdk3,/dev/sdl3 \ LVM_TEST_MULTI_HOST=1 T=multi_hosts_vg_hosta.sh On the host B: make check_lvmlockd_idm \ LVM_TEST_BACKING_DEVICE=/dev/sdj3,/dev/sdk3,/dev/sdl3 \ LVM_TEST_MULTI_HOST=1 T=multi_hosts_vg_hostb.sh Signed-off-by: Leo Yan <leo.yan@linaro.org>
* tests: Add testing for lvmlockd failureLeo Yan2021-06-031-1/+2
| | | | | | | | | | | | | | | | | After the lvmlockd abnormally exits and relaunch the daemon, if LVM commands continue to run, lvmlockd and the backend lock manager (e.g. sanlock lock manager or IDM lock manager) should can continue to serve the requests from LVM commands. This patch adds a test to emulate lvmlockd failure, and verify the LVM commands after lvmlockd recovers back. Below is an example for testing the case: # make check_lvmlockd_idm \ LVM_TEST_BACKING_DEVICE=/dev/sdo3,/dev/sdp3,/dev/sdp4 \ LVM_TEST_FAILURE=1 T=lvmlockd_failure.sh Signed-off-by: Leo Yan <leo.yan@linaro.org>
* tests: Support idm failure injectionLeo Yan2021-06-031-0/+55
| | | | | | | | | | | | | | | When the drive failure occurs, the IDM lock manager and lvmlockd should handle this case properly. E.g. when the IDM lock manager detects the lease renewal failure caused by I/O errors, it should invoke the kill path which is predefined by lvmlockd, so that the kill path program (like lvmlockctl) can send requests to lvmlockd to stop and drop lock for the relevant VG/LVs. To verify the failure handling flow, this patch introduces an idm failure injection program, it can input the "percentage" for drive failures so that can emulate different failure cases. Signed-off-by: Leo Yan <leo.yan@linaro.org>
* tests: Add checking for lvmlockd logLeo Yan2021-06-031-0/+5
| | | | | | | Add checking for lvmlockd log, this can be used for the test cases which are interested in the interaction with lvmlockd. Signed-off-by: Leo Yan <leo.yan@linaro.org>
* tests: Cleanup idm context when prepare devicesLeo Yan2021-06-031-6/+23
| | | | | | | | For testing idm locking scheme, it's good to cleanup the idm context before run the test cases. This can give a clean environment for the testing. Signed-off-by: Leo Yan <leo.yan@linaro.org>
* tests: Support multiple backing devicesLeo Yan2021-06-031-3/+28
| | | | | | | | | | | | | | | | | | In current implementation, the option "LVM_TEST_BACKING_DEVICE" only supports to specify one backing device; this patch is to extend the option to support multiple backing devices by using comma as separator, e.g. below command specifies two backing devices: make check_lvmlockd_idm LVM_TEST_BACKING_DEVICE=/dev/sdj3,/dev/sdk3 This can allow the testing works on multiple drives and verify the locking scheme if can work as expected for multiple drives case. For example, for Seagate IDM locking scheme, if a VG uses two PVs, every PV is resident on a drive, thus the locking operations will be sent to two drives respectively; so the extension for "LVM_TEST_BACKING_DEVICE" can help to verify different drive configurations for locking. Signed-off-by: Leo Yan <leo.yan@linaro.org>
* tests: Enable the testing for IDM locking schemeLeo Yan2021-06-033-1/+32
| | | | | | | | | This patch is to introduce testing option LVM_TEST_LOCK_TYPE_IDM, with specifying this option, the Seagate IDM lock manager will be launched as backend for testing. Also add the prepare and remove shell scripts for IDM. Signed-off-by: Leo Yan <leo.yan@linaro.org>
* shellcheck: updatesZdenek Kabelac2021-04-233-14/+14
| | | | Ehance some shellcheck reported issues.
* tests: pvmove updatesZdenek Kabelac2021-04-061-9/+10
| | | | | | | | | | | Switch to plain 'kill' we should no longer need SIGKILL as polling can be interrupted. Resolve problem in aux wait_pvmove_lv_ready() that was using lvm command to check for UUID - but this was interferring with VG lock and it's been delaying confirmation. So reducing slow-down of test - so it can run faster.
* tests: add aux remove_dm_devsZdenek Kabelac2021-03-281-0/+22
| | | | | Add function to remove DM devices and dies if some device can't be removed.
* tests: use known path for test in findZdenek Kabelac2021-03-271-1/+1
| | | | | Actually make sure which 'test' binary is executed. Since we used to have 'test' binary in tests.
* tests: add aux mdadm_assembleZdenek Kabelac2021-03-261-0/+16
| | | | Wrapper for slowed version of mdadm --assemble
* tests: aux fix check_lvmpolld_init_rq_countZdenek Kabelac2021-03-261-4/+4
| | | | | | Make check_lvmpolld_init_rq_count() more compatible with older gawk, where some functionality was not working properly. Also change 'not not' condition.
* tests: improve check raid_leg_statusZdenek Kabelac2021-03-241-4/+13
| | | | | | | Enhance function to wait until raid status gets consisten (shifts from 0/xxxxx to something else) If it would took too long fail the check.