xref: /aosp_15_r20/external/e2fsprogs/tests/t_project_1on/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard WorkerFSCK_OPT=-yf
2*6a54128fSAndroid Build Coastguard Worker
3*6a54128fSAndroid Build Coastguard Workerif [ "$QUOTA" != "y" ]; then
4*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: skipped"
5*6a54128fSAndroid Build Coastguard Worker	return 0
6*6a54128fSAndroid Build Coastguard Workerfi
7*6a54128fSAndroid Build Coastguard Worker
8*6a54128fSAndroid Build Coastguard Worker$MKE2FS -q -F -o Linux -I 256 -b 4096 $TMPFILE 10000 > $test_name.log 2>&1
9*6a54128fSAndroid Build Coastguard Workerstatus=$?
10*6a54128fSAndroid Build Coastguard Workerif [ "$status" != 0 ] ; then
11*6a54128fSAndroid Build Coastguard Worker	echo "mke2fs failed" > $test_name.failed
12*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
13*6a54128fSAndroid Build Coastguard Worker	return $status
14*6a54128fSAndroid Build Coastguard Workerfi
15*6a54128fSAndroid Build Coastguard Worker
16*6a54128fSAndroid Build Coastguard Workerdd if=/dev/zero of=$TMPFILE.2 bs=1048576 count=1 >> $test_name.log 2>&1
17*6a54128fSAndroid Build Coastguard Workercat <<- EOF | $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1
18*6a54128fSAndroid Build Coastguard Worker	write $TMPFILE.2 file1
19*6a54128fSAndroid Build Coastguard Worker	set_inode_field file1 projid 500
20*6a54128fSAndroid Build Coastguard WorkerEOF
21*6a54128fSAndroid Build Coastguard Workerrm -f $TMPFILE.2
22*6a54128fSAndroid Build Coastguard Worker
23*6a54128fSAndroid Build Coastguard Worker$TUNE2FS -O project $TMPFILE >> $test_name.log 2>&1
24*6a54128fSAndroid Build Coastguard Workerstatus=$?
25*6a54128fSAndroid Build Coastguard Workerif [ "$status" != 0 ] ; then
26*6a54128fSAndroid Build Coastguard Worker	echo "tune2fs -O project failed with $status" > $test_name.failed
27*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
28*6a54128fSAndroid Build Coastguard Worker	return $status
29*6a54128fSAndroid Build Coastguard Workerfi
30*6a54128fSAndroid Build Coastguard Worker
31*6a54128fSAndroid Build Coastguard Worker$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1
32*6a54128fSAndroid Build Coastguard Workerstatus=$?
33*6a54128fSAndroid Build Coastguard Workerif [ "$status" = 0 ] ; then
34*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: ok"
35*6a54128fSAndroid Build Coastguard Worker	touch $test_name.ok
36*6a54128fSAndroid Build Coastguard Workerelse
37*6a54128fSAndroid Build Coastguard Worker	echo "e2fsck with project enabled failed with $status" > $test_name.failed
38*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
39*6a54128fSAndroid Build Coastguard Worker	return $status
40*6a54128fSAndroid Build Coastguard Workerfi
41*6a54128fSAndroid Build Coastguard Workerrm -f $TMPFILE
42