X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=blobdiff_plain;f=tests%2Fxfs%2F087;h=b3d3bca9606ff8c6c8f321023fab2733a7560df5;hp=65877c7c4ed2330962c3f9c1e1349e1d21a73d70;hb=0c92d38b7bd27418a707edf3c67c3fd3c8cfc1ee;hpb=0828657542eabdee25d6de480aa3c9ed30c902e1;ds=sidebyside diff --git a/tests/xfs/087 b/tests/xfs/087 index 65877c7c..b3d3bca9 100755 --- a/tests/xfs/087 +++ b/tests/xfs/087 @@ -1,27 +1,12 @@ #! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2015 Oracle, Inc. All Rights Reserved. +# # FS QA Test No. 087 # # Create and populate an XFS filesystem, corrupt the AGI, then see how # the kernel and xfs_repair deal with it. # -#----------------------------------------------------------------------- -# Copyright (c) 2015 Oracle, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#----------------------------------------------------------------------- -# - seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" @@ -79,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$(xfs_info "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" @@ -90,17 +75,16 @@ for ag in $(seq 1 $((agcount - 1))) 0; do _scratch_xfs_db -x -c "agi ${ag}" -c "agi ${ag}" -c "stack" -c "blocktrash -x 32 -o +64 -y 4096 -z ${FUZZ_ARGS}" >> $seqres.full 2>&1 done -echo "+ mount image" +echo "+ mount image && modify files" +broken=1 if _try_scratch_mount >> $seqres.full 2>&1; then - echo "+ modify files" - broken=0 for x in `seq 65 70`; do - touch "${TESTFILE}.${x}" 2> /dev/null || broken=1 + touch "${TESTFILE}.${x}" 2> /dev/null && broken=0 done - echo "broken: ${broken}" umount "${SCRATCH_MNT}" fi +echo "broken: ${broken}" echo "+ repair fs" _scratch_xfs_repair >> $seqres.full 2>&1