Lines Matching +full:close +full:- +full:range
2 # SPDX-License-Identifier: GPL-2.0
5 test_guid=210be57c-9849-4fc7-a635-e6382d1aec27
7 # Kselftest framework requirement - SKIP code is 4.
12 chattr -i $1
13 rm -f $1
25 if ! grep -q "^\S\+ $efivarfs_mount efivarfs" /proc/mounts; then
35 echo "--------------------"
37 echo "--------------------"
39 if [ "$(type -t $test)" = 'function' ]; then
45 if [ $? -ne 0 ]; then
56 local file=$efivarfs_mount/$FUNCNAME-$test_guid
60 if [ ! -e $file ]; then
65 if [ $(stat -c %s $file) -ne 5 ]; then
75 local file=$efivarfs_mount/$FUNCNAME-$test_guid
79 if [ -e $file ]; then
88 local file=$efivarfs_mount/$FUNCNAME-$test_guid
89 ./create-read $file
90 if [ $? -ne 0 ]; then
94 if [ -e $file ]; then
104 local file=$efivarfs_mount/$FUNCNAME-$test_guid
108 if [ ! -e $file ]; then
115 if [ -e $file ]; then
127 local file=$efivarfs_mount/$FUNCNAME-$test_guid
131 if [ ! -e $file ]; then
136 chattr -i $file
139 if [ -e $file ]; then
147 local file=$efivarfs_mount/$FUNCNAME-$test_guid
148 ./open-unlink $file
151 # test that we can create a range of filenames
157 local file_list="abc dump-type0-11-1-1362436005 1234 -"
159 local file=$efivarfs_mount/$f-$test_guid
163 if [ ! -e $file ]; then
180 -1234-1234-1234-123456789abc
182 foo-bar
183 -foo-
184 foo-barbazba-foob-foob-foob-foobarbazfoo
185 foo-------------------------------------
186 -12345678-1234-1234-1234-123456789abc
187 a-12345678=1234-1234-1234-123456789abc
188 a-12345678-1234=1234-1234-123456789abc
189 a-12345678-1234-1234=1234-123456789abc
190 a-12345678-1234-1234-1234=123456789abc
191 1112345678-1234-1234-1234-123456789abc"
198 if [ -e $file ]; then
211 local file=$efivarfs_mount/$FUNCNAME-$test_guid
215 [ -e $file -a -s $file ] || exit 1
216 chattr -i $file
221 elif [ -e $file -a ! -s $file ]; then
233 # we're going to do multi-threaded tests, so create a set of
240 declare -ag p
250 declare -g var=$efivarfs_mount/test_multiple-$test_guid
254 rm -f ${f}
256 if [ -e $var ]; then
273 wait -n %$1
280 # check for remove on last close, set up three threads all
282 # close them sequentially (waiting for completion) and check
289 [ -e $var ] || exit 1
290 # second and third delayed close
295 # close first fd
297 # var should only be deleted on last close
298 [ -e $var ] || exit 1
299 # close second fd
301 [ -e $var ] || exit 1
302 # file should go on last close
304 [ ! -e $var ] || exit 1
311 # the final write to check the close of 2 and 3. The
316 [ -e $var -a ! -s $var ] || exit 1
321 # close second and third fds
323 # var should only be created (have size) on last close
324 [ -e $var -a ! -s $var ] || exit 1
326 [ -e $var -a ! -s $var ] || exit 1
327 # close first fd
330 [ -s $var ] || exit 1
340 chattr -i $var
343 [ -e $var -a -s $var ] || exit 1
348 # close first fd; write should set variable size to zero
350 # var should only be deleted on last close
351 [ -e $var -a ! -s $var ] || exit 1
353 [ -e $var ] || exit 1
354 # close last fd
357 [ ! -e $var ] || exit 1