#! /bin/bash # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved. # # FS QA Test No. 135 # # This test verifies that the xfsprogs log formatting infrastructure works # correctly for various log stripe unit values. The log is formatted with xfs_db # and verified with xfs_logprint. # seq=`basename $0` seqres=$RESULT_DIR/$seq 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() { cd / rm -f $tmp.* } rm -f $seqres.full # get standard environment, filters and checks . ./common/rc . ./common/log # real QA test starts here # Modify as appropriate. _supported_fs xfs _require_scratch _require_v2log _require_xfs_db_command "logformat" _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" # Reformat the log with various log stripe unit sizes and see if logprint dumps # any errors. Use a cycle value larger than 1 so the log is actually written # (the log is zeroed when cycle == 1). for i in 16 32 64 128 256; do lsunit=$((i * 1024)) _scratch_xfs_db -x -c "logformat -c 3 -s $lsunit" | \ tee -a $seqres.full # don't redirect error output so it causes test failure _scratch_xfs_logprint >> $seqres.full done # success, all done status=0 exit