test-tool: add prin_read_keys() allocation_len parameter

Accepting an Allocation Length parameter allows us to test for
truncation of response data, as per SPC5r17 4.2.5.6:
  The device server shall terminate transfers to the Data-In Buffer when
  the number of bytes or blocks specified by the ALLOCATION LENGTH field
  have been transferred or when all available data have been
  transferred, whichever is less.

With this change, all existing prin_read_keys() callers continue to use
same ALLOCATION LENGTH value as earlier (16K).

Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2018-05-31 22:49:04 +02:00
parent 58642c6d72
commit 31ab1e1ac9
7 changed files with 16 additions and 14 deletions

View File

@@ -78,7 +78,7 @@ test_prout_preempt_rm_reg(void)
CU_ASSERT_EQUAL(ret, 0);
/* confirm that k1 and k2 are registered */
ret = prin_read_keys(sd, &tsk, &rk);
ret = prin_read_keys(sd, &tsk, &rk, 16384);
CU_ASSERT_EQUAL_FATAL(ret, 0);
CU_ASSERT_EQUAL(rk->num_keys, 2);
@@ -99,7 +99,7 @@ test_prout_preempt_rm_reg(void)
ret = test_iscsi_tur_until_good(sd2, &num_uas);
CU_ASSERT_EQUAL(ret, 0);
ret = prin_read_keys(sd, &tsk, &rk);
ret = prin_read_keys(sd, &tsk, &rk, 16384);
CU_ASSERT_EQUAL_FATAL(ret, 0);
CU_ASSERT_EQUAL(rk->num_keys, 1);