>>>>> "Mikulas" == Mikulas Patocka <mpato...@redhat.com> writes:

> Hi

> The test shell/integrity.sh creates raid arrays, corrupts one of the
> legs, then reads the array and verifies that the corruption was
> corrected. Finally, the test tests that the number of mismatches on
> the corrupted leg is non-zero.

> The problem is that the raid1 implementation may freely choose which leg 
> to read from. If it chooses to read from the non-corrupted leg, the 
> corruption is not detected, the number of mismatches is not incremented 
> and the test reports this as a failure.

So wait, how is integrity supposed to work in this situation then?  In
real life?  I understand the test is hard, maybe doing it in a loop
three times?  Or configure the RAID1 to prefer one half over another
is the way to make this test work?  

> Fix the test by not checking the number of integrity mismatches for
> raid1.

> Signed-off-by: Mikulas Patocka <mpato...@redhat.com>

> ---
>  test/shell/integrity.sh |   14 --------------
>  1 file changed, 14 deletions(-)

> Index: lvm2/test/shell/integrity.sh
> ===================================================================
> --- lvm2.orig/test/shell/integrity.sh 2025-07-29 19:35:54.000000000 +0200
> +++ lvm2/test/shell/integrity.sh      2025-08-01 15:08:02.000000000 +0200
> @@ -136,10 +136,6 @@ aux wait_recalc $vg/${lv1}_rimage_0
>  aux wait_recalc $vg/${lv1}_rimage_1
>  aux wait_recalc $vg/$lv1
>  _test_fs_with_read_repair "$dev1"
> -lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
> -not grep 0 mismatch
> -lvs -o integritymismatches $vg/$lv1 |tee mismatch
> -not grep 0 mismatch
>  lvchange -an $vg/$lv1
>  lvconvert --raidintegrity n $vg/$lv1
>  lvremove $vg/$lv1
> @@ -153,10 +149,6 @@ aux wait_recalc $vg/${lv1}_rimage_1
>  aux wait_recalc $vg/${lv1}_rimage_2
>  aux wait_recalc $vg/$lv1
>  _test_fs_with_read_repair "$dev1" "$dev2"
> -lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
> -not grep 0 mismatch
> -lvs -o integritymismatches $vg/$lv1 |tee mismatch
> -not grep 0 mismatch
>  lvchange -an $vg/$lv1
>  lvconvert --raidintegrity n $vg/$lv1
>  lvremove $vg/$lv1
> @@ -233,8 +225,6 @@ lvs -o integritymismatches $vg/${lv1}_ri
>  lvs -o integritymismatches $vg/${lv1}_rimage_1
>  lvs -o integritymismatches $vg/${lv1}_rimage_2
>  lvs -o integritymismatches $vg/${lv1}_rimage_3
> -lvs -o integritymismatches $vg/$lv1 |tee mismatch
> -not grep 0 mismatch
>  lvchange -an $vg/$lv1
>  lvconvert --raidintegrity n $vg/$lv1
>  lvremove $vg/$lv1
> @@ -603,10 +593,6 @@ aux wait_recalc $vg/${lv1}_rimage_0
>  aux wait_recalc $vg/${lv1}_rimage_1
>  aux wait_recalc $vg/$lv1
>  _test_fs_with_read_repair "$dev1"
> -lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
> -not grep 0 mismatch
> -lvs -o integritymismatches $vg/$lv1 |tee mismatch
> -not grep 0 mismatch
>  lvchange -an $vg/$lv1
>  lvconvert --raidintegrity n $vg/$lv1
>  lvremove $vg/$lv1



Reply via email to