test/multipath: add helper to check that all paths are iSCSI

MPATH_SKIP_UNLESS_ISCSI(_sds, _num_sds) iterates over all _sds, and
skips the test unless all paths are iSCSI based.

Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2015-09-17 18:03:41 +02:00
parent 2e59742b1f
commit 6b3ee9931a
2 changed files with 33 additions and 3 deletions

View File

@@ -369,3 +369,19 @@ mpath_check_matching_ids(int num_sds,
ret = mpath_check_matching_ids_serial_vpd(num_sds, sds);
return ret;
}
int
mpath_count_iscsi(int num_sds,
struct scsi_device **sds)
{
int i;
int found = 0;
for (i = 0; i < num_sds; i++) {
if (sds[i]->iscsi_ctx != NULL) {
found++;
}
}
return found;
}