TEST-TOOL: Add a --info argument to print more detailed infor what a test does

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2012-06-03 09:08:12 +10:00
parent 9e09a46ddd
commit 288fd5e9fe
48 changed files with 600 additions and 320 deletions
+11 -2
View File
@@ -21,7 +21,7 @@
#include "scsi-lowlevel.h"
#include "iscsi-test.h"
int T0132_verify10_mismatch_no_cmp(const char *initiator, const char *url)
int T0132_verify10_mismatch_no_cmp(const char *initiator, const char *url, int data_loss _U_, int show_info)
{
struct iscsi_context *iscsi;
struct scsi_task *task;
@@ -30,6 +30,15 @@ int T0132_verify10_mismatch_no_cmp(const char *initiator, const char *url)
int ret, i, lun;
uint32_t block_size, num_blocks;
printf("0132_verify10_mismatch_no_cmp:\n");
printf("==============================\n");
if (show_info) {
printf("Test VERIFY10 BYTCHK:0 should not detect mismatches.\n");
printf("1, Verify the first 1-256 blocks does nto detect a mismatch if BYTCHK is 0\n");
printf("\n");
return 0;
}
iscsi = iscsi_context_login(initiator, url, &lun);
if (iscsi == NULL) {
printf("Failed to login to target\n");
@@ -67,7 +76,7 @@ int T0132_verify10_mismatch_no_cmp(const char *initiator, const char *url)
/* read and verify the first 1 - 256 blocks at the start of the LUN */
printf("Read+verify first 1-256 blocks ... ");
for (i = 1; i <= 256; i++) {
char *buf;
unsigned char *buf;
task = iscsi_read10_sync(iscsi, lun, 0, i * block_size, block_size);
if (task == NULL) {