diff --git a/test-tool/iscsi-support.h b/test-tool/iscsi-support.h index 7e9d314..97c9e31 100644 --- a/test-tool/iscsi-support.h +++ b/test-tool/iscsi-support.h @@ -335,6 +335,20 @@ do { \ CU_ASSERT_EQUAL(_r, 0); \ } while (0); +#define READCAPACITY10(...) \ + do { \ + int _r; \ + _r = readcapacity10(__VA_ARGS__); \ + if (_r == -2) { \ + logging(LOG_NORMAL, "[SKIPPED] READCAPACITY10 " \ + "is not implemented."); \ + CU_PASS("[SKIPPED] Target does not support " \ + "READCAPACITY10. Skipping test"); \ + return; \ + } \ + CU_ASSERT_EQUAL(_r, 0); \ + } while (0); + #define READCAPACITY16(...) \ do { \ int _r; \ diff --git a/test-tool/test_readcapacity10_simple.c b/test-tool/test_readcapacity10_simple.c index 6e6f501..e56c9d9 100644 --- a/test-tool/test_readcapacity10_simple.c +++ b/test-tool/test_readcapacity10_simple.c @@ -29,13 +29,9 @@ void test_readcapacity10_simple(void) { - int ret; - - logging(LOG_VERBOSE, LOG_BLANK_LINE); logging(LOG_VERBOSE, "Test basic READCAPACITY10"); - ret = readcapacity10(sd, NULL, 0, 0, - EXPECT_STATUS_GOOD); - CU_ASSERT_EQUAL(ret, 0); + READCAPACITY10(sd, NULL, 0, 0, + EXPECT_STATUS_GOOD); }