xref: /aosp_15_r20/external/e2fsprogs/tests/t_write_subdirectory/script (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1FSCK_OPT=-nf
2
3$MKE2FS -q -F -o Linux -I 256 -b 4096 $TMPFILE 10000 > $test_name.log 2>&1
4status=$?
5if [ "$status" != 0 ] ; then
6	echo "mke2fs failed" > $test_name.failed
7	echo "$test_name: $test_description: failed"
8	return $status
9fi
10
11touch $TMPFILE.1
12cat <<- EOF | $DEBUGFS -w $TMPFILE >> $test_name.log 2>&1
13	mkdir aaa
14	mkdir aaa/bbb
15	write $TMPFILE.1 aaa/bbb/ccc
16EOF
17rm -f $TMPFILE.1
18
19$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1
20status=$?
21if [ "$status" = 0 ] ; then
22	echo "$test_name: $test_description: ok"
23	touch $test_name.ok
24else
25	echo "e2fsck with failed with $status" > $test_name.failed
26	echo "$test_name: $test_description: failed"
27	return $status
28fi
29rm -f $TMPFILE
30