]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/efivarfs: fix tests for failed write removal
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 19 Jan 2025 15:12:13 +0000 (10:12 -0500)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 19 Jan 2025 16:51:16 +0000 (17:51 +0100)
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 <James.Bottomley@HansenPartnership.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
tools/testing/selftests/efivarfs/efivarfs.sh

index 96677282789b1bbac0a7a4457024657e49b53fe2..4a84a810dc2cf7e83779b7840190608dd4b1c332 100755 (executable)
@@ -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()