xref: /aosp_15_r20/external/e2fsprogs/tests/f_yes/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Workertest_description="e2fsck with repeated yes"
2*6a54128fSAndroid Build Coastguard WorkerFSCK_OPT=-f
3*6a54128fSAndroid Build Coastguard WorkerOUT=$test_name.log
4*6a54128fSAndroid Build Coastguard WorkerEXP=$test_dir/expect
5*6a54128fSAndroid Build Coastguard Worker
6*6a54128fSAndroid Build Coastguard Workergunzip < $test_dir/../f_yesall/image.gz > $TMPFILE
7*6a54128fSAndroid Build Coastguard Worker
8*6a54128fSAndroid Build Coastguard Workerecho "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" | E2FSCK_FORCE_INTERACTIVE=y $FSCK $FSCK_OPT -N test_filesys $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 Workersed -f $cmd_dir/filter.sed $OUT.new > $OUT
12*6a54128fSAndroid Build Coastguard Workerrm -f $OUT.new
13*6a54128fSAndroid Build Coastguard Worker
14*6a54128fSAndroid Build Coastguard Workercmp -s $OUT $EXP
15*6a54128fSAndroid Build Coastguard Workerstatus=$?
16*6a54128fSAndroid Build Coastguard Worker
17*6a54128fSAndroid Build Coastguard Workerif [ "$status" = 0 ] ; then
18*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: ok"
19*6a54128fSAndroid Build Coastguard Worker	touch $test_name.ok
20*6a54128fSAndroid Build Coastguard Workerelse
21*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
22*6a54128fSAndroid Build Coastguard Worker	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
23*6a54128fSAndroid Build Coastguard Worker	rm -f tmp_expect
24*6a54128fSAndroid Build Coastguard Workerfi
25*6a54128fSAndroid Build Coastguard Worker
26*6a54128fSAndroid Build Coastguard Workerunset IMAGE FSCK_OPT OUT EXP
27