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 <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2015-05-28 13:52:01 +02:00
parent 024fe873e3
commit 43b47cf1fb

View File

@@ -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);