overlay/040: clean up properly after setting immutable

Test program expects only immutable on lower layer (test failure),
but does not expect the immutable file to be on the upper layer.
The later case is actually what *should* happen, except overlayfs
didn't properly implement this case yet (but is now in the works).

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Miklos Szeredi
2018-04-16 12:41:40 +02:00
committed by Eryu Guan
parent a738e04549
commit c0ae9162ca
+3 -1
View File
@@ -41,7 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup() _cleanup()
{ {
cd / cd /
$CHATTR_PROG -i $lowerdir/foo $CHATTR_PROG -i $lowerdir/foo > /dev/null 2>&1
$CHATTR_PROG -i $upperdir/foo > /dev/null 2>&1
rm -f $tmp.* rm -f $tmp.*
} }
@@ -63,6 +64,7 @@ _scratch_mkfs
# prepare lower test file # prepare lower test file
lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
mkdir -p $lowerdir mkdir -p $lowerdir
touch $lowerdir/foo touch $lowerdir/foo