From f8a0590f0e01402873ec28a0da46f979f6bc56f1 Mon Sep 17 00:00:00 2001 From: ZhangXiaoxu Date: Tue, 19 Mar 2019 11:24:31 +0800 Subject: 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 --- tools/testing/selftests/efivarfs/efivarfs.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/testing/selftests/efivarfs') 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() test_create_read() { local file=$efivarfs_mount/$FUNCNAME-$test_guid + if [ -f $file]; then + chattr -i $file + rm -rf $file + fi ./create-read $file } -- cgit v1.2.3-59-g8ed1b