TESTS: WriteAtomic fixes to handle devices that do not return BlockLimits VPD
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -31,7 +31,13 @@ test_writeatomic16_0blocks(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
if (!inq_bl) {
|
||||
CU_PASS("BlockLimits VPD is not available. Skipping test.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
|
||||
align = inq_bl->atomic_align ? inq_bl->atomic_align : 1;
|
||||
logging(LOG_VERBOSE, "Test WRITEATOMIC16 0-blocks at LBA==0");
|
||||
ret = writeatomic16(sd, 0, 0, block_size,
|
||||
|
||||
@@ -35,6 +35,11 @@ test_writeatomic16_beyond_eol(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
if (!inq_bl) {
|
||||
CU_PASS("BlockLimits VPD is not available. Skipping test.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
|
||||
align = inq_bl->atomic_align ? inq_bl->atomic_align : 1;
|
||||
|
||||
@@ -41,6 +41,11 @@ test_writeatomic16_dpofua(void)
|
||||
CHECK_FOR_SBC;
|
||||
CHECK_FOR_DATALOSS;
|
||||
|
||||
if (!inq_bl) {
|
||||
CU_PASS("BlockLimits VPD is not available. Skipping test.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
gran = inq_bl->atomic_gran ? inq_bl->atomic_gran : 1;
|
||||
buf = alloca(gran * block_size);
|
||||
|
||||
|
||||
@@ -36,8 +36,12 @@ test_writeatomic16_simple(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
if (!inq_bl) {
|
||||
CU_PASS("BlockLimits VPD is not available. Skipping test.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
|
||||
gran = inq_bl->atomic_gran ? inq_bl->atomic_gran : 1;
|
||||
ret = writeatomic16(sd, 0,
|
||||
|
||||
@@ -35,9 +35,11 @@ test_writeatomic16_wrprotect(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
/*
|
||||
* Try out different non-zero values for WRPROTECT.
|
||||
*/
|
||||
if (!inq_bl) {
|
||||
CU_PASS("BlockLimits VPD is not available. Skipping test.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
|
||||
gran = inq_bl->atomic_gran ? inq_bl->atomic_gran : 1;
|
||||
|
||||
Reference in New Issue
Block a user