TEST: Add a new flag -V that enables verbose logging off the SCSI commands used and if they succeeded or failed

This commit is contained in:
Ronnie Sahlberg
2013-01-07 19:23:51 -08:00
parent d97b3b30e3
commit 0f9d8d0617
2 changed files with 6 additions and 8 deletions

View File

@@ -47,7 +47,7 @@
#define PROG "iscsi-test-cu"
int loglevel = LOG_NORMAL;
int loglevel = LOG_SILENT;
/* XXX what is this for? */
int (*real_iscsi_queue_pdu)(struct iscsi_context *iscsi, struct iscsi_pdu *pdu);
@@ -282,12 +282,13 @@ main(int argc, char *argv[])
{ "silent", no_argument, 0, 's' },
{ "normal", no_argument, 0, 'n' },
{ "verbose", no_argument, 0, 'v' },
{ "Verbose-scsi", no_argument, 0, 'V' },
{ NULL, 0, 0, 0 }
};
int c;
int opt_idx = 0;
while ((c = getopt_long(argc, argv, "?hli:I:t:sdgfAsnv", long_opts,
while ((c = getopt_long(argc, argv, "?hli:I:t:sdgfAsnvV", long_opts,
&opt_idx)) > 0) {
switch (c) {
case 'h':
@@ -320,14 +321,14 @@ main(int argc, char *argv[])
break;
case 's':
mode = CU_BRM_SILENT;
loglevel = LOG_SILENT;
break;
case 'n':
mode = CU_BRM_NORMAL;
loglevel = LOG_NORMAL;
break;
case 'v':
mode = CU_BRM_VERBOSE; /* default */
break;
case 'V':
loglevel = LOG_VERBOSE;
break;
default:

View File

@@ -30,6 +30,7 @@ test_read10_flags(void)
{
int ret;
logging(LOG_VERBOSE, "\nTest READ10 flags");
/* This test is only valid for SBC devices */
if (device_type != SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_DIRECT_ACCESS) {
@@ -38,9 +39,6 @@ test_read10_flags(void)
}
logging(LOG_VERBOSE, "\nTest READ10 flags");
logging(LOG_VERBOSE, "Test READ10 with DPO==1");
ret = read10(iscsic, tgt_lun, 0,
block_size, block_size,
@@ -69,7 +67,6 @@ test_read10_flags(void)
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ10 with DPO==1 FUA==1 FUA_NV==1");
ret = read10(iscsic, tgt_lun, 0,
block_size, block_size,