fstests: convert remaining tests to SPDX license tags
[xfstests-dev.git] / tests / xfs / 216
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 216
6 #
7 # log size mkfs test - ensure the log size scaling works for small filesystems
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs xfs
30 _supported_os Linux
31
32 _require_scratch
33 _scratch_mkfs_xfs >/dev/null 2>&1
34 _scratch_mount
35
36 _require_loop
37 LOOP_DEV=$SCRATCH_MNT/test_fs
38 LOOP_MNT=$SCRATCH_MNT/test_fs_dir
39
40 _do_mkfs()
41 {
42         for i in $*; do
43                 echo -n "fssize=${i}g "
44                 $MKFS_XFS_PROG -f -b size=4096 -l version=2 \
45                         -d name=$LOOP_DEV,size=${i}g |grep log
46                 mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
47                 echo "test write" > $LOOP_MNT/test
48                 umount $LOOP_MNT > /dev/null 2>&1
49         done
50 }
51 # make large holey file
52 $XFS_IO_PROG -f -c "truncate 256g" $LOOP_DEV
53
54 #make loopback mount dir
55 mkdir $LOOP_MNT
56
57 # walk over standard sizes (up to 256GB)
58 _do_mkfs 1 2 4 8 16 32 64 128 256
59
60 status=0
61 exit