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