#! /bin/bash # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2020 Oracle. All Rights Reserved. # # FS QA Test No. 526 # # Test formatting with conflicts between the config file and the cli. # 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.* $def_cfgfile } # get standard environment, filters and checks . ./common/rc . ./common/filter # remove previous $seqres.full before test rm -f $seqres.full # real QA test starts here # Modify as appropriate. _supported_fs xfs _require_test _require_scratch_nocheck _require_xfs_mkfs_cfgfile cfgfile=$TEST_DIR/a rm -rf $cfgfile # disable crc in config file, enable rmapbt (which requires crc=1) in cli cat > $cfgfile << ENDL [metadata] crc = 0 ENDL $MKFS_XFS_PROG -c options=$cfgfile -f -m rmapbt=1 $SCRATCH_DEV > $tmp.mkfs 2>&1 cat $tmp.mkfs >> $seqres.full grep 'rmapbt not supported without CRC support' $tmp.mkfs # enable rmapbt (which requires crc=1) in config file, disable crc in cli cat > $cfgfile << ENDL [metadata] rmapbt = 1 ENDL $MKFS_XFS_PROG -c options=$cfgfile -f -m crc=0 $SCRATCH_DEV > $tmp.mkfs 2>&1 cat $tmp.mkfs >> $seqres.full grep 'rmapbt not supported without CRC support' $tmp.mkfs # success, all done status=0 exit