path: root/tests
diff options
authorAndreas Dilger <adilger@whamcloud.com>2011-09-24 13:17:05 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-09-24 14:34:47 -0400
commitd90d6a71460d2e3fd57607f90f9abbd1e7d77e3b (patch)
treeeb0f6931fbdb12de524e7401931a04772abddc8e /tests
parent6b56f3d92d08806ab415e8fd883480f7f9c148e8 (diff)
tune2fs: kill external journal if device not found
Continue to remove the external journal device even if the device cannot be found. Add a test to verify that the journal device/UUID are actually removed from the superblock. It isn't possible to use a real journal device for testing without loopback devices and such (it must be a block device) and this would invite complexity and failures in the regression test. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'tests')
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/t_ext_jnl_rm/script b/tests/t_ext_jnl_rm/script
new file mode 100644
index 00000000..d7217b6e
--- /dev/null
+++ b/tests/t_ext_jnl_rm/script
@@ -0,0 +1,28 @@
+printf "remove missing external journal device: "
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+echo mke2fs -q -F -o Linux -b 1024 $TMPFILE >> $OUT
+$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >> $OUT 2>&1
+echo "debugfs add journal device/UUID" >> $OUT
+$DEBUGFS -w -f - $TMPFILE <<- EOF >> $OUT 2>&1
+ feature has_journal
+ ssv journal_dev 0x9999
+ ssv journal_uuid 1db3f677-6832-4adb-bafc-8e4059c30a33
+echo "tune2fs -f -O ^has_journal $TMPFILE" >> $OUT
+$TUNE2FS -f -O ^has_journal $TMPFILE >> $OUT 2>&1
+$DUMPE2FS -h $TMPFILE >> $OUT 2>&1
+if [ "$(grep 'Journal UUID:' $OUT)" ]; then
+ rm -f $test_name.ok
+ mv $test_name.log $test_name.failed
+ echo "failed"
+ echo "ok"
+ mv $test_name.log $test_name.ok
+ rm -f $test_name.failed
+rm -f $TMPFILE