1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
#!/bin/sh
# TEST: Branches b0,b1,b2 and b0,b1=ro,b2=ro
# TEST: mkdir A
# TEST: Where A is in the same branch
# TEST: Where A already exists as a whiteout on the same branch
# TEST: Where A already exists as a whiteout on the same branch and there are
# pre-existing entries to the right
#
# TEST: Where A is on a RO branch
# TEST: Where A exists as a whiteout on a RO branch
# TEST: Where A already exists as a whiteout on the same branch and there are
# pre-existing entries to the right
source scaffold
# initial directories
function directories {
cat <<FILES
d $LOWER_DIR
d $LOWER_DIR/b0
d $LOWER_DIR/b0/d1
d $LOWER_DIR/b0/d1/d2
d $LOWER_DIR/b0/d6
d $LOWER_DIR/b1
d $LOWER_DIR/b1/d5
d $LOWER_DIR/b1/d1
d $LOWER_DIR/b1/d1/x
d $LOWER_DIR/b1/d1/d2
d $LOWER_DIR/b1/d1/d2/d3
d $LOWER_DIR/b2
d $LOWER_DIR/b2/d5
d $LOWER_DIR/b2/d1
d $LOWER_DIR/b2/d1/d2
d $LOWER_DIR/b2/d1/d2/d3
f $LOWER_DIR/b2/d1/d2/d3/a
f $LOWER_DIR/b2/d1/d2/d3/b
f $LOWER_DIR/b2/d1/d2/d3/c
d $LOWER_DIR/b2/d1/d2/d3/d4
FILES
}
# initial set of files
function beforefiles {
cat <<FILES
f $LOWER_DIR/b0/d1/.wh.x
f $LOWER_DIR/b2/d1/d2/d3/d4/.wh.d
FILES
}
function beforefiles_383 {
cat <<FILES
f $LOWER_DIR/b1/y
FILES
}
function afterfiles_383 {
cat <<FILES
f $LOWER_DIR/b0/y
f $LOWER_DIR/b1/y
FILES
}
function afterfiles_rw {
cat <<FILES
f $LOWER_DIR/b0/y
f $LOWER_DIR/b0/d1/x
f $LOWER_DIR/b2/d1/d2/d3/d4/d
FILES
}
function afterfiles_ro {
cat <<FILES
f $LOWER_DIR/b0/y
f $LOWER_DIR/b0/d1/x
d $LOWER_DIR/b0/d1/d2/d3
d $LOWER_DIR/b0/d1/d2/d3/d4
f $LOWER_DIR/b0/d1/d2/d3/d4/d
f $LOWER_DIR/b2/d1/d2/d3/d4/.wh.d
FILES
}
function rw {
( directories ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR/b0 $LOWER_DIR/b1 $LOWER_DIR/b2
touch $MOUNTPOINT/y
checktype $MOUNTPOINT/y 'f'
touch $MOUNTPOINT/d1/x
checktype $MOUNTPOINT/d1/x 'f'
touch $MOUNTPOINT/d1/d2/d3/d4/d
checktype $MOUNTPOINT/d1/d2/d3/d4/d 'f'
unmount_union
( directories ; afterfiles_rw ) | check_hierarchy $LOWER_DIR
}
function ro {
( directories ; beforefiles) | create_hierarchy
mount_union "" $LOWER_DIR/b0 $LOWER_DIR/b1=ro $LOWER_DIR/b2=ro
touch $MOUNTPOINT/y
checktype $MOUNTPOINT/y 'f'
touch $MOUNTPOINT/d1/x
checktype $MOUNTPOINT/d1/x 'f'
touch $MOUNTPOINT/d1/d2/d3/d4/d
checktype $MOUNTPOINT/d1/d2/d3/d4/d 'f'
unmount_union
( directories ; afterfiles_ro ) | check_hierarchy $LOWER_DIR
}
function BUG383 {
( directories ; beforefiles_383 ) | create_hierarchy
mount_union "" $LOWER_DIR/b0 $LOWER_DIR/b1=ro $LOWER_DIR/b2=ro
local SM=`umask`
umask 022
checktype $MOUNTPOINT/y 'f'
checkperms $MOUNTPOINT/y 644
chmod 421 $MOUNTPOINT/y
checkperms $MOUNTPOINT/y 421
rm -f $MOUNTPOINT/y
checktype $MOUNTPOINT/y '-'
umask 026
touch $MOUNTPOINT/y
checktype $MOUNTPOINT/y 'f'
checkperms $MOUNTPOINT/y 640
umask $SM
unmount_union
( directories ; afterfiles_383 ) | check_hierarchy $LOWER_DIR
}
if [ -z "$FXNS" ] ; then
FXNS="rw ro BUG383"
fi
for x in $FXNS
do
$x
echo -n "[$x] "
done
complete_test
|