overlay/075: fix wrong invocation of t_immutable

t_immutable cannot be run twice on the same test directoty, because
append-only directory tests create files in append-only.d and those
file already exist from the first run.

Use separate test directories for the first and second t_immutable runs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
diff --git a/tests/overlay/075 b/tests/overlay/075
index 5a6c3be..02df159 100755
--- a/tests/overlay/075
+++ b/tests/overlay/075
@@ -30,6 +30,7 @@
 	# we just need to remove the flags so use -R
 	$timmutable -R $upperdir/testdir &> /dev/null
 	$timmutable -R $lowerdir/testdir &> /dev/null
+	$timmutable -R $lowerdir/testdir.before &> /dev/null
 	rm -f $tmp.*
 }
 
@@ -45,13 +46,16 @@
 
 _scratch_mkfs
 
-# Preparing test area files in lower dir and check chattr support of base fs
+# Check chattr support of base fs
 mkdir -p $lowerdir
 mkdir -p $upperdir
-$timmutable -C $lowerdir/testdir >$tmp.out 2>&1
+$timmutable -C $lowerdir/testdir.before >$tmp.out 2>&1
 if grep -q -e 'Operation not supported' -e "Inappropriate ioctl" $tmp.out; then
 	_notrun "Setting immutable/append flag not supported"
 fi
+
+# Prepare test area files in lower dir
+$timmutable -C $lowerdir/testdir >$tmp.out 2>&1
 # Remove the immutable/append-only flags and create subdirs
 $timmutable -R $lowerdir/testdir >$tmp.out 2>&1
 for dir in $lowerdir/testdir/*.d; do
@@ -62,9 +66,9 @@
 
 _scratch_mount
 
-# Test immutability of files in overlay
+# Test immutability of files in overlay before copy up
 echo "Before directories copy up"
-$timmutable $SCRATCH_MNT/testdir 2>&1
+$timmutable $SCRATCH_MNT/testdir.before 2>&1
 
 # Trigger copy-up of immutable/append-only dirs by touching their subdirs
 # inode flags are not copied-up, so immutable/append-only flags are lost