]> git.ipfire.org Git - thirdparty/mdadm.git/blob - tests/20raid5journal
Create.c: fix uclibc build
[thirdparty/mdadm.git] / tests / 20raid5journal
1 # check write journal of raid456
2
3 # test --detail
4 test_detail_shows_journal() {
5 mdadm -D $1 | grep journal || {
6 echo >&2 "ERROR --detail does show journal device!"; mdadm -D $1 ; exit 1; }
7 }
8
9 # test --examine
10 test_examine_shows_journal() {
11 mdadm -E $1 | grep Journal || {
12 echo >&2 "ERROR --examine does show Journal device!"; mdadm -E $1 ; exit 1; }
13 }
14
15 # test --create
16 create_with_journal_and_stop() {
17 mdadm -CR $md0 -l5 -n4 $dev0 $dev1 $dev2 $dev3 --write-journal $dev4
18 check wait
19 tar cf - /etc > $md0
20 ./raid6check $md0 0 0 | grep 'Error detected' && exit 1
21 test_detail_shows_journal $md0
22 test_examine_shows_journal $dev4
23 mdadm -S $md0
24 }
25
26 # test --assemble
27 test_assemble() {
28 create_with_journal_and_stop
29 if mdadm -A $md0 $dev0 $dev1 $dev2 $dev3
30 then
31 echo >&2 "ERROR should return 1 when journal is missing!"; cat /proc/mdstat ; exit 1;
32 fi
33 mdadm -S $md0
34
35 mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 --force
36 check readonly
37 mdadm -S $md0
38 }
39
40 # test --incremental
41 test_incremental() {
42 create_with_journal_and_stop
43 for d in $dev0 $dev1 $dev2 $dev3
44 do
45 mdadm -I $d
46 done
47 check inactive
48 mdadm -I $dev4
49 check raid5
50 mdadm -S $md0
51
52 # test --incremental with journal missing
53 for d in $dev0 $dev1 $dev2 $dev3
54 do
55 mdadm -I $d
56 done
57 mdadm -R $md0
58 check readonly
59 mdadm -S $md0
60 }
61
62 create_with_journal_and_stop
63 test_assemble
64 test_incremental