summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZhao Gongyi <zhaogongyi@huawei.com>2022-11-22 14:26:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-14 12:15:17 +0300
commite1049bf0ca5b6466e5ea6e6312ef528dbe880091 (patch)
tree5047f2dd353a10211e9e777f36578d5e20a69c05 /tools
parent911773f08ce6eae9f6203a7cdb2fd27f977b07ba (diff)
downloadlinux-e1049bf0ca5b6466e5ea6e6312ef528dbe880091.tar.xz
selftests/efivarfs: Add checking of the test return value
[ Upstream commit c93924267fe6f2b44af1849f714ae9cd8117a9cd ] Add checking of the test return value, otherwise it will report success forever for test_create_read(). Fixes: dff6d2ae56d0 ("selftests/efivarfs: clean up test files from test_create*()") Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/efivarfs/efivarfs.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh
index a90f394f9aa9..d374878cc0ba 100755
--- a/tools/testing/selftests/efivarfs/efivarfs.sh
+++ b/tools/testing/selftests/efivarfs/efivarfs.sh
@@ -87,6 +87,11 @@ test_create_read()
{
local file=$efivarfs_mount/$FUNCNAME-$test_guid
./create-read $file
+ if [ $? -ne 0 ]; then
+ echo "create and read $file failed"
+ file_cleanup $file
+ exit 1
+ fi
file_cleanup $file
}