check: source common/rc again if TEST_DEV was recreated
authorEryu Guan <eguan@redhat.com>
Fri, 4 Dec 2020 10:43:53 +0000 (16:13 +0530)
committerEryu Guan <guaneryu@gmail.com>
Sun, 6 Dec 2020 14:15:08 +0000 (22:15 +0800)
commit4767884aff19e042ee3be51c88cf2c27a111707e
tree811bf1be67f44d1feb095dce8ec3c1bca58f8507
parentee4281bfe37c089b970c08a5d665809e8ecb8120
check: source common/rc again if TEST_DEV was recreated

If TEST_DEV is recreated by check, FSTYP derived from TEST_DEV
previously could be changed too and might not reflect the reality.
So source common/rc again with correct FSTYP to get fs-specific
configs, e.g. common/xfs.

For example, using this config-section config file, and run section
ext4 first then xfs, you can see:

our local _scratch_mkfs routine ...
./common/rc: line 825: _scratch_mkfs_xfs: command not found
check: failed to mkfs $SCRATCH_DEV using specified options

local.config:
[default]
RECREATE_TEST_DEV=true
TEST_DEV=/dev/sda5
SCRATCH_DEV=/dev/sda6
TEST_DIR=/mnt/test
SCRATCH_MNT=/mnt/scratch

[ext4]
MKFS_OPTIONS="-b 4096"
FSTYP=ext4

[xfs]
FSTYP=xfs
MKFS_OPTIONS="-f -b size=4k"

Tested-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
check