| 1 |
set -x -e |
| 2 |
|
| 3 |
# Test interaction between -I and -A |
| 4 |
# there are locking issue too, but those are hard to test for. |
| 5 |
# |
| 6 |
# Here just test that a partly "-I" assembled array can |
| 7 |
# be completed with "-A" |
| 8 |
|
| 9 |
levels=(raid0 raid1 raid5) |
| 10 |
|
| 11 |
if [ "$LINEAR" == "yes" ]; then |
| 12 |
levels+=( linear ) |
| 13 |
fi |
| 14 |
|
| 15 |
is_raid_foreign $md0 |
| 16 |
|
| 17 |
for l in ${levels[@]} |
| 18 |
do |
| 19 |
mdadm -CR $md0 -l $l -n5 $dev0 $dev1 $dev2 $dev3 $dev4 --assume-clean |
| 20 |
mdadm -S $md0 |
| 21 |
mdadm -I $dev1 |
| 22 |
mdadm -I $dev3 |
| 23 |
mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 $dev4 |
| 24 |
# If one array is foreign (metadata name doesn't have the machine's |
| 25 |
# hostname), mdadm chooses a minor number automatically from 127 |
| 26 |
if [ $is_foreign == "no" ]; then |
| 27 |
mdadm -S $md0 |
| 28 |
else |
| 29 |
mdadm -S $md127 |
| 30 |
fi |
| 31 |
done |