diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2016-02-19 16:18:57 +0000 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2016-02-19 16:18:57 +0000 |
commit | 7e15cddececa359fa92a1a58e4a0c360e13058c1 (patch) | |
tree | a4ce38859718496770223da4c9fae331a6d39bb5 /tests/20raid5journal | |
parent | 5df672d08eb77e64a0f5ed922d2904f418d1758e (diff) |
New upstream release.
Diffstat (limited to 'tests/20raid5journal')
-rw-r--r-- | tests/20raid5journal | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/20raid5journal b/tests/20raid5journal new file mode 100644 index 00000000..f751aceb --- /dev/null +++ b/tests/20raid5journal @@ -0,0 +1,64 @@ +# check write journal of raid456 + +# test --detail +test_detail_shows_journal() { + mdadm -D $1 | grep journal || { + echo >&2 "ERROR --detail does show journal device!"; mdadm -D $1 ; exit 1; } +} + +# test --examine +test_examine_shows_journal() { + mdadm -E $1 | grep Journal || { + echo >&2 "ERROR --examine does show Journal device!"; mdadm -E $1 ; exit 1; } +} + +# test --create +create_with_journal_and_stop() { + mdadm -CR $md0 -l5 -n4 $dev0 $dev1 $dev2 $dev3 --write-journal $dev4 + check wait + tar cf - /etc > $md0 + ./raid6check $md0 0 0 | grep 'Error detected' && exit 1 + test_detail_shows_journal $md0 + test_examine_shows_journal $dev4 + mdadm -S $md0 +} + +# test --assemble +test_assemble() { + create_with_journal_and_stop + if mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 + then + echo >&2 "ERROR should return 1 when journal is missing!"; cat /proc/mdstat ; exit 1; + fi + mdadm -S $md0 + + mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 --force + check readonly + mdadm -S $md0 +} + +# test --incremental +test_incremental() { + create_with_journal_and_stop + for d in $dev0 $dev1 $dev2 $dev3 + do + mdadm -I $d + done + check inactive + mdadm -I $dev4 + check raid5 + mdadm -S $md0 + + # test --incremental with journal missing + for d in $dev0 $dev1 $dev2 $dev3 + do + mdadm -I $d + done + mdadm -R $md0 + check readonly + mdadm -S $md0 +} + +create_with_journal_and_stop +test_assemble +test_incremental |