From b37fe43d55318bca9ab2f4e89ed83eb5fcc1895a Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Tue, 12 Apr 2022 19:32:25 +0300 Subject: [PATCH] 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 Change-Id: I6e95b6ed46bafd34cfdcc7c91ec23f974045ea95 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12248 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- test/bdev/bdevio/bdevio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/bdev/bdevio/bdevio.c b/test/bdev/bdevio/bdevio.c index 13c1ea1d3..012c4e707 100644 --- a/test/bdev/bdevio/bdevio.c +++ b/test/bdev/bdevio/bdevio.c @@ -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 {