xref: /aosp_15_r20/external/e2fsprogs/tests/t_project_4off/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 -O quota,project $TMPFILE 100 > $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 -O quota,project 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 Worker$TUNE2FS -Q ^prj $TMPFILE >> $test_name.log 2>&1
17*6a54128fSAndroid Build Coastguard Workerstatus=$?
18*6a54128fSAndroid Build Coastguard Workerif [ "$status" != 0 ] ; then
19*6a54128fSAndroid Build Coastguard Worker	echo "tune2fs -O ^project failed" > $test_name.failed
20*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
21*6a54128fSAndroid Build Coastguard Worker	return $status
22*6a54128fSAndroid Build Coastguard Workerfi
23*6a54128fSAndroid Build Coastguard Worker
24*6a54128fSAndroid Build Coastguard Worker$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1
25*6a54128fSAndroid Build Coastguard Workerstatus=$?
26*6a54128fSAndroid Build Coastguard Workerif [ "$status" = 0 ] ; then
27*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: ok"
28*6a54128fSAndroid Build Coastguard Worker	touch $test_name.ok
29*6a54128fSAndroid Build Coastguard Workerelse
30*6a54128fSAndroid Build Coastguard Worker	echo "e2fsck with project enabled failed with $status" > $test_name.failed
31*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
32*6a54128fSAndroid Build Coastguard Worker	return $status
33*6a54128fSAndroid Build Coastguard Workerfi
34*6a54128fSAndroid Build Coastguard Worker
35*6a54128fSAndroid Build Coastguard Workerrm -f $TMPFILE
36