summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2025-01-19 10:12:13 -0500
committerArd Biesheuvel <ardb@kernel.org>2025-01-19 17:51:16 +0100
commitfd3aa3d5e5dbbf4254cd4ac6c550a4da671e07cc (patch)
tree0e561867761a5c713a91bb59a76e9a936a7f356b
parente7b4b1f61db79fd5a3ded518526941b0e3d70abc (diff)
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 <James.Bottomley@HansenPartnership.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rwxr-xr-xtools/testing/selftests/efivarfs/efivarfs.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh
index 96677282789b..4a84a810dc2c 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()