Commit Graph

1132 Commits

Author SHA1 Message Date
Ronnie Sahlberg
e216e032af Merge pull request #95 from jh86/master
Add XML output option to iscsi-test-cu
2014-03-12 05:59:13 -07:00
Jon Hermansen
d34d61a782 add automated XML output option to iscsi-test-cu 2014-03-11 16:15:19 -07:00
Ronnie Sahlberg
75769ec286 Merge pull request #94 from jh86/master
Fix READ(6) tests' capacity checks
2014-03-11 12:22:41 -07:00
Jon Hermansen
d348633763 fix capacity checks in READ(6) tests 2014-03-11 10:44:54 -07:00
Ronnie Sahlberg
270db13f7c TESTS: Warn not fail if inquiry descriptors do not contain SPC* or SBC*
Only print a warning but do not fail if the standard inquire version
descriptors do not contain a SPC* or SBC* entry.
2014-03-06 20:30:00 -08:00
Ronnie Sahlberg
b0dbecaff7 TESTS: compare and write: Invalidfieldincdb is illegal-request, not miscompare 2014-03-06 17:30:46 -08:00
Ronnie Sahlberg
879f542ebf TESTS: CompareAndWrite are bounded by the max block setting in BlockLimits
Make sure that we check that a target returns an error if we try to compare and write too much.
2014-03-05 18:47:24 -08:00
Ronnie Sahlberg
fc91b41b5a TESTS: Clear iscsi_local_iscsi_queue_pdy pointer before we return from the test. 2014-03-03 17:25:24 -08:00
Ronnie Sahlberg
dbc9ffb5cb TESTS: ReportSupportedOpcodes return the opcode itself as data[0], not 0xff
The first byte of CDB USAGE FIELD contains the opcode value itself, not
0xff.

From SPC4 :
...
The first byte of the CDB USAGE FIELD
field shall contain the operation code for the command being queried.
...
2014-02-24 19:04:58 -08:00
Ronnie Sahlberg
0236395709 Run configure --prefix=/usr during makerpms.sh 2014-02-11 19:40:38 -08:00
Ronnie Sahlberg
20b25b9088 Make sure the rpm build directories exist before we try copying into them. 2014-02-10 19:53:36 -08:00
Ronnie Sahlberg
3e00541fae Create RPM target for the testsuite 2014-02-09 18:15:12 -08:00
Ronnie Sahlberg
0c82fa1a13 Update README with more clear description of the libcunit dependency for iscsi-test-cu 2014-02-02 15:37:08 -08:00
Ronnie Sahlberg
f7a21d1dcd Add iscsi-swp +manpage to the rpm build 2014-02-02 08:42:26 -08:00
Ronnie Sahlberg
cc81b67620 TESTS: Add tests for invalid iSCSI DATASN values. 2014-01-26 09:35:17 -08:00
Ronnie Sahlberg
5eb9d8750b Merge pull request #87 from sitsofe/oldtests
OLD TESTS: Fix use after free in unsolicited_[non]immediate_data tests.
2014-01-26 08:25:49 -08:00
Ronnie Sahlberg
99be69a08f Merge pull request #86 from sitsofe/writesame
Update WRITESAME tests and fix a logging typo
2014-01-26 08:25:15 -08:00
Sitsofe Wheeler
b42a6ede19 OLD TESTS: Fix use after free in unsolicited_[non]immediate_data tests.
After destroying iscsi, nullify iscsi_url's reference to it to prevent a use
after free.

