selftests/efivarfs: add empty file creation test
authorJeremy Kerr <jk@ozlabs.org>
Thu, 28 Feb 2013 01:05:53 +0000 (17:05 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Feb 2013 03:10:24 +0000 (19:10 -0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Lingzhu Xiang <lxiang@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/efivarfs/efivarfs.sh

index e8c0d27b381bb2d8e4e2bb914185158e0f188d39..3af4b370e70d1c9dcc67466585b22c665a0e4545 100644 (file)
@@ -58,6 +58,18 @@ test_create()
        fi
 }
 
+test_create_empty()
+{
+       local file=$efivarfs_mount/$FUNCNAME-$test_guid
+
+       : > $file
+
+       if [ ! -e $file ]; then
+               echo "$file can not be created without writing" >&2
+               exit 1
+       fi
+}
+
 test_delete()
 {
        local attrs='\x07\x00\x00\x00'
@@ -112,6 +124,7 @@ check_prereqs
 rc=0
 
 run_test test_create
+run_test test_create_empty
 run_test test_delete
 run_test test_zero_size_delete
 run_test test_open_unlink