xref: /aosp_15_r20/external/e2fsprogs/tests/r_min_itable/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Workerif ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then
2*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: skipped (no debugfs/resize2fs)"
3*6a54128fSAndroid Build Coastguard Worker	return 0
4*6a54128fSAndroid Build Coastguard Workerfi
5*6a54128fSAndroid Build Coastguard Worker
6*6a54128fSAndroid Build Coastguard WorkerIMAGE=$test_dir/image.gz
7*6a54128fSAndroid Build Coastguard WorkerFSCK_OPT=-yf
8*6a54128fSAndroid Build Coastguard WorkerOUT=$test_name.log
9*6a54128fSAndroid Build Coastguard WorkerEXP=$test_dir/expect
10*6a54128fSAndroid Build Coastguard Worker
11*6a54128fSAndroid Build Coastguard Workergunzip < $IMAGE > $TMPFILE
12*6a54128fSAndroid Build Coastguard Worker
13*6a54128fSAndroid Build Coastguard Workerecho "resize2fs test" > $OUT.new
14*6a54128fSAndroid Build Coastguard Worker
15*6a54128fSAndroid Build Coastguard Workerecho "resize2fs -M test.img" >> $OUT.new
16*6a54128fSAndroid Build Coastguard Worker$RESIZE2FS -M $TMPFILE >> $OUT.new 2>&1
17*6a54128fSAndroid Build Coastguard Workerstatus=$?
18*6a54128fSAndroid Build Coastguard Workerecho Exit status is $status >> $OUT.new
19*6a54128fSAndroid Build Coastguard Worker
20*6a54128fSAndroid Build Coastguard Workerecho " " >> $OUT.new
21*6a54128fSAndroid Build Coastguard Workerecho fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
22*6a54128fSAndroid Build Coastguard Worker$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
23*6a54128fSAndroid Build Coastguard Workerecho Exit status is $status >> $OUT.new
24*6a54128fSAndroid Build Coastguard Workersed -f $cmd_dir/filter.sed $OUT.new > $OUT
25*6a54128fSAndroid Build Coastguard Workerrm $TMPFILE $OUT.new
26*6a54128fSAndroid Build Coastguard Worker
27*6a54128fSAndroid Build Coastguard Worker#
28*6a54128fSAndroid Build Coastguard Worker# Do the verification
29*6a54128fSAndroid Build Coastguard Worker#
30*6a54128fSAndroid Build Coastguard Worker
31*6a54128fSAndroid Build Coastguard Workercmp -s $OUT $EXP
32*6a54128fSAndroid Build Coastguard Workerstatus=$?
33*6a54128fSAndroid Build Coastguard Worker
34*6a54128fSAndroid Build Coastguard Workerif [ "$status" = 0 ] ; then
35*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: ok"
36*6a54128fSAndroid Build Coastguard Worker	touch $test_name.ok
37*6a54128fSAndroid Build Coastguard Workerelse
38*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
39*6a54128fSAndroid Build Coastguard Worker	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
40*6a54128fSAndroid Build Coastguard Workerfi
41*6a54128fSAndroid Build Coastguard Worker
42*6a54128fSAndroid Build Coastguard Workerunset IMAGE FSCK_OPT OUT EXP
43