Detected by clang's AddressSanitizer.
2014-01-25 08:59:35 +00: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
0fbe47c1bd Merge pull request #85 from vn516726/master
Corrected the log
2014-01-23 19:56:23 -08:00
vn516726
262ac3b5c6 Corrected the log 2014-01-24 11:39:25 +08:00
Ronnie Sahlberg
354f00fd4f Discovery: Create a list of portals for each discovered target.
Some targets return multiple TargetAddress for individual targets.
Create a linked list of addresses for each target instead of
failing the discovery process when this happens.
2014-01-15 19:37:40 -08:00
Ronnie Sahlberg
25078d0d91 Old TESTS: Abort 0180 thin provisioning test early if the LUN does not have LBPME enabled 2014-01-06 18:36:48 -08:00
Ronnie Sahlberg
993be6c439 Free the correct inq task to avoid leaking memory during startup. 2014-01-06 18:26:03 -08:00
Ronnie Sahlberg
0a7d1407f0 Fix a segfault in the old T0184 WS10 test 2014-01-06 18:23:04 -08:00
Ronnie Sahlberg
448f470d4a Set SOCURRENT/REVISION/AGE manually from Makefile.am 2013-12-24 13:14:48 -08:00
Ronnie Sahlberg
b58b61cb37 Add some missing files to 'make dist' 2013-12-16 18:42:48 -08:00
Ronnie Sahlberg
52e1a8c14f Remove the generated manpages on make clean 2013-12-16 18:31:45 -08:00
Michael Tokarev
120b308741 Spelling fixes: Dont => Don't
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-12-16 18:19:24 -08:00
Ronnie Sahlberg
c606dd50f9 Merge pull request #84 from bonzini/master
fix CHAP authentication
2013-12-16 18:16:34 -08:00
Paolo Bonzini
34b93c4cfd fix CHAP authentication
Empty discovery and login packets are legal, and have the same behavior
as packets with a single NUL in them.  Introduced by commit 94d73fc
(Merge pull request #83 from bonzini/coverity, 2013-11-05).

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-12-12 17:06:06 +01:00
Ronnie Sahlberg
78e49f1427 Coding style update 2013-11-05 17:59:55 -08:00
Ronnie Sahlberg
e59c336450 Use <ptr> == NULL instead of !<ptr> 2013-11-05 17:53:10 -08:00
Ronnie Sahlberg
94d73fc937 Merge pull request #83 from bonzini/coverity
Fix issues reported by Coverity
Merged, thanks!
2013-11-05 06:51:06 -08:00
Paolo Bonzini
87ee645621 check for a target being there before processing TargetAddress
Otherwise we access a NULL pointer.  RFC3270 appendix D confirms
that TargetName must always come before TargetAddress.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 15:38:38 +01:00
Paolo Bonzini
bfde497565 rework login and discovery code to avoid strlen beyond end of data
Checking for the presence of the NUL character should be done
without accessing beyond the PDU datain.  Use memchr instead
of strlen, and compute the length only if a NUL character is
actually there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:32:34 +01:00
Paolo Bonzini
bb0e59055a handle bad iscsi->fd in iscsi_service
Just do nothing if the file descriptor is invalid.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:31:16 +01:00
Paolo Bonzini
fce94c81a3 do not test arrays against NULL
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Paolo Bonzini
dbaa0b4ea6 exit after malloc failure when allocating sense data blob
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Paolo Bonzini
1acce4a948 log failures (typically malloc) of iscsi_create_context during reconnect
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Paolo Bonzini
c3e8d0c945 reconnect: do not initialize iscsi to old_iscsi, use old_iscsi if appropriate
Makes it clearer that logging has to be done on the existing context,
since the "iscsi" pointer will not survive iscsi_reconnect.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-05 14:24:56 +01:00
Ronnie Sahlberg
f08e68e52a Merge pull request #77 from sitsofe/read6
TESTS: Fix READ6 test
2013-11-03 16:39:21 -08:00
Ronnie Sahlberg
43f0926566 Merge pull request #82 from plieven/master
introduce LIBISCSI_API_VERSION
2013-11-03 16:35:38 -08:00
Bart Van Assche
29f3d33944 test-tool/0184_writesame10_0blocks.c: Include WSNZ bit in test
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:40:33 -07:00
Bart Van Assche
08ed1c2aea Add two additional READ16-beyond-eol tests
This helps testing SCSI target implementations that represent the
byte offset from the start of the device as a signed or unsigned
64-bit integer.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:39:05 -07:00
Bart Van Assche
ba8a8d0a4e test tool: Fix a memory leak in test_reserve6_lun_reset.c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:37:55 -07:00
Bart Van Assche
b6b49e4a66 test tool: Fix memory leaks in test setup and teardown functions
Free read_write_buf and task after each test. Free iscsi2 after
each PGR test when using CUnit version 2. Note: CUnit version 1
doesn't support test setup and teardown functions.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:36:50 -07:00
Bart Van Assche
a1f32527d5 test tool: Fix a memory leak in test-tool/test_reserve6_logout.c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:35:22 -07:00
Bart Van Assche
d6ecafa6f5 test tool: Fix a memory leak in test_preventallow_logout.c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-23 05:35:01 -07:00