From 43b47cf1fb164019c82699572913a7a9f7d282ea Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 28 May 2015 13:52:01 +0200 Subject: [PATCH] test/multipath: add MPATH_SKIP_IF_UNAVAILABLE macro Check whether multiple SCSI device paths are available, if not then skip the test. Signed-off-by: David Disseldorp --- test-tool/iscsi-multipath.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test-tool/iscsi-multipath.h b/test-tool/iscsi-multipath.h index 689276d..5090503 100644 --- a/test-tool/iscsi-multipath.h +++ b/test-tool/iscsi-multipath.h @@ -24,6 +24,17 @@ extern int mp_num_sds; extern struct scsi_device *mp_sds[MPATH_MAX_DEVS]; +#define MPATH_SKIP_IF_UNAVAILABLE(_sds, _num_sds) \ +do { \ + if (_num_sds <= 1) { \ + logging(LOG_NORMAL, "[SKIPPED] Multipath unavailable." \ + " Skipping test"); \ + CU_PASS("[SKIPPED] Multipath unavailable." \ + " Skipping test"); \ + return; \ + } \ +} while (0); + int mpath_check_matching_ids(int num_sds, struct scsi_device **sds);