More tests made generic:
authorRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Sun, 21 Oct 2007 07:50:43 +0000 (03:50 -0400)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Sun, 21 Oct 2007 07:50:43 +0000 (03:50 -0400)
1)ioctl
2)link
3)mmap
4)rename-whiteout

t-ioctl.sh
t-link.sh
t-mmap.sh
t-rename-whiteout.sh

index 5ea5df4586e2223951076e63e08002dde0b15810..a07198c0f7afe77a3c6fc9fb4f213c3da2a10072 100755 (executable)
@@ -19,7 +19,7 @@ cat <<FILES
 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
 
@@ -46,6 +46,7 @@ Unable to retrieve list of branches for /mnt/unionfs/a: No such file or director
 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.$$
@@ -64,6 +65,7 @@ result=$?
 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
 
index 6914e12ad37434985259dd83206f621208af6386..6b62143fb0617ac845ef1327c1d2da1d741f0bb1 100755 (executable)
--- a/t-link.sh
+++ b/t-link.sh
@@ -46,9 +46,9 @@ f $LOWER_DIR0/c
 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
@@ -153,6 +153,7 @@ FILES
 }
 
 function rw {
+       init_odf $LOWER_DIR0 $LOWER_DIR1
        ( directories ; beforefiles) | create_hierarchy
 
        mount_union "" $LOWER_DIR0 $LOWER_DIR1
@@ -168,10 +169,12 @@ function rw {
        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
@@ -179,10 +182,12 @@ function onelink {
        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
@@ -197,10 +202,12 @@ function 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
@@ -211,7 +218,8 @@ function BUG391 {
        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
index 4d4af5027dc817dc424e1bd7e721bb8abd2bc5ed..9868bf0bbd51ad15d9765790541f717cd2923eae 100755 (executable)
--- a/t-mmap.sh
+++ b/t-mmap.sh
@@ -44,6 +44,7 @@ FILES
 
 # 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
@@ -52,11 +53,13 @@ function test_ro {
     ./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
@@ -65,7 +68,8 @@ function test_rw {
     ./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
index 19cfc63bf6c88edd46bf5efb26f504ec858d8c55..18b37c75c7cfb8332973e0e5a839b05c20f562d9 100755 (executable)
@@ -95,88 +95,101 @@ cat <<FILES
 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
@@ -201,6 +214,7 @@ FILES
 
 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
@@ -212,14 +226,16 @@ do
        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
@@ -229,7 +245,8 @@ if havechattr $LOWER_DIR0 ; then
                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