mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
5c62a6cdf4
test 166 output is dependent on page size (mmap related). Make the output filter turn the output into something independent of page size whilst checking that the output is valid. Merge of master-melb:xfs-cmds:30702a by kenmcd. Make the file size and I/O size large enough that 64k pages are handled correctly.
84 lines
1.6 KiB
Bash
84 lines
1.6 KiB
Bash
#! /bin/sh
|
|
# FSQA Test No. 166
|
|
#
|
|
# ->page-mkwrite test - unwritten extents and mmap
|
|
#
|
|
#-----------------------------------------------------------------------
|
|
# Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
|
|
#-----------------------------------------------------------------------
|
|
#
|
|
# creator
|
|
owner=dgc@sgi.com
|
|
|
|
seq=`basename $0`
|
|
echo "QA output created by $seq"
|
|
|
|
here=`pwd`
|
|
tmp=/tmp/$$
|
|
status=1 # failure is the default!
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
_cleanup()
|
|
{
|
|
_cleanup_testdir
|
|
}
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common.rc
|
|
. ./common.filter
|
|
|
|
# assumes 1st, 3rd and 5th blocks are single written blocks,
|
|
# the others are unwritten.
|
|
_filter_blocks()
|
|
{
|
|
$AWK_PROG '
|
|
/[0-9]/ {
|
|
if (!written_size) {
|
|
written_size = $6
|
|
unwritten1 = ((1048576/512) / 2) - written_size
|
|
unwritten2 = ((1048576/512) / 2) - 2 * written_size
|
|
}
|
|
|
|
if ($7) {
|
|
size = "RIGHT"
|
|
flags = "GOOD"
|
|
if (unwritten1) {
|
|
if ($6 != unwritten1)
|
|
size = "WRONG"
|
|
unwritten1 = 0;
|
|
} else if ($6 != unwritten2) {
|
|
size = "WRONG"
|
|
}
|
|
if ($7 < 10000)
|
|
flags = "BAD"
|
|
} else {
|
|
size = "RIGHT"
|
|
flags = "GOOD"
|
|
if ($6 != written_size)
|
|
size = "WRONG"
|
|
}
|
|
print $1, "[AA..BB]", "XX..YY", "AG", "(AA..BB)", size, flags
|
|
}'
|
|
}
|
|
|
|
# real QA test starts here
|
|
_supported_fs xfs
|
|
_supported_os Linux
|
|
|
|
_setup_testdir
|
|
_require_scratch
|
|
_scratch_mkfs_xfs >/dev/null 2>&1
|
|
_scratch_mount
|
|
|
|
TEST_FILE=$SCRATCH_MNT/test_file
|
|
TEST_PROG=$here/src/unwritten_mmap
|
|
FILE_SIZE=1048576
|
|
|
|
rm -f $TEST_FILE
|
|
$TEST_PROG $FILE_SIZE $TEST_FILE
|
|
|
|
xfs_bmap -vp $TEST_FILE | _filter_blocks
|
|
|
|
status=0
|
|
exit
|