blob: 5fda3b35b6810cd2930bde2f9e257ca85f01b783 [file] [log] [blame]
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0+
seq=`basename $0`
seqres=$RESULT_DIR/$seq
# get standard environment, filters and checks
. "${srcdir}/common/rc"
cleanup()
{
cd /
rm -rf $tmp.*
}
# remove previous $seqres.full before test
rm -f $seqres.full
# real QA test starts here
echo "QA output created by $seq"
if [ -z $SCRATCH_DEV ]; then
SCRATCH_DEV=$tmp/erofs_$seq.img
rm -f SCRATCH_DEV
fi
localdir="$tmp/$seq"
rm -rf $localdir
mkdir -p $localdir
# collect files pending for verification
head -c 4032 /dev/urandom > $localdir/1
head -c 4095 /dev/urandom > $localdir/2
head -c 12345 /dev/urandom > $localdir/3 # arbitrary size
_scratch_mkfs -Eforce-inode-compact $localdir || _fail "failed to mkfs"
# verify the uncompressed image
_require_erofs
_require_fssum
_scratch_mount 2>>$seqres.full
FSSUM_OPTS="-MAC"
[ $FSTYP = "erofsfuse" ] && FSSUM_OPTS="${FSSUM_OPTS}T"
sum1=`$FSSUM_PROG $FSSUM_OPTS $localdir`
echo "$localdir checksum is $sum1" >>$seqres.full
sum2=`$FSSUM_PROG $FSSUM_OPTS $SCRATCH_MNT`
echo "$SCRATCH_MNT checksum is $sum2" >>$seqres.full
[ "x$sum1" = "x$sum2" ] || _fail "-->checkMD5 FAILED"
_scratch_unmount
echo Silence is golden
status=0
exit 0