overlay: configure TEST/SCRATCH vars to base fs

Instead of setting the vars TEST/SCRATCH_DEV to overlay base dirs,
allow setting them to block devices to configure the base fs partition,
where overlay dirs will be created.

For example, the following config file can be used to run tests on
xfs test/scratch partitions:

 TEST_DEV=/dev/sda5
 TEST_DIR=/mnt/test
 SCRATCH_DEV=/dev/sda6
 SCRATCH_MNT=/mnt/scratch
 FSTYP=xfs

Using the same config file, but executing './check -overlay' will
use the same partitions as base fs for overlayfs directories
and set TEST_DIR/SCRATCH_MNT values to overlay mount points, i.e.:
/mnt/test/ovl-mnt and /mnt/scratch/ovl-mnt.

The base fs should be pre-formatted and mounted when starting the test.
An upcoming change is going to support mount/umount of base fs.

The new vars OVL_BASE_SCRATCH_MNT/TEST_DIR are set to point at the
overlayfs base dirs in either legacy or new config method.
Tests should always use these vars and not the legacy SCRATCH/TEST_DEV
vars when referring to overlay base dir.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Amir Goldstein
2017-02-28 14:18:35 +02:00
committed by Eryu Guan
parent 6f5ba68b7b
commit bcba40e3df
5 changed files with 162 additions and 26 deletions
+1 -1
View File
@@ -258,7 +258,7 @@ while [ $# -gt 0 ]; do
-nfs) FSTYP=nfs ;;
-cifs) FSTYP=cifs ;;
-overlay) FSTYP=overlay ;;
-overlay) FSTYP=overlay; export OVERLAY=true ;;
-tmpfs) FSTYP=tmpfs ;;
-g) group=$2 ; shift ;