test/bdevio: Update reset test

bdev may not support IO_TYPE_RESET, so spdk_bdev_reset
may fail and we can hit UT assert. Fix - wait for success
or failure of the reset depending on the support of reset
operation

Part of fix for issue #2454
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I6e95b6ed46bafd34cfdcc7c91ec23f974045ea95
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12248
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Alexey Marchuk 2022-04-12 19:32:25 +03:00 committed by Tomasz Zawadzki
parent 48408177b5
commit b37fe43d55

View File

@ -3,6 +3,7 @@
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -950,15 +951,17 @@ blockdev_test_reset(void)
{
struct bdevio_request req;
struct io_target *target;
bool reset_supported;
target = g_current_io_target;
req.target = target;
reset_supported = spdk_bdev_io_type_supported(target->bdev, SPDK_BDEV_IO_TYPE_RESET);
g_completion_success = false;
execute_spdk_function(__blockdev_reset, &req);
CU_ASSERT_EQUAL(g_completion_success, true);
CU_ASSERT_EQUAL(g_completion_success, reset_supported);
}
struct bdevio_passthrough_request {