From c9a01c4c1f92307d4543dd76d46b95c17ba13c4e Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 29 May 2013 19:21:39 -0700 Subject: [PATCH] TESTS: For the inquiry test for whether a target only looks at the low order byte of the two byte transfer length field or not. Since the maximum size of a std vpd page takes 260 bytes to transfer and some targets send this much, testing and comparing the returned buffer between allocation length == 255 and == 256 doesnt work. Instead change test to verify that allocation length 511 and 512 returns the same amount and content of data. This test then still allows finding targets that only look at the low order byte (which is 0xff for 511 but is 0 for 512) --- test-tool/test_inquiry_alloc_length.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test-tool/test_inquiry_alloc_length.c b/test-tool/test_inquiry_alloc_length.c index c0379ff..9311be8 100644 --- a/test-tool/test_inquiry_alloc_length.c +++ b/test-tool/test_inquiry_alloc_length.c @@ -79,7 +79,12 @@ test_inquiry_alloc_length(void) } logging(LOG_VERBOSE, "Version is SPC-3 or later. Read INQUIRY data using 16-bit allocation length"); - ret = inquiry(iscsic, tgt_lun, 0, 0, 256, &task2); + logging(LOG_VERBOSE, "Read INQUIRY data with allocation length 511 (low order byte is 0xff)"); + ret = inquiry(iscsic, tgt_lun, 0, 0, 511, &task); + CU_ASSERT_EQUAL(ret, 0); + + logging(LOG_VERBOSE, "Read INQUIRY data with allocation length 512 (low order byte is 0x00)"); + ret = inquiry(iscsic, tgt_lun, 0, 0, 512, &task2); CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "INQUIRY data should be the same when allocation length is 255 and 256 bytes");