TESTS: READ10 and STARTSTOPUNIT should fail while sanitize is in progress

Other commands should fail too  but we dont need to test them all
This commit is contained in:
Ronnie Sahlberg
2013-07-21 14:33:22 -07:00
parent 03f03ce518
commit e7df1af3b9
3 changed files with 96 additions and 1 deletions

View File

@@ -84,10 +84,21 @@ test_sanitize_reset(void)
"slow to start the SANITIZE");
sleep(3);
logging(LOG_VERBOSE, "Verify that the SANITIZE has started.");
logging(LOG_VERBOSE, "Verify that the SANITIZE has started and that "
"TESTUNITREADY fails with SANITIZE_IN_PROGRESS");
ret = testunitready_sanitize(iscsic, tgt_lun);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Verify that STARTSTOPUNIT fails with "
"SANITIZE_IN_PROGRESS");
ret = startstopunit_sanitize(iscsic, tgt_lun, 1, 0, 1, 0, 1, 0);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Verify that READ16 fails with "
"SANITIZE_IN_PROGRESS");
ret = read16_sanitize(iscsic, tgt_lun, 0, block_size,
block_size, 0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Verify that INQUIRY is still allowed while "
"SANITIZE is in progress");