diff options
author | Michal Zylowski <michal.zylowski@intel.com> | 2018-06-22 16:34:12 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2018-07-11 19:17:29 +0200 |
commit | cf42a1c7074a4f6258e6f0e4c122a93fd9c89850 (patch) | |
tree | 845f8e1d85ad3f7fe4bfe5286ef036447007c060 /tests | |
parent | tests, imsm: Migration from RAID5 to RAID0 is not supported for IMSM metadata (diff) | |
download | mdadm-cf42a1c7074a4f6258e6f0e4c122a93fd9c89850.tar.xz mdadm-cf42a1c7074a4f6258e6f0e4c122a93fd9c89850.zip |
tests, imsm: Calculate expected array_size in proper way
Tests should calucalte expected array_size accordingly to raid level. Also
tests should take care about runding to neares MB introduced from b53bfba6
"imsm: use rounded size for metadata initialization".
Expect proper size in tests. Simplify 09imsm-overlap test by creating array
with size which has not been rounded. Main purpose of this test is checking
something else.
Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/09imsm-create-fail-rebuild | 4 | ||||
-rw-r--r-- | tests/09imsm-overlap | 2 | ||||
-rw-r--r-- | tests/env-imsm-template | 28 |
3 files changed, 26 insertions, 8 deletions
diff --git a/tests/09imsm-create-fail-rebuild b/tests/09imsm-create-fail-rebuild index 886d385a..f09b437b 100644 --- a/tests/09imsm-create-fail-rebuild +++ b/tests/09imsm-create-fail-rebuild @@ -36,7 +36,7 @@ mdadm -CR $member0 $dev0 $dev1 -n $num_disks -l $level -z $size -c $chunk imsm_check member $member0 $num_disks $level $size $((size*2)) $offset $chunk testdev $member0 $num_disks $size $chunk -offset=$(((size & ~(chunk - 1)) + 4096)) +offset=$(((size & ~(1024 - 1)) + 4096)) size=4000 level=1 chunk=0 @@ -60,7 +60,7 @@ mdadm -CR $member0 $dev0 $dev1 $dev2 $dev3 -n $num_disks -l $level -z $size -c $ imsm_check member $member0 $num_disks $level $size $((size*2)) $offset $chunk testdev $member0 $((num_disks-2)) $size $chunk -offset=$(((size & ~(chunk - 1)) + 4096)) +offset=$(((size & ~(1024 - 1)) + 4096)) size=4000 level=5 mdadm -CR $member1 $dev0 $dev1 $dev2 $dev3 -n $num_disks -l $level -z $size -c $chunk diff --git a/tests/09imsm-overlap b/tests/09imsm-overlap index 2d1ab692..ff5d2093 100644 --- a/tests/09imsm-overlap +++ b/tests/09imsm-overlap @@ -5,7 +5,7 @@ mdadm -CR $container -e imsm -n 6 $dev0 $dev1 $dev2 $dev3 $dev4 $dev5 imsm_check container 6 -size=1910 +size=1024 level=1 num_disks=2 mdadm -CR $member0 $dev0 $dev1 -n $num_disks -l $level -z $size diff --git a/tests/env-imsm-template b/tests/env-imsm-template index 40479b48..d5247714 100644 --- a/tests/env-imsm-template +++ b/tests/env-imsm-template @@ -14,13 +14,31 @@ imsm_check() { t_offset=$7 t_chunk=$8 - if [ $t_level -ne 1 ]; then - t_rd_size=$((t_rd_size & ~(t_chunk - 1))) - else + t_rd_size=$((t_rd_size & ~(1024 - 1))) + + if [ $t_level -eq 1 ]; then t_chunk=64 fi - t_size=$((t_size/1024)) - t_size=$((t_size*1024)) + + t_num_data_disks=0 + + case $t_level in + 0) + t_num_data_disks=$t_num_disks + ;; + 1) + t_num_data_disks=1 + ;; + 5) + t_num_data_disks=$((t_num_disks-1)) + ;; + 10) + t_num_data_disks=$((t_num_disks/2)) + ;; + esac + + t_size=$((t_rd_size*t_num_data_disks)) + err=0 eval `stat -L -c "let major=0x%t; let minor=0x%T;" $t_member` |