1#!/bin/sh -e 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2020 SUSE LLC <[email protected]> 4# Copyright (c) Linux Test Project, 2020-2022 5# 6# Generate LTP runfile for LVM tests (runtest/lvm.local) 7 8TST_TESTFUNC=generate_runfile 9TST_NEEDS_ROOT=1 10TST_NEEDS_CMDS="sed" 11 12LVM_DIR="${LVM_DIR:-/tmp}" 13LVM_TMPDIR="$LVM_DIR/ltp/growfiles" 14 15generate_runfile() 16{ 17 trap '[ $? -eq 0 ] || tst_brk TBROK "Cannot create LVM runfile"' EXIT 18 INFILE="$LTPROOT/testcases/data/lvm/runfile.tpl" 19 OUTFILE="$LTPROOT/runtest/lvm.local" 20 FS_LIST=$(tst_supported_fs -s tmpfs) 21 echo -n "" >"$OUTFILE" 22 23 for fsname in $FS_LIST; do 24 # Btrfs needs too much space for reliable stress testing 25 if [ "x$fsname" != "xbtrfs" ]; then 26 sed -e "s/{fsname}/$fsname/g; s^{tempdir}^$LVM_TMPDIR^g" "$INFILE" >>"$OUTFILE" 27 fi 28 done 29 30 tst_res TPASS "Runfile $OUTFILE successfully created" 31} 32 33. tst_test.sh 34tst_run 35