diff mbox series

[14/19] mdadm/tests: 05r6-bitmapfile

Message ID 20240522085056.54818-15-xni@redhat.com (mailing list archive)
State Rejected
Headers show
Series mdadm/tests: enhance/fix regression cases | expand

Commit Message

Xiao Ni May 22, 2024, 8:50 a.m. UTC
It's not right to compare bitmap bits with a number after io comes.
Because maybe those bits are already flused. Remove the related
tests.

Signed-off-by: Xiao Ni <xni@redhat.com>
---
 tests/05r6-bitmapfile | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/tests/05r6-bitmapfile b/tests/05r6-bitmapfile
index d11896db221c..df66e59462cb 100644
--- a/tests/05r6-bitmapfile
+++ b/tests/05r6-bitmapfile
@@ -11,21 +11,20 @@  mdadm -S $md0
 
 mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2 $dev3 $dev4
 testdev $md0 2 $mdsize1 512
-dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
 sleep 4
-dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
+dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
 
-if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ]
-then  echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2"
+if [ $dirty1 -ne 0 ]
+then  echo >&2 "ERROR bad 'dirty' counts: $dirty1"
   exit 1
 fi
 mdadm $md0 -f $dev3
 testdev $md0 2 $mdsize1 512
 sleep 4
-dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
-if [ $dirty3 -lt 400 ]
+dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
+if [ $dirty2 -lt 400 ]
 then
-   echo >&2 "ERROR dirty count $dirty3 is too small"
+   echo >&2 "ERROR dirty count $dirty2 is too small"
    exit 2
 fi
 
@@ -35,14 +34,12 @@  mdadm --assemble -R $md0 --bitmap=$bmf $dev1 $dev2 $dev4
 mdadm --zero $dev3 # force --add, not --re-add
 mdadm $md0 --add $dev3
 check recovery
-
-dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
 check wait
 sleep 4
-dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
+dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
 
-if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ]
-then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5"
+if [ $dirty3 -ne 0 ]
+then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty3"
   exit 1
 fi