xref: /aosp_15_r20/external/e2fsprogs/tests/d_inline_dump/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Workerif ! test -x $DEBUGFS_EXE; then
2*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: skipped (no debugfs)"
3*6a54128fSAndroid Build Coastguard Worker	return 0
4*6a54128fSAndroid Build Coastguard Workerfi
5*6a54128fSAndroid Build Coastguard Worker
6*6a54128fSAndroid Build Coastguard WorkerOUT=$test_name.log
7*6a54128fSAndroid Build Coastguard WorkerEXP=$test_dir/expect
8*6a54128fSAndroid Build Coastguard WorkerVERIFY_FSCK_OPT=-yf
9*6a54128fSAndroid Build Coastguard Worker
10*6a54128fSAndroid Build Coastguard WorkerZIMAGE=$test_dir/image.gz
11*6a54128fSAndroid Build Coastguard Workergzip -d < $ZIMAGE > $TMPFILE
12*6a54128fSAndroid Build Coastguard Worker
13*6a54128fSAndroid Build Coastguard Workerecho "*** long file" > $OUT
14*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'stat /file' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1
15*6a54128fSAndroid Build Coastguard Workerecho "*** short file" >> $OUT
16*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'stat /shortfile' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1
17*6a54128fSAndroid Build Coastguard Workerecho >> $OUT
18*6a54128fSAndroid Build Coastguard Worker
19*6a54128fSAndroid Build Coastguard Workerecho "*** long dir" >> $OUT
20*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'stat /dir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1
21*6a54128fSAndroid Build Coastguard Workerecho "*** short dir" >> $OUT
22*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'stat /shortdir' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1
23*6a54128fSAndroid Build Coastguard Workerecho >> $OUT
24*6a54128fSAndroid Build Coastguard Worker
25*6a54128fSAndroid Build Coastguard Workerecho "*** long link" >> $OUT
26*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'stat /link' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1
27*6a54128fSAndroid Build Coastguard Workerecho "*** short link" >> $OUT
28*6a54128fSAndroid Build Coastguard Worker$DEBUGFS -R 'stat /shortlink' $TMPFILE 2>&1 | $CLEAN_OUTPUT >> $OUT 2>&1
29*6a54128fSAndroid Build Coastguard Worker
30*6a54128fSAndroid Build Coastguard Workerecho "*** end test" >> $OUT
31*6a54128fSAndroid Build Coastguard Worker
32*6a54128fSAndroid Build Coastguard Workercmp -s $OUT $EXP
33*6a54128fSAndroid Build Coastguard Workerstatus=$?
34*6a54128fSAndroid Build Coastguard Worker
35*6a54128fSAndroid Build Coastguard Workerif [ "$status" = 0 ] ; then
36*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: ok"
37*6a54128fSAndroid Build Coastguard Worker	touch $test_name.ok
38*6a54128fSAndroid Build Coastguard Workerelse
39*6a54128fSAndroid Build Coastguard Worker	echo "$test_name: $test_description: failed"
40*6a54128fSAndroid Build Coastguard Worker	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
41*6a54128fSAndroid Build Coastguard Workerfi
42*6a54128fSAndroid Build Coastguard Worker
43*6a54128fSAndroid Build Coastguard Workerunset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA ZIMAGE
44