From 705bc27ed5e82aa4b852fb9ba992a6031f0b185e Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 5 Jul 2013 16:43:28 -0700 Subject: [PATCH] TESTS: Verify that WACEREQ is 0 if SANITIZE CRYPTO ERASE is not supported --- test-tool/test_sanitize_block_erase.c | 3 +-- test-tool/test_sanitize_crypto_erase.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test-tool/test_sanitize_block_erase.c b/test-tool/test_sanitize_block_erase.c index 0ea9f97..a7ee723 100644 --- a/test-tool/test_sanitize_block_erase.c +++ b/test-tool/test_sanitize_block_erase.c @@ -214,8 +214,7 @@ test_sanitize_block_erase(void) CU_FAIL("[FAILED] WABEREQ is not 0 but BLOCK ERASE " "is not supported."); } - } - if (cd == NULL) { + logging(LOG_NORMAL, "[SKIPPED] SANITIZE BLOCK_ERASE is not " "implemented according to REPORT_SUPPORTED_OPCODES."); CU_PASS("SANITIZE is not implemented."); diff --git a/test-tool/test_sanitize_crypto_erase.c b/test-tool/test_sanitize_crypto_erase.c index dee6ae1..6ef8742 100644 --- a/test-tool/test_sanitize_crypto_erase.c +++ b/test-tool/test_sanitize_crypto_erase.c @@ -115,6 +115,16 @@ test_sanitize_crypto_erase(void) cd = get_command_descriptor(SCSI_OPCODE_SANITIZE, SCSI_SANITIZE_CRYPTO_ERASE); if (cd == NULL) { + logging(LOG_VERBOSE, "Opcode is not supported. Verify that " + "WACEREQ is zero."); + if (inq_bdc && inq_bdc->wacereq) { + logging(LOG_NORMAL, "[FAILED] WACEREQ is not 0 but " + "SANITIZE CRYPTO ERASE opcode is not " + "supported"); + CU_FAIL("[FAILED] WACEREQ is not 0 but CRYPTO ERASE " + "is not supported."); + } + logging(LOG_NORMAL, "[SKIPPED] SANITIZE CRYPTO_ERASE is not " "implemented according to REPORT_SUPPORTED_OPCODES."); CU_PASS("SANITIZE is not implemented.");