overlay: fix _overlay_config_override of MOUNT_OPTIONS
authorAmir Goldstein <amir73il@gmail.com>
Wed, 27 Sep 2017 07:04:12 +0000 (10:04 +0300)
committerEryu Guan <eguan@redhat.com>
Tue, 10 Oct 2017 07:44:18 +0000 (15:44 +0800)
The config variable OVERLAY_MOUNT_OPTIONS is used to configure
the overlay mount options when running ./check -overlay.
The config variable MOUNT_OPTIONS is used to configure the
mount options for base fs.

If config sets value of OVERLAY_MOUNT_OPTIONS and
does not set MOUNT_OPTIONS, the value of MOUNT_OPTIONS
may be leftover from previous _overlay_config_override, so
don't use that value for base fs mount.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/config

index 71798f0adb1ef6bab3c99bc35e88f3ae892d41c3..8844173f321843920a22c1e7d67e9aab23c9f74a 100644 (file)
@@ -532,6 +532,10 @@ _overlay_config_override()
        # Store original base fs vars
        export OVL_BASE_TEST_DEV="$TEST_DEV"
        export OVL_BASE_TEST_DIR="$TEST_DIR"
        # Store original base fs vars
        export OVL_BASE_TEST_DEV="$TEST_DEV"
        export OVL_BASE_TEST_DIR="$TEST_DIR"
+       # If config does not set MOUNT_OPTIONS, its value may be
+       # leftover from previous _overlay_config_override, so
+       # don't use that value for base fs mount
+       [ "$MOUNT_OPTIONS" != "$OVERLAY_MOUNT_OPTIONS" ] || unset MOUNT_OPTIONS
        export OVL_BASE_MOUNT_OPTIONS="$MOUNT_OPTIONS"
 
        # Set TEST vars to overlay base and mount dirs inside base fs
        export OVL_BASE_MOUNT_OPTIONS="$MOUNT_OPTIONS"
 
        # Set TEST vars to overlay base and mount dirs inside base fs