TESTS: UNMAP/WRITESAME10/16 Check LBPRZ before we read the unmapped blocks and verify they are blank.

This commit is contained in:
Ronnie Sahlberg
2013-05-15 17:10:20 -07:00
parent bdce246bc0
commit 8c22f8d986
6 changed files with 94 additions and 44 deletions
-1
View File
@@ -1,4 +1,3 @@
/* /*
Copyright (C) 2013 Ronnie Sahlberg <ronniesahlberg@gmail.com> Copyright (C) 2013 Ronnie Sahlberg <ronniesahlberg@gmail.com>
+20 -2
View File
@@ -54,7 +54,12 @@ test_writesame10_unmap(void)
0, 1, 0, 0, NULL); 0, 1, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0); CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i); if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read10(iscsic, tgt_lun, 0, ret = read10(iscsic, tgt_lun, 0,
i * block_size, block_size, i * block_size, block_size,
0, 0, 0, 0, 0, buf); 0, 0, 0, 0, 0, buf);
@@ -63,6 +68,10 @@ test_writesame10_unmap(void)
CU_ASSERT_EQUAL(buf[j], 0); CU_ASSERT_EQUAL(buf[j], 0);
} }
} }
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
free(buf); free(buf);
} }
@@ -84,7 +93,12 @@ test_writesame10_unmap(void)
0, 1, 0, 0, buf); 0, 1, 0, 0, buf);
CU_ASSERT_EQUAL(ret, 0); CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i); if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read10(iscsic, tgt_lun, num_blocks - i, ret = read10(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size, i * block_size, block_size,
0, 0, 0, 0, 0, buf); 0, 0, 0, 0, 0, buf);
@@ -93,6 +107,10 @@ test_writesame10_unmap(void)
CU_ASSERT_EQUAL(buf[j], 0); CU_ASSERT_EQUAL(buf[j], 0);
} }
} }
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
free(buf); free(buf);
} }
@@ -1,4 +1,3 @@
/* /*
Copyright (C) 2013 Ronnie Sahlberg <ronniesahlberg@gmail.com> Copyright (C) 2013 Ronnie Sahlberg <ronniesahlberg@gmail.com>
+10 -1
View File
@@ -54,7 +54,12 @@ test_writesame10_unmap_until_end(void)
0, 1, 0, 0, NULL); 0, 1, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0); CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i); if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read10(iscsic, tgt_lun, num_blocks - i, ret = read10(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size, i * block_size, block_size,
0, 0, 0, 0, 0, buf); 0, 0, 0, 0, 0, buf);
@@ -63,6 +68,10 @@ test_writesame10_unmap_until_end(void)
CU_ASSERT_EQUAL(buf[j], 0); CU_ASSERT_EQUAL(buf[j], 0);
} }
} }
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
free(buf); free(buf);
} }
} }
+18 -2
View File
@@ -59,7 +59,11 @@ test_writesame16_unmap(void)
} }
CU_ASSERT_EQUAL(ret, 0); CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i); if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(iscsic, tgt_lun, 0, ret = read16(iscsic, tgt_lun, 0,
i * block_size, block_size, i * block_size, block_size,
0, 0, 0, 0, 0, buf); 0, 0, 0, 0, 0, buf);
@@ -68,6 +72,10 @@ test_writesame16_unmap(void)
CU_ASSERT_EQUAL(buf[j], 0); CU_ASSERT_EQUAL(buf[j], 0);
} }
} }
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
} }
@@ -86,7 +94,11 @@ test_writesame16_unmap(void)
0, 1, 0, 0, buf); 0, 1, 0, 0, buf);
CU_ASSERT_EQUAL(ret, 0); CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i); if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(iscsic, tgt_lun, num_blocks - i, ret = read16(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size, i * block_size, block_size,
0, 0, 0, 0, 0, buf); 0, 0, 0, 0, 0, buf);
@@ -95,6 +107,10 @@ test_writesame16_unmap(void)
CU_ASSERT_EQUAL(buf[j], 0); CU_ASSERT_EQUAL(buf[j], 0);
} }
} }
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
} }
logging(LOG_VERBOSE, "Verify that WRITESAME16 ANCHOR==1 + UNMAP==0 is invalid"); logging(LOG_VERBOSE, "Verify that WRITESAME16 ANCHOR==1 + UNMAP==0 is invalid");
+10 -1
View File
@@ -58,7 +58,12 @@ test_writesame16_unmap_until_end(void)
} }
CU_ASSERT_EQUAL(ret, 0); CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks and verify they are now zero", i); if (rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ is set. Read the unmapped "
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(iscsic, tgt_lun, num_blocks - i, ret = read16(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size, i * block_size, block_size,
0, 0, 0, 0, 0, buf); 0, 0, 0, 0, 0, buf);
@@ -67,5 +72,9 @@ test_writesame16_unmap_until_end(void)
CU_ASSERT_EQUAL(buf[j], 0); CU_ASSERT_EQUAL(buf[j], 0);
} }
} }
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");
}
} }
} }