Added printf format checking to logging function.
This also required changing the logging of "" at the start of each test to appeal the otherwise-friendly compiler.
This commit is contained in:
committed by
Ronnie Sahlberg
parent
a1590cf30c
commit
990af4a427
@@ -2,7 +2,8 @@
|
||||
|
||||
ACLOCAL_AMFLAGS =-I m4
|
||||
AUTOMAKE_OPTIONS = foreign subdir-objects
|
||||
AM_CPPFLAGS=-I. -I$(srcdir)/include "-D_U_=__attribute__((unused))"
|
||||
AM_CPPFLAGS=-I. -I$(srcdir)/include "-D_U_=__attribute__((unused))" \
|
||||
"-D_R_(A,B)=__attribute__((format(printf,A,B)))"
|
||||
AM_CFLAGS=$(WARN_CFLAGS)
|
||||
LDADD = lib/libiscsi.la -lpopt
|
||||
|
||||
|
||||
@@ -74,6 +74,11 @@ void logging(int level, const char *format, ...)
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp(LOG_BLANK_LINE, format, LOG_BLANK_LINE_CMP_LEN)==0) {
|
||||
printf("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(ap, format);
|
||||
ret = vsnprintf(message, 1024, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
@@ -33,7 +33,14 @@ extern int loglevel;
|
||||
#define LOG_SILENT 0
|
||||
#define LOG_NORMAL 1
|
||||
#define LOG_VERBOSE 2
|
||||
void logging(int level, const char *format, ...);
|
||||
void logging(int level, const char *format, ...) _R_(2,3);
|
||||
|
||||
/*
|
||||
* define special flags for logging a blank line, so compiler
|
||||
* does not commplain when logging a ""
|
||||
*/
|
||||
#define LOG_BLANK_LINE " "
|
||||
#define LOG_BLANK_LINE_CMP_LEN 2
|
||||
|
||||
#define CHECK_FOR_DATALOSS \
|
||||
do { \
|
||||
|
||||
@@ -28,7 +28,7 @@ test_prefetch10_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH10 0-blocks at LBA==0");
|
||||
ret = prefetch10(iscsic, tgt_lun, 0,
|
||||
0, 0, 0);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_prefetch10_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH10 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = prefetch10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_prefetch10_flags(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH10 flags");
|
||||
|
||||
logging(LOG_VERBOSE, "Test PREFETCH10 with IMMED==1");
|
||||
|
||||
@@ -30,7 +30,7 @@ test_prefetch10_simple(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH10 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = prefetch10(iscsic, tgt_lun, 0, i, 0, 0);
|
||||
|
||||
@@ -28,7 +28,7 @@ test_prefetch16_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH16 0-blocks at LBA==0");
|
||||
ret = prefetch16(iscsic, tgt_lun, 0,
|
||||
0, 0, 0);
|
||||
|
||||
@@ -29,7 +29,7 @@ test_prefetch16_beyond_eol(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH16 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = prefetch16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_prefetch16_flags(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH16 flags");
|
||||
|
||||
logging(LOG_VERBOSE, "Test PREFETCH16 with IMMED==1");
|
||||
|
||||
@@ -30,7 +30,7 @@ test_prefetch16_simple(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test PREFETCH16 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = prefetch16(iscsic, tgt_lun, 0, i, 0, 0);
|
||||
|
||||
@@ -33,7 +33,7 @@ test_prin_read_keys_simple(void)
|
||||
int al;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test Persistent Reserve IN READ_KEYS works.");
|
||||
|
||||
ret = prin_read_keys(iscsic, tgt_lun, &task, NULL);
|
||||
|
||||
@@ -28,7 +28,7 @@ test_read10_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ10 0-blocks at LBA==0");
|
||||
ret = read10(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_read10_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ10 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = read10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_read10_flags(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ10 flags");
|
||||
|
||||
/* This test is only valid for SBC devices */
|
||||
|
||||
@@ -40,7 +40,7 @@ test_read10_rdprotect(void)
|
||||
* Try out different non-zero values for RDPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ10 with non-zero RDPROTECT");
|
||||
for (i = 1; i < 8; i++) {
|
||||
ret = read10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
|
||||
@@ -32,7 +32,7 @@ test_read10_simple(void)
|
||||
int i, ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ10 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = read10(iscsic, tgt_lun, 0, i * block_size,
|
||||
|
||||
@@ -28,7 +28,7 @@ test_read12_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ12 0-blocks at LBA==0");
|
||||
ret = read12(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_read12_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ12 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = read12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_read12_flags(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ12 flags");
|
||||
|
||||
/* This test is only valid for SBC devices */
|
||||
|
||||
@@ -40,7 +40,7 @@ test_read12_rdprotect(void)
|
||||
* Try out different non-zero values for RDPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ12 with non-zero RDPROTECT");
|
||||
for (i = 1; i < 8; i++) {
|
||||
ret = read12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
|
||||
@@ -32,7 +32,7 @@ test_read12_simple(void)
|
||||
int i, ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ12 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = read12(iscsic, tgt_lun, 0, i * block_size,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_read16_0blocks(void)
|
||||
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ16 0-blocks at LBA==0");
|
||||
ret = read16(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_read16_beyond_eol(void)
|
||||
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ16 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = read16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
|
||||
@@ -32,7 +32,7 @@ test_read16_flags(void)
|
||||
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ16 flags");
|
||||
|
||||
logging(LOG_VERBOSE, "Test READ16 with DPO==1");
|
||||
|
||||
@@ -36,7 +36,7 @@ test_read16_rdprotect(void)
|
||||
* Try out different non-zero values for RDPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ16 with non-zero RDPROTECT");
|
||||
for (i = 1; i < 8; i++) {
|
||||
ret = read16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
|
||||
@@ -33,7 +33,7 @@ test_read16_simple(void)
|
||||
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ16 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
ret = read16(iscsic, tgt_lun, 0, i * block_size,
|
||||
|
||||
@@ -28,7 +28,7 @@ test_read6_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ6 0-blocks at LBA==0");
|
||||
ret = read6(iscsic, tgt_lun, 0, 0, block_size, NULL);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
@@ -35,7 +35,7 @@ test_read6_beyond_eol(void)
|
||||
}
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ6 1-255 blocks one block beyond the end");
|
||||
for (i = 1; i <= 255; i++) {
|
||||
ret = read6_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
|
||||
@@ -32,7 +32,7 @@ test_read6_simple(void)
|
||||
int i, ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ6 of 1-255 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 255; i++) {
|
||||
ret = read6(iscsic, tgt_lun, 0, i * block_size,
|
||||
|
||||
@@ -32,7 +32,7 @@ test_readcapacity10_simple(void)
|
||||
int ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test basic READCAPACITY10");
|
||||
|
||||
ret = readcapacity10(iscsic, tgt_lun, 0, 0);
|
||||
|
||||
@@ -32,7 +32,7 @@ test_readcapacity16_alloclen(void)
|
||||
int i, ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test that READCAPACITY16 with alloc_len 0-15 is not an error");
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
||||
@@ -32,7 +32,7 @@ test_readcapacity16_simple(void)
|
||||
int ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test that READCAPACITY16 works");
|
||||
|
||||
ret = readcapacity16(iscsic, tgt_lun, 16);
|
||||
|
||||
@@ -28,7 +28,7 @@ test_testunitready_simple(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test TESTUNITREADY");
|
||||
ret = testunitready(iscsic, tgt_lun);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
@@ -36,7 +36,7 @@ test_unmap_0blocks(void)
|
||||
CHECK_FOR_THIN_PROVISIONING;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test UNMAP of 0 blocks at LBA:0-255 as a single descriptor");
|
||||
for (i = 0; i < 256; i++) {
|
||||
list[0].lba = i;
|
||||
|
||||
@@ -36,7 +36,7 @@ test_unmap_simple(void)
|
||||
CHECK_FOR_THIN_PROVISIONING;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test UNMAP of 1-256 blocks at the start of the LUN as a single descriptor");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
list[0].lba = 0;
|
||||
|
||||
@@ -28,7 +28,7 @@ test_verify10_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 0-blocks at LBA==0");
|
||||
ret = verify10(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 1, NULL);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_verify10_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -32,7 +32,7 @@ test_verify10_flags(void)
|
||||
int ret;
|
||||
unsigned char *buf = malloc(block_size);
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 flags");
|
||||
|
||||
ret = read10(iscsic, tgt_lun, 0, block_size,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_verify10_mismatch(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 for blocks 1-255");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify10_mismatch_no_cmp(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 without BYTCHK for blocks 1-255");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify10_simple(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 of 1-256 blocks at the end of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify10_vrprotect(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 with non-zero VRPROTECT");
|
||||
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -28,7 +28,7 @@ test_verify12_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 0-blocks at LBA==0");
|
||||
ret = verify12(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 1, NULL);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_verify12_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -32,7 +32,7 @@ test_verify12_flags(void)
|
||||
int ret;
|
||||
unsigned char *buf = malloc(block_size);
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 flags");
|
||||
|
||||
ret = read12(iscsic, tgt_lun, 0, block_size,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_verify12_mismatch(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 for blocks 1-255");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify12_mismatch_no_cmp(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 without BYTCHK for blocks 1-255");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify12_simple(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 of 1-256 blocks at the end of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify12_vrprotect(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY12 with non-zero VRPROTECT");
|
||||
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -28,7 +28,7 @@ test_verify16_0blocks(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 0-blocks at LBA==0");
|
||||
ret = verify16(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 1, NULL);
|
||||
|
||||
@@ -29,7 +29,7 @@ test_verify16_beyond_eol(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -32,7 +32,7 @@ test_verify16_flags(void)
|
||||
int ret;
|
||||
unsigned char *buf = malloc(block_size);
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 flags");
|
||||
|
||||
ret = read16(iscsic, tgt_lun, 0, block_size,
|
||||
|
||||
@@ -30,7 +30,7 @@ test_verify16_mismatch(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 for blocks 1-255");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify16_mismatch_no_cmp(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 without BYTCHK for blocks 1-255");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify16_simple(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 of 1-256 blocks at the end of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -31,7 +31,7 @@ test_verify16_vrprotect(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY16 with non-zero VRPROTECT");
|
||||
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -35,7 +35,7 @@ test_write10_0blocks(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE10 0-blocks at LBA==0");
|
||||
ret = write10(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
|
||||
@@ -36,7 +36,7 @@ test_write10_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE10 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -33,7 +33,7 @@ test_write10_flags(void)
|
||||
|
||||
CHECK_FOR_DATALOSS;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE10 flags");
|
||||
|
||||
buf = malloc(block_size);
|
||||
|
||||
@@ -33,7 +33,7 @@ test_write10_simple(void)
|
||||
|
||||
CHECK_FOR_DATALOSS;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE10 of 1-256 blocks at the start of the LUN");
|
||||
|
||||
for (i = 1; i <= 256; i++) {
|
||||
|
||||
@@ -37,7 +37,7 @@ test_write10_wrprotect(void)
|
||||
* Try out different non-zero values for WRPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE10 with non-zero WRPROTECT");
|
||||
buf = malloc(block_size);
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -35,7 +35,7 @@ test_write12_0blocks(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE12 0-blocks at LBA==0");
|
||||
ret = write12(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
|
||||
@@ -36,7 +36,7 @@ test_write12_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE12 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -33,7 +33,7 @@ test_write12_flags(void)
|
||||
|
||||
CHECK_FOR_DATALOSS;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE12 flags");
|
||||
|
||||
buf = malloc(block_size);
|
||||
|
||||
@@ -33,7 +33,7 @@ test_write12_simple(void)
|
||||
|
||||
CHECK_FOR_DATALOSS;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE12 of 1-256 blocks at the start of the LUN");
|
||||
|
||||
for (i = 1; i <= 256; i++) {
|
||||
|
||||
@@ -37,7 +37,7 @@ test_write12_wrprotect(void)
|
||||
* Try out different non-zero values for WRPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE12 with non-zero WRPROTECT");
|
||||
buf = malloc(block_size);
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -31,7 +31,7 @@ test_write16_0blocks(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE16 0-blocks at LBA==0");
|
||||
ret = write16(iscsic, tgt_lun, 0, 0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
|
||||
@@ -32,7 +32,7 @@ test_write16_beyond_eol(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE16 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_write16_flags(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE16 flags");
|
||||
|
||||
buf = malloc(block_size);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_write16_simple(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE16 of 1-256 blocks at the start of the LUN");
|
||||
|
||||
for (i = 1; i <= 256; i++) {
|
||||
|
||||
@@ -38,7 +38,7 @@ test_write16_wrprotect(void)
|
||||
* Try out different non-zero values for WRPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITE16 with non-zero WRPROTECT");
|
||||
buf = malloc(block_size);
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -36,7 +36,7 @@ test_writesame10_0blocks(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME10 0-blocks at LBA==0");
|
||||
ret = writesame10(iscsic, tgt_lun, 0,
|
||||
block_size, 0,
|
||||
|
||||
@@ -37,7 +37,7 @@ test_writesame10_beyond_eol(void)
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME10 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size);
|
||||
|
||||
@@ -34,7 +34,7 @@ test_writesame10_simple(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME10 of 1-256 blocks at the start of the LUN");
|
||||
|
||||
for (i = 1; i <= 256; i++) {
|
||||
|
||||
@@ -36,7 +36,7 @@ test_writesame10_unmap(void)
|
||||
CHECK_FOR_LBPWS10;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME10 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -37,7 +37,7 @@ test_writesame10_unmap_unaligned(void)
|
||||
CHECK_FOR_LBPPB_GT_1;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test that unaligned WRITESAME10 Unmap fails. LBPPB==%d", lbppb);
|
||||
for (i = 1; i < lbppb; i++) {
|
||||
logging(LOG_VERBOSE, "Unmap %d blocks using WRITESAME10 at LBA:%d", lbppb - i, i);
|
||||
|
||||
@@ -36,7 +36,7 @@ test_writesame10_unmap_until_end(void)
|
||||
CHECK_FOR_LBPWS10;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME10 of 1-256 blocks at the end of the LUN by setting number-of-blocks==0");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -38,7 +38,7 @@ test_writesame10_wrprotect(void)
|
||||
* Try out different non-zero values for WRPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME10 with non-zero WRPROTECT");
|
||||
buf = malloc(block_size);
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
@@ -31,7 +31,7 @@ test_writesame16_0blocks(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 0-blocks at LBA==0");
|
||||
ret = writesame16(iscsic, tgt_lun, 0,
|
||||
block_size, 0,
|
||||
|
||||
@@ -32,7 +32,7 @@ test_writesame16_beyond_eol(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 1-256 blocks one block beyond the end");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size);
|
||||
|
||||
@@ -33,7 +33,7 @@ test_writesame16_simple(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the start of the LUN");
|
||||
|
||||
for (i = 1; i <= 256; i++) {
|
||||
|
||||
@@ -37,7 +37,7 @@ test_writesame16_unmap(void)
|
||||
CHECK_FOR_LBPWS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the start of the LUN");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -37,7 +37,7 @@ test_writesame16_unmap_unaligned(void)
|
||||
CHECK_FOR_LBPPB_GT_1;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test that unaligned WRITESAME16 Unmap fails. LBPPB==%d", lbppb);
|
||||
for (i = 1; i < lbppb; i++) {
|
||||
logging(LOG_VERBOSE, "Unmap %d blocks using WRITESAME16 at LBA:%d", lbppb - i, i);
|
||||
|
||||
@@ -36,7 +36,7 @@ test_writesame16_unmap_until_end(void)
|
||||
CHECK_FOR_LBPWS;
|
||||
CHECK_FOR_SBC;
|
||||
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the end of the LUN by setting number-of-blocks==0");
|
||||
for (i = 1; i <= 256; i++) {
|
||||
unsigned char *buf = malloc(block_size * i);
|
||||
|
||||
@@ -38,7 +38,7 @@ test_writesame16_wrprotect(void)
|
||||
* Try out different non-zero values for WRPROTECT.
|
||||
* They should all fail.
|
||||
*/
|
||||
logging(LOG_VERBOSE, "");
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 with non-zero WRPROTECT");
|
||||
buf = malloc(block_size);
|
||||
for (i = 1; i < 8; i++) {
|
||||
|
||||
Reference in New Issue
Block a user