Skip to content

Commit

Permalink
selftests: efivarfs: remove the test_create_read file if it was exist
Browse files Browse the repository at this point in the history
After the first run, the test case 'test_create_read' will always
fail because the file is exist and file's attr is 'S_IMMUTABLE',
open with 'O_RDWR' will always return -EPERM.

Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>
  • Loading branch information
ZhangXiaoxu authored and Shuah Khan committed Apr 8, 2019
1 parent 0a7dc82 commit f8a0590
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/efivarfs/efivarfs.sh
Original file line number Diff line number Diff line change
@@ -77,6 +77,10 @@ test_create_empty()
test_create_read()
{
local file=$efivarfs_mount/$FUNCNAME-$test_guid
if [ -f $file]; then
chattr -i $file
rm -rf $file
fi
./create-read $file
}

0 comments on commit f8a0590

Please sign in to comment.