diff options
| author | ZhangXiaoxu <zhangxiaoxu5@huawei.com> | 2019-03-18 23:24:31 -0400 |
|---|---|---|
| committer | Shuah Khan <shuah@kernel.org> | 2019-04-08 18:44:21 -0400 |
| commit | f8a0590f0e01402873ec28a0da46f979f6bc56f1 (patch) | |
| tree | d4346be7aeb80812f504c84e85d2b16eb89aad10 | |
| parent | 0a7dc82ef2ed7f4c244fe55b59ea05909a408108 (diff) | |
selftests: efivarfs: remove the test_create_read file if it was exist
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>
| -rwxr-xr-x | tools/testing/selftests/efivarfs/efivarfs.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index a47029a799d2..d3866100e884 100755 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh | |||
| @@ -77,6 +77,10 @@ test_create_empty() | |||
| 77 | test_create_read() | 77 | test_create_read() |
| 78 | { | 78 | { |
| 79 | local file=$efivarfs_mount/$FUNCNAME-$test_guid | 79 | local file=$efivarfs_mount/$FUNCNAME-$test_guid |
| 80 | if [ -f $file]; then | ||
| 81 | chattr -i $file | ||
| 82 | rm -rf $file | ||
| 83 | fi | ||
| 80 | ./create-read $file | 84 | ./create-read $file |
| 81 | } | 85 | } |
| 82 | 86 | ||
