From: James Bottomley Date: Sun, 19 Jan 2025 15:12:13 +0000 (-0500) Subject: selftests/efivarfs: fix tests for failed write removal X-Git-Tag: v6.14-rc1~99^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd3aa3d5e5dbbf4254cd4ac6c550a4da671e07cc;p=thirdparty%2Flinux.git selftests/efivarfs: fix tests for failed write removal The current self tests expect the zero size remnants that failed variable creation leaves. Update the tests to verify these are now absent. Signed-off-by: James Bottomley Signed-off-by: Ard Biesheuvel --- diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index 96677282789b1..4a84a810dc2cf 100755 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh @@ -76,11 +76,11 @@ test_create_empty() : > $file - if [ ! -e $file ]; then - echo "$file can not be created without writing" >&2 + if [ -e $file ]; then + echo "$file can be created without writing" >&2 + file_cleanup $file exit 1 fi - file_cleanup $file } test_create_read() @@ -89,10 +89,13 @@ test_create_read() ./create-read $file if [ $? -ne 0 ]; then echo "create and read $file failed" + exit 1 + fi + if [ -e $file ]; then + echo "file still exists and should not" file_cleanup $file exit 1 fi - file_cleanup $file } test_delete()