Home | History | Annotate | Download | only in t_quota_1on
      1 FSCK_OPT=-yf
      2 
      3 if [ "$QUOTA" != "y" ]; then
      4 	echo "$test_name: $test_description: skipped"
      5 	return 0
      6 fi
      7 
      8 $MKE2FS -q -F -o Linux -b 4096 $TMPFILE 10000 > $test_name.log 2>&1
      9 status=$?
     10 if [ "$status" != 0 ] ; then
     11 	echo "mke2fs failed" > $test_name.failed
     12 	echo "$test_name: $test_description: failed"
     13 	return $status
     14 fi
     15 
     16 dd if=/dev/zero of=$TMPFILE.2 bs=1048576 count=1 >> $test_name.log 2>&1
     17 cat <<- EOF | $DEBUGFS -w -f /dev/stdin $TMPFILE >> $test_name.log 2>&1
     18 	write $TMPFILE.2 file1
     19 	set_inode_field file1 uid 500
     20 	set_inode_field file1 gid 500
     21 EOF
     22 rm -f $TMPFILE.2
     23 
     24 $TUNE2FS -O quota  $TMPFILE >> $test_name.log 2>&1
     25 status=$?
     26 if [ "$status" != 0 ] ; then
     27 	echo "tune2fs -O quota failed with $status" > $test_name.failed
     28 	echo "$test_name: $test_description: failed"
     29 	return $status
     30 fi
     31 
     32 $FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1
     33 status=$?
     34 if [ "$status" = 0 ] ; then
     35 	echo "$test_name: $test_description: ok"
     36 	touch $test_name.ok
     37 else
     38 	echo "e2fsck with quota enabled failed with $status" > $test_name.failed
     39 	echo "$test_name: $test_description: failed"
     40 	return $status
     41 fi
     42 rm -f $TMPFILE
     43