Commit b37fe43d authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

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: default avatarAlexey 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 48408177
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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 {