From 190f5712fed89cb457055317dd1e0abd46a45f92 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Mon, 4 Apr 2016 16:10:13 +0100 Subject: [PATCH] Tests: Ensure each path sends a different initiator when using multipath Tests such as ProutPreempt presume each path they have is sending a different initiator name. When using multipath this did not happen and initiatorname1 was used on all paths. Fix this by creating and initializing an array (currently size 2) of initiator names and iterating it in step with each new path we make (hopefully the compiler will complain if iscsi-test-cu ever supports more than two multipaths and there isn't a corresponding initiatorname). Signed-off-by: Sitsofe Wheeler --- test-tool/iscsi-test-cu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-tool/iscsi-test-cu.c b/test-tool/iscsi-test-cu.c index d28c382..d52b3dd 100644 --- a/test-tool/iscsi-test-cu.c +++ b/test-tool/iscsi-test-cu.c @@ -765,6 +765,7 @@ int suite_init(void) { int i; + char const *initiatornames[MPATH_MAX_DEVS] = { initiatorname1, initiatorname2 }; for (i = 0; i < mp_num_sds; i++) { if (!mp_sds[i]->iscsi_url) { @@ -774,7 +775,7 @@ suite_init(void) iscsi_logout_sync(mp_sds[i]->iscsi_ctx); iscsi_destroy_context(mp_sds[i]->iscsi_ctx); } - mp_sds[i]->iscsi_ctx = iscsi_context_login(initiatorname1, + mp_sds[i]->iscsi_ctx = iscsi_context_login(initiatornames[i], mp_sds[i]->iscsi_url, &mp_sds[i]->iscsi_lun); if (mp_sds[i]->iscsi_ctx == NULL) {