提交 83eb6310 编写于 作者: Z ZhangXiaoxu 提交者: Xie XiuQi

selftests: efivarfs: remove the test_create_read file if it was exist

euler inclusion
category: bugfix
bugzilla: 12568
CVE: NA

-------------------------------------------------

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 return always return -EPERM.

Link: https://patchwork.kernel.org/patch/10858775/Signed-off-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ef04b4e6
...@@ -77,6 +77,10 @@ test_create_empty() ...@@ -77,6 +77,10 @@ test_create_empty()
test_create_read() test_create_read()
{ {
local file=$efivarfs_mount/$FUNCNAME-$test_guid local file=$efivarfs_mount/$FUNCNAME-$test_guid
if [ -f $file]; then
chattr -i $file
rm -rf $file
fi
./create-read $file ./create-read $file
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册