TESTS: update unmap to new api

Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
This commit is contained in:
Ronnie Sahlberg
2014-09-17 17:33:14 -07:00
committed by Ronnie Sahlberg
parent 832d88797a
commit 398f03205d
10 changed files with 72 additions and 117 deletions

View File

@@ -1,4 +1,3 @@
/*
Copyright (C) 2013 Ronnie Sahlberg <ronniesahlberg@gmail.com>
@@ -41,7 +40,8 @@ test_unmap_0blocks(void)
for (i = 0; i < 256; i++) {
list[0].lba = i;
list[0].num = 0;
ret = unmap(iscsic, tgt_lun, 0, list, 1);
ret = unmap(iscsic, tgt_lun, 0, list, 1,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
}
@@ -49,14 +49,16 @@ test_unmap_0blocks(void)
for (i = 0; i < 256; i++) {
list[i].lba = i;
list[i].num = 0;
ret = unmap(iscsic, tgt_lun, 0, list, i);
ret = unmap(iscsic, tgt_lun, 0, list, i,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
}
logging(LOG_VERBOSE, "Test UNMAP of 0 blocks at end-of-LUN");
list[0].lba = num_blocks;
list[0].num = 0;
ret = unmap(iscsic, tgt_lun, 0, list, 1);
ret = unmap(iscsic, tgt_lun, 0, list, 1,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -65,12 +67,14 @@ test_unmap_0blocks(void)
list[i].lba = i/2;
list[i].num = 0;
}
ret = unmap(iscsic, tgt_lun, 0, list, 256);
ret = unmap(iscsic, tgt_lun, 0, list, 256,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test UNMAP without any descriptors.");
ret = unmap(iscsic, tgt_lun, 0, list, 0);
ret = unmap(iscsic, tgt_lun, 0, list, 0,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
}