From 04f7575bc45ffece4ce2757ba1f9c15d6d3aaebf Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 24 May 2019 09:19:31 -0400 Subject: [PATCH] test/bdevio: test functions now execute test calls directly Before simplifying test suite execution it was needed to loop around function actually running the tests. So the test functions now can directly contain whatever that was doing, without intermidiate function between. Change-Id: Ic4b648d8d26d6be7a3bf1efb1b1ee3f2615ee5fa Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455672 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk --- test/bdev/bdevio/bdevio.c | 40 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/test/bdev/bdevio/bdevio.c b/test/bdev/bdevio/bdevio.c index b50ec0f16..8d5e23c57 100644 --- a/test/bdev/bdevio/bdevio.c +++ b/test/bdev/bdevio/bdevio.c @@ -810,24 +810,18 @@ __blockdev_reset(void *arg1, void *arg2) } static void -blockdev_reset(struct io_target *target) +blockdev_test_reset(void) { struct bdevio_request req; + struct io_target *target; + target = g_current_io_target; req.target = target; g_completion_success = false; execute_spdk_function(__blockdev_reset, &req, NULL); -} -static void -blockdev_test_reset(void) -{ - struct io_target *target; - - target = g_current_io_target; - blockdev_reset(target); /* Workaround: NVMe-oF target doesn't support reset yet - so for now * don't fail the test if it's an NVMe bdev. */ @@ -871,10 +865,13 @@ __blockdev_nvme_passthru(void *arg1, void *arg2) } static void -blockdev_nvme_passthru_rw(struct io_target *target) +blockdev_test_nvme_passthru_rw(void) { struct bdevio_passthrough_request pt_req; void *write_buf, *read_buf; + struct io_target *target; + + target = g_current_io_target; if (!spdk_bdev_io_type_supported(target->bdev, SPDK_BDEV_IO_TYPE_NVME_IO)) { return; @@ -914,18 +911,12 @@ blockdev_nvme_passthru_rw(struct io_target *target) } static void -blockdev_test_nvme_passthru_rw(void) -{ - struct io_target *target; - - target = g_current_io_target; - blockdev_nvme_passthru_rw(target); -} - -static void -blockdev_nvme_passthru_vendor_specific(struct io_target *target) +blockdev_test_nvme_passthru_vendor_specific(void) { struct bdevio_passthrough_request pt_req; + struct io_target *target; + + target = g_current_io_target; if (!spdk_bdev_io_type_supported(target->bdev, SPDK_BDEV_IO_TYPE_NVME_IO)) { return; @@ -943,15 +934,6 @@ blockdev_nvme_passthru_vendor_specific(struct io_target *target) CU_ASSERT(pt_req.sc == SPDK_NVME_SC_INVALID_OPCODE); } -static void -blockdev_test_nvme_passthru_vendor_specific(void) -{ - struct io_target *target; - - target = g_current_io_target; - blockdev_nvme_passthru_vendor_specific(target); -} - static void __stop_init_thread(void *arg1, void *arg2) {