From: Jeremy Kerr Date: Thu, 28 Feb 2013 01:05:53 +0000 (-0800) Subject: selftests/efivarfs: add empty file creation test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=033a1a7fe7e27b9320496ca7da6905a5f654a768;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git selftests/efivarfs: add empty file creation test Signed-off-by: Jeremy Kerr Cc: Matt Fleming Cc: Lingzhu Xiang Cc: Dave Young Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index e8c0d27b381b..3af4b370e70d 100644 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh @@ -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