Commit Graph

15 Commits

Author SHA1 Message Date
Ronnie Sahlberg
99a5f99527 Add some emacs defaults. Tabs are 8 spaces.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-18 21:34:43 -08:00
Ronnie Sahlberg
fe1017fe2a TESTS: Don't test WriteSame10/16 if we do not have BlockLimits VPD
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-19 16:06:05 -07:00
Chris Zankel
fff67ba7dd test_writesame*_0blocks: skip 0-block test if unsupported
Skip 0-block WRITE SAME tests for targets that don't support these
operations, ie. they have write_same_no_zero (WSNZ) set in the
block limits vpd.

Also, fix the test:
  "Test WRITESAME10 of 1-256 blocks at the end of the LUN by setting
number-of-blocks==0"
to actually pass 0 blocks instead of the number of remaining blocks to the end.

Signed-off-by: Chris Zankel <chris@zankel.net>
2015-04-23 17:36:38 -07:00
Ronnie Sahlberg
0666691b2a TESTS: pass an actual block to the ritesame16/0blocks test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 20:57:59 -07:00
Ronnie Sahlberg
072291c852 TESTS: change the function signatures for the helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:19:04 -07:00
Ronnie Sahlberg
9b768f7de9 TESTS: move the default url, lun and iscsi context into a structure
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 16:42:45 -07:00
Ronnie Sahlberg
8585e4509b TESTS: update writesame tests to new API
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:08:01 -07:00
Sitsofe Wheeler
3bac2a0e17 Add ULL suffix to large integer literals
When trying to compile libiscsi on a 32 bit Ubuntu 10.04 with gcc 4.4.3
errors like the following are produced:

test_get_lba_status_beyond_eol.c:45: error: integer constant is too
large for ‘long’ type

This is because we don't specify that we are explictly compiling to the
c99 standard and as such gcc defaults to gnu90 standard. This in turn
means the maximum default type of integer literals is unsigned long int
which not big enough to hold the literal on a 32 bit architecture.

Fix this by adding the ULL suffix to all large integer literals.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2014-08-21 18:04:37 +01:00
Bart Van Assche
e8c4be8f62 test_writesame16_0blocks: Add support for WSNZ=1
Support for WRITE SAME with NUMBER OF LOGICAL BLOCKS = 0 is optional.
Hence set NUMBER OF LOGICAL BLOCKS to 0 if this value is supported
and set this parameter to 1 otherwise.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-21 06:40:51 -07:00
Bart Van Assche
f6c4a82a22 test_writesame*_0blocks.c: Include WSNZ bit in test
From the SBC-4 section about the block limits VPD page: "A write
same non-zero (WSNZ) bit set to one indicates that the device
server does not support a value of zero in the NUMBER OF LOGICAL
BLOCKS field in the WRITE SAME command CDBs (see 5.45, 5.46, and
5.47). A WSNZ bit set to zero indicates that the device server may
or may not support a value of zero in the NUMBER OF LOGICAL BLOCKS
field of the WRITE SAME commands." Hence verify that WRITE SAME
with NUMBER OF LOGICAL BLOCKS set to zero fails if WSNZ = 0.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-04 16:04:43 -07:00
Sitsofe Wheeler
e1659b1973 TESTS: Fix WRITESAME tests to handle targets that don't like datalen == 0
Recent SBC specs say (when the WSNZ bit is set to one and the NUMBER OF LOGICAL
BLOCKS field is set to zero) or (if MAXIMUM WRITE SAME LENGTH is greater than 0
and the number of logical blocks specified to be written exceeds the MAXIMUM
WRITE SAME LENGTH) the server should terminate with CHECK CONDITION, set the
sense key to ILLEGAL REQUEST and the additional sense code to INVALID FIELD IN
CDB.

Update the WRITESAME tests to cope with this.
2014-01-25 05:37:45 +00:00
Sitsofe Wheeler
38ba5b6c0e Fix logging typo. 2014-01-24 18:56:54 +00:00
Ronnie Sahlberg
2627a8845e TESTS: add a flag --usb so we can clamp all i/o to at most 120k
Add checks for maximum tranfer length to all commands that are limited
by BlockLimits/MTL
2013-04-27 09:59:59 -07:00
Lee Duncan
990af4a427 Added printf format checking to logging function.
This also required changing the logging of "" at the
start of each test to appeal the otherwise-friendly
compiler.
2013-02-13 18:04:51 -08:00
Ronnie Sahlberg
0dbffe1a5d TESTS Add tests for WRITESAME16 to the new testsuite 2013-01-26 09:18:39 -08:00