From 84c8606c90dc7b7827207ad3f169485c0c938b45 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 21 Jan 2013 11:24:31 -0800 Subject: [PATCH] TESTS: change write16 flags/wrprotect tests to also write one block of data --- test-tool/test_write16_flags.c | 13 ++++++++----- test-tool/test_write16_wrprotect.c | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test-tool/test_write16_flags.c b/test-tool/test_write16_flags.c index 656377a..f96a5ab 100644 --- a/test-tool/test_write16_flags.c +++ b/test-tool/test_write16_flags.c @@ -29,6 +29,7 @@ void test_write16_flags(void) { int ret; + unsigned char *buf; logging(LOG_VERBOSE, ""); logging(LOG_VERBOSE, "Test WRITE16 flags"); @@ -44,37 +45,39 @@ test_write16_flags(void) return; } + buf = malloc(block_size); logging(LOG_VERBOSE, "Test WRITE16 with DPO==1"); ret = write16(iscsic, tgt_lun, 0, block_size, block_size, - 0, 1, 0, 0, 0, NULL); + 0, 1, 0, 0, 0, buf); CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "Test WRITE16 with FUA==1 FUA_NV==0"); ret = write16(iscsic, tgt_lun, 0, block_size, block_size, - 0, 0, 1, 0, 0, NULL); + 0, 0, 1, 0, 0, buf); CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "Test WRITE16 with FUA==1 FUA_NV==1"); ret = write16(iscsic, tgt_lun, 0, block_size, block_size, - 0, 0, 1, 1, 0, NULL); + 0, 0, 1, 1, 0, buf); CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "Test WRITE16 with FUA==0 FUA_NV==1"); ret = write16(iscsic, tgt_lun, 0, block_size, block_size, - 0, 0, 0, 1, 0, NULL); + 0, 0, 0, 1, 0, buf); CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "Test WRITE16 with DPO==1 FUA==1 FUA_NV==1"); ret = write16(iscsic, tgt_lun, 0, block_size, block_size, - 0, 1, 1, 1, 0, NULL); + 0, 1, 1, 1, 0, buf); CU_ASSERT_EQUAL(ret, 0); + free(buf); } diff --git a/test-tool/test_write16_wrprotect.c b/test-tool/test_write16_wrprotect.c index 692a085..dc2eea3 100644 --- a/test-tool/test_write16_wrprotect.c +++ b/test-tool/test_write16_wrprotect.c @@ -29,6 +29,7 @@ void test_write16_wrprotect(void) { int i, ret; + unsigned char *buf; if (!data_loss) { CU_PASS("[SKIPPED] --dataloss flag is not set. Skipping test."); @@ -46,10 +47,12 @@ test_write16_wrprotect(void) */ logging(LOG_VERBOSE, ""); logging(LOG_VERBOSE, "Test WRITE16 with non-zero WRPROTECT"); + buf = malloc(block_size); for (i = 1; i < 8; i++) { ret = write16_invalidfieldincdb(iscsic, tgt_lun, 0, block_size, block_size, - i, 0, 0, 0, 0, NULL); + i, 0, 0, 0, 0, buf); CU_ASSERT_EQUAL(ret, 0); } + free(buf); }