fstests: Make ./new work for non-root user

Currently 'new' script sources common/config which tries to find
mkfs and fails if not found (which is likely for non-root user).
This is inconvenient as development usually does not happen as root.
In fact the vast majority of setup in common/config and common/rc is
not necessary for 'new'. Split out the necessary bits into new
common/test_names and use it in 'new'. Cleanup common/rc and
common/config now that they're only used from 'check' and 'setup'.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Jan Kara
2018-05-29 18:51:19 +02:00
committed by Eryu Guan
parent c4f104cdf4
commit 141bd37a36
5 changed files with 24 additions and 42 deletions
+2 -5
View File
@@ -47,6 +47,8 @@
# validity or mountedness.
#
. common/test_names
# all tests should use a common language setting to prevent golden
# output mismatches.
export LANG=C
@@ -269,11 +271,6 @@ fi
rm -f /tmp/crc_check.img
export XFS_MKFS_HAS_NO_META_SUPPORT
# new doesn't need config file parsed, we can stop here
if [ "$iam" == "new" ]; then
return 0
fi
_mount_opts()
{
case $FSTYP in