From: ZhangXiaoxu Date: Tue, 19 Mar 2019 03:24:31 +0000 (+0800) Subject: selftests: efivarfs: remove the test_create_read file if it was exist X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f8a0590f0e01402873ec28a0da46f979f6bc56f1;p=linux.git 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 Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index a47029a799d2c..d3866100e8849 100755 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh @@ -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 }