1 test_description="mke2fs with error behavior"
27 trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
28 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
33 # Test command line option
34 echo "error default" >> $OUT
35 $MKE2FS -F $TMPFILE > /dev/null 2>&1
36 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
38 echo "error continue" >> $OUT
39 $MKE2FS -e continue -F $TMPFILE > /dev/null 2>&1
40 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
42 echo "error panic" >> $OUT
43 $MKE2FS -e panic -F $TMPFILE > /dev/null 2>&1
44 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
46 echo "error remount-ro" >> $OUT
47 $MKE2FS -e remount-ro -F $TMPFILE > /dev/null 2>&1
48 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
50 echo "error garbage" >> $OUT
51 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
52 $MKE2FS -e broken -F $TMPFILE > /dev/null 2>&1
53 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
55 # Test errors= in default
56 echo "error default profile continue" >> $OUT
57 write_defaults_conf continue
58 MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1
59 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
61 echo "error default profile panic" >> $OUT
62 write_defaults_conf panic
63 MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1
64 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
66 echo "error default profile remount-ro" >> $OUT
67 write_defaults_conf remount-ro
68 MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1
69 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
71 echo "error default profile broken" >> $OUT
72 write_defaults_conf broken
73 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
74 MKE2FS_CONFIG=$conf $MKE2FS -F $TMPFILE > /dev/null 2>&1
75 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
77 # Test errors= in a fs type
78 echo "error fs_types profile continue" >> $OUT
79 write_section_conf continue
80 MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -F $TMPFILE > /dev/null 2>&1
81 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
83 echo "error fs_types profile panic" >> $OUT
84 write_section_conf panic
85 MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -F $TMPFILE > /dev/null 2>&1
86 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
88 echo "error fs_types profile remount-ro" >> $OUT
89 write_section_conf remount-ro
90 MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -F $TMPFILE > /dev/null 2>&1
91 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
93 # Test command line override
94 echo "error fs_types profile remount-ro" >> $OUT
95 write_section_conf remount-ro
96 MKE2FS_CONFIG=$conf $MKE2FS -T test_suite -e panic -F $TMPFILE > /dev/null 2>&1
97 $DUMPE2FS $TMPFILE 2>&1 | grep 'Errors behavior' >> $OUT
102 if [ "$status" = 0 ] ; then
103 echo "$test_name: $test_description: ok"
106 echo "$test_name: $test_description: failed"
107 diff $DIFF_OPTS $EXP $OUT > $test_name.failed