Whamcloud - gitweb
tests: fix d_inline_dump and f_mke2fs_baddisk from leaving behind temp files
[tools/e2fsprogs.git] / tests / f_mke2fs_baddisk / script
1 test_description="mke2fs /dev/mapper/bad_disk should fail"
2
3 OUT=$test_name.log
4
5 dmsetup create -v bad_disk --table '0 1148681097 error' > $OUT 2>&1
6 status=$?
7 if [ "$status" != 0 ]; then
8     echo "$test_name: $test_description: skip"
9     touch $test_name.ok
10 else
11     echo mke2fs /dev/mapper/bad_disk  >> $OUT
12     $MKE2FS  /dev/mapper/bad_disk  >> $OUT 2>&1
13     status=$?
14     sleep 1
15     dmsetup remove --retry bad_disk >> $OUT 2>&1
16
17     if [ "$status" = 0 ] ; then
18         ln -f $test_name.log $test_name.failed
19         echo "$test_name: $test_description: failed"
20     else
21         echo "$test_name: $test_description: ok"
22         touch $test_name.ok
23     fi
24 fi