• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2020 SUSE LLC <mdoucha@suse.cz>
4#
5# Generate LTP runfile for LVM tests (runtest/lvm.local)
6
7TST_TESTFUNC=generate_runfile
8TST_NEEDS_ROOT=1
9TST_NEEDS_CMDS="sed"
10. tst_test.sh
11
12generate_runfile()
13{
14	trap 'tst_brk TBROK "Cannot create LVM runfile"' ERR
15	INFILE="$LTPROOT/testcases/data/lvm/runfile.tpl"
16	OUTFILE="$LTPROOT/runtest/lvm.local"
17	FS_LIST=`tst_supported_fs`
18	echo -n "" >"$OUTFILE"
19
20	for fsname in $FS_LIST; do
21		# Btrfs needs too much space for reliable stress testing
22		if [ "x$fsname" != "xbtrfs" ]; then
23			sed -e "s/{fsname}/$fsname/g" "$INFILE" >>"$OUTFILE"
24		fi
25	done
26
27	tst_res TPASS "Runfile $OUTFILE successfully created"
28}
29
30tst_run
31