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

26 Commits

Author SHA1 Message Date
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
David Teigland
3a75704756 tests: integrity: snapshots now work on raid+integrity 2023-05-17 11:10:45 -05:00
Zdenek Kabelac
4a003ba671 tests: fix pattern for raid4
Since the strip in raid4 might be XOR - we might eventually end
with 2 blocks of 'B' on 2 disks - so will rest of stripe with 'b'.
2023-04-25 00:12:31 +02:00
Zdenek Kabelac
ce8835d4c4 tests: enforce 4K block for integrity fs
With raid tests it's important we don't get spread of 4K file
across 1K block on a multiple disk stripe - so use 4K block size
for ext4 fs.
2023-04-23 00:03:43 +02:00
Zdenek Kabelac
80ebec099d aux: add wait_recalc
Share function across tests.
2023-04-21 14:52:43 +02:00
Zdenek Kabelac
4e0aab7428 tests: convert to use ext4
Convert test to use only ext4 instead of 300M demanding XFS.
Shorten  'B' files to 4K and use 4K strip size with >raid1 arrays
so we do not risk spreading of the file across stripe.

Also use easier 'aux corrupt_dev()' method to introduce a bit
corruption into a block device with integrity.

TODO: shorten _wait_recalc (should't be needed).
2023-04-21 14:52:43 +02:00
Zdenek Kabelac
b2360437e0 tests: use aux clear_dev
Use wrapper over 'blkdiscard -z'
2023-04-21 14:52:43 +02:00
David Teigland
ebbc3f7ab3 tests: integrity fixes
wait_recalc was mistakenly being called on raid without integrity
wait_recalc loop was exiting without error
2023-04-05 14:24:07 -05:00
Zdenek Kabelac
5bd99d55b0 shellcheck: tests fixes
Correcting some shell problems.
2021-09-21 21:03:47 +02: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
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
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
f2878a801c tests: use DIRECT io for zeroing whenver we can
Performance with direct I/O here is noticable better,
so use it instead of buffered write whenever we can.
2020-09-20 00:37:21 +02:00
Zdenek Kabelac
531a475afc tests: use 4K with mkfs.xfs
If the test runs of loop device backend with 512 sectors,
xfs selects this smaller sector size and then data do not fit
(we would need -l9 with most of 'raids').
With 4K sectors data always fits.
2020-09-20 00:37:21 +02:00
Zdenek Kabelac
e556c7b7c6 tests: check for cvol
Check for cvol.
Add check for cmeta.
2020-09-19 23:02:17 +02:00
Zdenek Kabelac
530fc17b38 tests: reduce disk usage 2020-09-19 17:30:51 +02:00
Zdenek Kabelac
4b07ae55f1 tests: printf to awk
Shorten trace logs.
2020-09-18 17:30:45 +02:00
Zdenek Kabelac
7f019f2580 tests: lower memory usage
Reduce memory needed by test at one time.
2020-09-17 23:27:45 +02:00
Zdenek Kabelac
fe77d1a710 tests: avoid using string
String 'TEST WARNING' may not be present in the test script itself.
Add '\ ' to avoid 'grep' matching test as the test with warning.
2020-09-12 13:24:03 +02:00
David Teigland
739827ef1c tests: add new integrity reporting fields 2020-09-01 17:13:46 -05:00
David Teigland
7b04ed07ba tests: integrity wait for sync
The test was using a raid+integrity LV without
first waiting for the integrity sync, which could
cause the test to fail (depending on init speed)
where it depends on integrity to work in uninitialized
areas.

Also use cmp instead of diff.
2020-05-29 10:57:56 -05:00
Marian Csontos
be61bd6ff5 test: Warn and exit on problematic integrity device behavior
The first leg of integrity enabled raid device sometimes does not get
recalculated.
2020-05-28 17:04:35 +02:00
Marian Csontos
53803821de test: Use printf to generate data
...to avoid unnecessary dependency on python
2020-05-21 15:33:24 +02:00
Marian Csontos
b5811b7c9c tests: Use python single liner to generate data 2020-05-21 15:11:22 +02:00
David Teigland
d9e8895a96 Allow dm-integrity to be used for raid images
dm-integrity stores checksums of the data written to an
LV, and returns an error if data read from the LV does
not match the previously saved checksum.  When used on
raid images, dm-raid will correct the error by reading
the block from another image, and the device user sees
no error.  The integrity metadata (checksums) are stored
on an internal LV allocated by lvm for each linear image.
The internal LV is allocated on the same PV as the image.

Create a raid LV with an integrity layer over each
raid image (for raid levels 1,4,5,6,10):

lvcreate --type raidN --raidintegrity y [options]

Add an integrity layer to images of an existing raid LV:

lvconvert --raidintegrity y LV

Remove the integrity layer from images of a raid LV:

lvconvert --raidintegrity n LV

Settings

Use --raidintegritymode journal|bitmap (journal is default)
to configure the method used by dm-integrity to ensure
crash consistency.

Initialization

When integrity is added to an LV, the kernel needs to
initialize the integrity metadata/checksums for all blocks
in the LV.  The data corruption checking performed by
dm-integrity will only operate on areas of the LV that
are already initialized.  The progress of integrity
initialization is reported by the "syncpercent" LV
reporting field (and under the Cpy%Sync lvs column.)

Example: create a raid1 LV with integrity:

$ lvcreate --type raid1 -m1 --raidintegrity y -n rr -L1G foo
  Creating integrity metadata LV rr_rimage_0_imeta with size 12.00 MiB.
  Logical volume "rr_rimage_0_imeta" created.
  Creating integrity metadata LV rr_rimage_1_imeta with size 12.00 MiB.
  Logical volume "rr_rimage_1_imeta" created.
  Logical volume "rr" created.
$ lvs -a foo
  LV                  VG  Attr       LSize  Origin              Cpy%Sync
  rr                  foo rwi-a-r---  1.00g                     4.93
  [rr_rimage_0]       foo gwi-aor---  1.00g [rr_rimage_0_iorig] 41.02
  [rr_rimage_0_imeta] foo ewi-ao---- 12.00m
  [rr_rimage_0_iorig] foo -wi-ao----  1.00g
  [rr_rimage_1]       foo gwi-aor---  1.00g [rr_rimage_1_iorig] 39.45
  [rr_rimage_1_imeta] foo ewi-ao---- 12.00m
  [rr_rimage_1_iorig] foo -wi-ao----  1.00g
  [rr_rmeta_0]        foo ewi-aor---  4.00m
  [rr_rmeta_1]        foo ewi-aor---  4.00m
2020-04-15 12:10:32 -05:00