4 # Test fs creation on 4 TB minus few bytes partition
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2011 Red Hat. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
25 owner=branto@redhat.com
28 echo "QA output created by $seq"
30 status=1 # failure is the default!
37 trap "_cleanup ; exit \$status" 0 1 2 3 15
39 # get standard environment, filters and checks
42 # real QA test starts here
46 testfile=$TEST_DIR/259.image
48 # Test various sizes slightly less than 4 TB
49 # 4398046511103 = 2^42 - 1
50 # 4398046510592 = 2^42 - 512
51 # 4398046510080 = 2^42 - 1024
52 # 4398046510079 = 2^42 - 1025
53 # 4398046509056 = 2^42 - 2048
54 # 4398046507008 = 2^42 - 4096
56 for ddseek in 4398046511103 4398046510592 4398046510080 \
57 4398046510079 4398046509056 4398046507008;
59 echo "Trying to make $ddseek B long xfs fs image"
61 dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \
62 >/dev/null 2>&1 || echo "dd failed"
64 losetup $lofile "$testfile"
65 "$MKFS_XFS_PROG" -b size=512 $lofile >/dev/null || echo "mkfs failed!"