Skip to content

Commit fd3aa3d

Browse files
James Bottomleyardbiesheuvel
authored andcommitted
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>
1 parent e7b4b1f commit fd3aa3d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tools/testing/selftests/efivarfs/efivarfs.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ test_create_empty()
7676

7777
: > $file
7878

79-
if [ ! -e $file ]; then
80-
echo "$file can not be created without writing" >&2
79+
if [ -e $file ]; then
80+
echo "$file can be created without writing" >&2
81+
file_cleanup $file
8182
exit 1
8283
fi
83-
file_cleanup $file
8484
}
8585

8686
test_create_read()
@@ -89,10 +89,13 @@ test_create_read()
8989
./create-read $file
9090
if [ $? -ne 0 ]; then
9191
echo "create and read $file failed"
92+
exit 1
93+
fi
94+
if [ -e $file ]; then
95+
echo "file still exists and should not"
9296
file_cleanup $file
9397
exit 1
9498
fi
95-
file_cleanup $file
9699
}
97100

98101
test_delete()

0 commit comments

Comments
 (0)