From fee9eb9423984397f60746ae7028753216806844 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 30 Oct 2017 16:57:55 -0700 Subject: [PATCH] test-tool/test_async_lu_reset_simple: Continue upon reconnect error Instead of stopping all tests if a reconnect fails, only stop test_async_lu_reset_simple. Signed-off-by: Bart Van Assche --- test-tool/test_async_lu_reset_simple.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test-tool/test_async_lu_reset_simple.c b/test-tool/test_async_lu_reset_simple.c index e957a5c..0a9b1cb 100644 --- a/test-tool/test_async_lu_reset_simple.c +++ b/test-tool/test_async_lu_reset_simple.c @@ -33,6 +33,8 @@ struct tests_async_reset_state { uint32_t reset_ok; }; +static int reconnect_succeeded; + static void test_async_write_cb(struct iscsi_context *iscsi __attribute__((unused)), int status, void *command_data, @@ -63,7 +65,9 @@ test_async_reset_cb(struct iscsi_context *iscsi __attribute__((unused)), struct tests_async_reset_state *state = private_data; /* command_data NULL if a reconnect occured. see iscsi_reconnect_cb() */ - CU_ASSERT_PTR_NOT_NULL_FATAL(command_data); + reconnect_succeeded = command_data != NULL; + if (!reconnect_succeeded) + return; tmf_response = *(uint32_t *)command_data; logging(LOG_VERBOSE, "LU RESET: TMF response %d for" @@ -150,6 +154,9 @@ test_async_lu_reset_simple(void) 0xffffffff, 0, test_async_reset_cb, &state); CU_ASSERT_EQUAL(ret, 0); + CU_ASSERT_EQUAL(reconnect_succeeded, 1); + if (!reconnect_succeeded) + goto out; logging(LOG_VERBOSE, "LU RESET queued"); @@ -191,6 +198,7 @@ test_async_lu_reset_simple(void) CU_FAIL("unexpected WRITE/RESET state"); } +out: scsi_free_scsi_task(state.wtask); /* Avoid that callbacks get invoked after this test finished */