d $LOWER_DIR0/D
d $LOWER_DIR2/D
-f $LOWER_DIR0/.wh.a
+w $LOWER_DIR0 a
f $LOWER_DIR1/a
f $LOWER_DIR2/a
FILES
}
+init_odf $LOWER_DIR0 $LOWER_DIR1=ro $LOWER_DIR2=ro
( files ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1=ro $LOWER_DIR2=ro
expected_output > /tmp/.expected.$$
rm -f /tmp/.expected.$$ /tmp/.saveout.$$
test $result != 0 && exit $result
-( files ; afterfiles ) | check_hierarchy $TOP_LOWER_DIR
+( files ; afterfiles ) | check_hierarchy
+discard_odf
complete_test
f $LOWER_DIR1/d5/d
f $LOWER_DIR0/d1/f
-f $LOWER_DIR0/d1/.wh.g
+w $LOWER_DIR0 d1/g
-f $LOWER_DIR0/d1/.wh.h
+w $LOWER_DIR0 d1/h
f $LOWER_DIR1/d1/i
f $LOWER_DIR0/d6/x
}
function rw {
+ init_odf $LOWER_DIR0 $LOWER_DIR1
( directories ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1
link $MOUNTPOINT/d7/j $MOUNTPOINT/d8/k
unmount_union
- ( directories ; afterfiles_rw ) | check_hierarchy $TOP_LOWER_DIR
+ ( directories ; afterfiles_rw ) | check_hierarchy
+ discard_odf
}
function onelink {
+ init_odf $LOWER_DIR0 $LOWER_DIR1
( directories ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1
link $MOUNTPOINT/a $MOUNTPOINT/k
unmount_union
- ( directories ; afterfiles_onelink ) | check_hierarchy $TOP_LOWER_DIR
+ ( directories ; afterfiles_onelink ) | check_hierarchy
+ discard_odf
}
function ro {
+ init_odf $LOWER_DIR0 $LOWER_DIR1=ro
( directories ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1=ro
link $MOUNTPOINT/d7/j $MOUNTPOINT/d8/k
unmount_union
- ( directories ; afterfiles_ro ) | check_hierarchy $TOP_LOWER_DIR
+ ( directories ; afterfiles_ro ) | check_hierarchy
+ discard_odf
}
function BUG391 {
+ init_odf $LOWER_DIR0 $LOWER_DIR1=ro
( directories ; beforefiles_391) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1=ro
checktype $MOUNTPOINT/d/b 'f'
unmount_union
- ( directories ; afterfiles_391) | check_hierarchy $TOP_LOWER_DIR
+ ( directories ; afterfiles_391) | check_hierarchy
+ discard_odf
}
if [ -z "$FXNS" ] ; then
# read-only mmap test
function test_ro {
+ init_odf
( files ) | create_hierarchy
dd if=/dev/zero of=$LOWER_DIR0/a bs=4096 count=4 2>/dev/null
dd if=/dev/zero of=$LOWER_DIR1/b bs=4096 count=4 2>/dev/null
./progs/mapper -r $MOUNTPOINT/b > /dev/null || exit $?
unmount_union
echo -n "[ro] "
- ( afterfiles_ro ) | check_hierarchy $TOP_LOWER_DIR
+ ( afterfiles_ro ) | check_hierarchy
+ discard_odf
}
# read-write mmap test
function test_rw {
+ init_odf
( files ) | create_hierarchy
dd if=/dev/zero of=$LOWER_DIR0/a bs=4096 count=4 2>/dev/null
dd if=/dev/zero of=$LOWER_DIR1/b bs=4096 count=4 2>/dev/null
./progs/mapper -w $MOUNTPOINT/b > /dev/null || exit $?
echo -n "[rw] "
unmount_union
- ( afterfiles_rw ) | check_hierarchy $TOP_LOWER_DIR
+ ( afterfiles_rw ) | check_hierarchy
+ discard_odf
}
test_ro
f $LOWER_DIR2/rA.D
f $LOWER_DIR1/rB.D
-f $LOWER_DIR1/.wh.rB.S
-f $LOWER_DIR2/rB.S
-f $LOWER_DIR0/.wh.rC.S
f $LOWER_DIR0/rC.D
-f $LOWER_DIR1/rC.S
-f $LOWER_DIR0/.wh.rD.S
f $LOWER_DIR0/rD.D
-f $LOWER_DIR1/rD.S
f $LOWER_DIR2/rD.D
f $LOWER_DIR1/rE.D
-f $LOWER_DIR1/.wh.rE.S
-f $LOWER_DIR2/rE.S
f $LOWER_DIR2/rE.D
f $LOWER_DIR2/rF.D
f $LOWER_DIR2/rG.D
-f $LOWER_DIR0/.wh.rH.S
-f $LOWER_DIR1/rH.S
-f $LOWER_DIR2/rH.S
f $LOWER_DIR0/rH.D
f $LOWER_DIR1/rH.D
f $LOWER_DIR2/rH.D
-f $LOWER_DIR0/.wh.rI.S
+w $LOWER_DIR0 rI.S
f $LOWER_DIR1/rI.S
f $LOWER_DIR2/rI.S
f $LOWER_DIR0/rI.D
f $LOWER_DIR1/rI.D
f $LOWER_DIR2/rI.D
FILES
+if [ $ODF -eq 1 ];then
+cat<<FILES
+f $LOWER_DIR0/rF.D
+f $LOWER_DIR0/rG.D
+f $LOWER_DIR1/rC.D
+f $LOWER_DIR1/rD.D
+f $LOWER_DIR1/rF.D
+f $LOWER_DIR2/rB.D
+FILES
+else
+cat<<FILES
+f $LOWER_DIR1/rC.S
+f $LOWER_DIR1/rD.S
+f $LOWER_DIR1/rH.S
+f $LOWER_DIR2/rB.S
+f $LOWER_DIR2/rE.S
+f $LOWER_DIR2/rH.S
+w $LOWER_DIR1 rB.S
+w $LOWER_DIR0 rC.S
+w $LOWER_DIR0 rD.S
+w $LOWER_DIR1 rE.S
+w $LOWER_DIR0 rH.S
+FILES
+fi
}
function afterfiles_ro {
cat <<FILES
-f $LOWER_DIR0/.wh.rA.S
+w $LOWER_DIR0 rA.S
f $LOWER_DIR0/rA.D
f $LOWER_DIR2/rA.S
-f $LOWER_DIR0/.wh.rB.S
+w $LOWER_DIR0 rB.S
f $LOWER_DIR0/rB.D
f $LOWER_DIR1/rB.S
f $LOWER_DIR2/rB.S
f $LOWER_DIR0/rC.D
-f $LOWER_DIR0/.wh.rC.S
+w $LOWER_DIR0 rC.S
f $LOWER_DIR1/rC.S
f $LOWER_DIR0/rD.D
-f $LOWER_DIR0/.wh.rD.S
+w $LOWER_DIR0 rD.S
f $LOWER_DIR1/rD.S
f $LOWER_DIR2/rD.D
f $LOWER_DIR0/rE.D
-f $LOWER_DIR0/.wh.rE.S
+w $LOWER_DIR0 rE.S
f $LOWER_DIR1/rE.S
f $LOWER_DIR2/rE.S
f $LOWER_DIR2/rE.D
-f $LOWER_DIR0/.wh.rF.S
+w $LOWER_DIR0 rF.S
f $LOWER_DIR0/rF.D
f $LOWER_DIR2/rF.S
f $LOWER_DIR1/rF.D
f $LOWER_DIR2/rF.D
-f $LOWER_DIR0/.wh.rG.S
+w $LOWER_DIR0 rG.S
f $LOWER_DIR2/rG.S
f $LOWER_DIR0/rG.D
f $LOWER_DIR2/rG.D
-f $LOWER_DIR0/.wh.rH.S
+w $LOWER_DIR0 rH.S
f $LOWER_DIR1/rH.S
f $LOWER_DIR2/rH.S
f $LOWER_DIR0/rH.D
f $LOWER_DIR1/rH.D
f $LOWER_DIR2/rH.D
-f $LOWER_DIR0/.wh.rI.S
+w $LOWER_DIR0 rI.S
f $LOWER_DIR1/rI.S
f $LOWER_DIR2/rI.S
f $LOWER_DIR0/rI.D
for STATE in rw ro
do
+ init_odf
( files ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1=$STATE $LOWER_DIR2=$STATE
for X in A B C D E F G H I
done
unmount_union
- ( files ; afterfiles_$STATE ) | check_hierarchy $TOP_LOWER_DIR
+ ( files ; afterfiles_$STATE ) | check_hierarchy
+ discard_odf
echo -n "[$STATE] "
done
# XXX: should we check if all lower branches have chattr?
if havechattr $LOWER_DIR0 ; then
+ init_odf
( files ; beforefiles_fail) | create_hierarchy
mount_union "" $LOWER_DIR0 $LOWER_DIR1 $LOWER_DIR2
for X in J
checktype "$MOUNTPOINT/r$X.D" '-'
done
unmount_union
- ( files ; afterfiles_fail ) | check_hierarchy $TOP_LOWER_DIR
+ ( files ; afterfiles_fail ) | check_hierarchy
+ discard_odf
fi
complete_test