From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 1/2] test: add f_mke2fs_baddisk v2
Date: Wed, 7 Dec 2016 18:55:17 +0400 [thread overview]
Message-ID: <1481122518-19021-1-git-send-email-dmonakhov@openvz.org> (raw)
Check what mke2fs will return non zero error on broken device.
changes since: v1
- skip test if dm-error is not available.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
tests/f_mke2fs_baddisk/script | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 tests/f_mke2fs_baddisk/script
diff --git a/tests/f_mke2fs_baddisk/script b/tests/f_mke2fs_baddisk/script
new file mode 100644
index 0000000..0e6d3cd
--- /dev/null
+++ b/tests/f_mke2fs_baddisk/script
@@ -0,0 +1,26 @@
+test_description="mke2fs /dev/mapper/bad_disk should fail"
+
+OUT=$test_name.log
+
+dmsetup create -v bad_disk --table '0 1148681097 error' > $OUT 2>&1
+status=$?
+if [ "$status" != 0 ]; then
+ echo "$test_name: $test_description: skip"
+ touch $test_name.ok
+ exit 0
+fi
+
+echo mke2fs /dev/mapper/bad_disk >> $OUT
+$MKE2FS /dev/mapper/bad_disk >> $OUT 2>&1
+status=$?
+sleep 1
+dmsetup remove --retry bad_disk >> $OUT 2>&1
+
+if [ "$status" = 0 ] ; then
+ ln -f $test_name.log $test_name.failed
+ echo "$test_name: $test_description: failed"
+else
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+
+fi
--
2.7.4
next reply other threads:[~2016-12-07 14:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 14:55 Dmitry Monakhov [this message]
2016-12-07 14:55 ` [PATCH 2/2] ext2fs: check fsync error code Dmitry Monakhov
2017-01-30 22:18 ` [PATCH 1/2] test: add f_mke2fs_baddisk v2 Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1481122518-19021-1-git-send-email-dmonakhov@openvz.org \
--to=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox