From 2600e538d8886ac1b65a3733dd5de597d3b9e2fe Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Wed, 18 Sep 2019 16:17:20 +0200 Subject: [PATCH] test-tool: add CHECK_FOR_ISCSI() test filter macro Skip the test if the provided iscsi_ctx is null. Signed-off-by: David Disseldorp --- test-tool/iscsi-support.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test-tool/iscsi-support.h b/test-tool/iscsi-support.h index 2b20a1f..7aa9e45 100644 --- a/test-tool/iscsi-support.h +++ b/test-tool/iscsi-support.h @@ -186,6 +186,16 @@ do { \ } \ } while (0); +#define CHECK_FOR_ISCSI(_sd) \ +do { \ + if (_sd->iscsi_ctx == NULL) { \ + logging(LOG_NORMAL, "[SKIPPED] Not an iSCSI device." \ + " Skipping test"); \ + CU_PASS("[SKIPPED] Not an iSCSI device. Skipping test"); \ + return; \ + } \ +} while (0); + #define CHECK_SIZE(_min_blocks, _c) \ do { \ if (num_blocks < _min_blocks) { \