xref: /aosp_15_r20/external/e2fsprogs/tests/f_orphquot/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Workertest_description="e2fsck with quota and orphan inodes"
2*6a54128fSAndroid Build Coastguard WorkerOUT=$test_name.log
3*6a54128fSAndroid Build Coastguard WorkerEXP=$test_dir/expect
4*6a54128fSAndroid Build Coastguard Worker
5*6a54128fSAndroid Build Coastguard Workerbzip2 -dc < $test_dir/image.bz2 > $TMPFILE
6*6a54128fSAndroid Build Coastguard Worker
7*6a54128fSAndroid Build Coastguard Workerrm -rf $OUT
8*6a54128fSAndroid Build Coastguard Worker$FSCK -f -y -N test_filesystem $TMPFILE > $OUT.new 2>&1
9*6a54128fSAndroid Build Coastguard Workerstatus=$?
10*6a54128fSAndroid Build Coastguard Workerecho Exit status is $status >> $OUT.new
11*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'lq user' $TMPFILE >> $OUT.new 2>&1
12*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'lq group' $TMPFILE >> $OUT.new 2>&1
13*6a54128fSAndroid Build Coastguard Workersed -f $cmd_dir/filter.sed $OUT.new >> $OUT
14*6a54128fSAndroid Build Coastguard Workerrm -f $OUT.new
15*6a54128fSAndroid Build Coastguard Worker
16*6a54128fSAndroid Build Coastguard Workercmp -s $OUT $EXP
17*6a54128fSAndroid Build Coastguard Workerstatus=$?
18*6a54128fSAndroid Build Coastguard Worker
19*6a54128fSAndroid Build Coastguard Workerif [ "$status" = 0 ] ; then
20*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: ok"
21*6a54128fSAndroid Build Coastguard Worker	touch $test_name.ok
22*6a54128fSAndroid Build Coastguard Workerelse
23*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
24*6a54128fSAndroid Build Coastguard Worker	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
25*6a54128fSAndroid Build Coastguard Worker	rm -f tmp_expect
26*6a54128fSAndroid Build Coastguard Workerfi
27*6a54128fSAndroid Build Coastguard Worker
28*6a54128fSAndroid Build Coastguard Workerunset IMAGE FSCK_OPT OUT EXP
29