Commit Graph

130 Commits

Author SHA1 Message Date
Ronnie Sahlberg
e57b266e91 TESTS: Fix how we compute the max transfer length the bus can handle was broken
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-19 14:41:52 -07:00
David Disseldorp
5c0b1b9913 test/pr: simple PR Out CLEAR test
Check that a Persistent Reserve Out CLEAR request:
- clears an existing reservation
- clears existing registration keys
- bumps the PRgeneration number

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-09-18 18:06:25 +02:00
David Disseldorp
a569d55a0e test/multipath: add COMPARE AND WRITE test
Confirm that data is consistent across paths when using the atomic
COMPARE AND WRITE operation.
This should be extended in future to issue the requests simultaneously
across both paths, in an attempt to trigger a read/write race.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-09-17 19:13:39 +02:00
David Disseldorp
b9dd210194 test/multipath: add logical unit reset test
This test issues a logical unit reset iSCSI TMF request, and then
confirms that all paths report a subsequent unit attention condition.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-09-17 19:13:39 +02:00
Ronnie Sahlberg
b4cdf07271 Add tests that BlockLimits VPD matches the AtomicWrite16 support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-09 06:49:51 -07:00
Ronnie Sahlberg
6c16f9e322 Add tests for WRITE_ATOMIC_16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-08 10:17:15 -07:00
Ronnie Sahlberg
a6f7c06119 Add support and tests for ExtendedCopy and ReceiveCopyResults
From sushma.gurram@sandisk.com
Add support to libiscsi and tests for these two opcodes.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:57:21 -07:00
Ronnie Sahlberg
c29b9bcc60 TEST: NULL out rsop_task after freeing it to avoid double free.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:16:54 -07:00
Ronnie Sahlberg
a8e42680ed MULTIPATH TESTS: Remove the iscsi-only restriction. The tests work for /dev/* too
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:28:49 -07:00
Ronnie Sahlberg
95d763d9f9 TESTS: Add comment to describe why we keep a pointer around for iscsi_queue_pdu
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:16:39 -07:00
David Disseldorp
34dea87a69 test: add simple multipath IO test
Write data to device via one path, then read back using a different
path. Confirm that data is correct.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 19:27:21 +02:00
David Disseldorp
024fe873e3 iscsi-test-cu: support multiple iSCSI URLs for multipath
Connect to each iSCSI URL provided, and confirm that they all correspond
to the same multipathed logical unit by using the previously added
mpath_check_matching_ids() helper.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 16:56:18 +02:00
Ronnie Sahlberg
6e4a84f815 TESTS Add the modesense tests to the linux family
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-13 19:50:24 -07:00
Ronnie Sahlberg
b2b474f3ad TESTS: Allow inquiry(block dev characteristics) to fail
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:25:11 -07:00
Peter Lieven
b4098c535e init: make LIBISCSI_CACHE_ALLOCATIONS a public environment variable
this variable was introduced for iscsi-test-cu only. This patch
makes it a generic environment variable that can be set per context.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-05 14:10:44 +02:00
Bart Van Assche
cf4076dba9 test-tool: Make it possible to disable memory caching
Disable memory caching in libiscsi if the environment variable
LIBISCSI_CACHE_ALLOCATIONS has been set to zero. This makes
Valgrind reports more meaningful.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-20 07:01:17 -07:00
Ronnie Sahlberg
b6fc366b5c TESTS: Add a test for D_SENSE in the CONTROL mode page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-04-19 18:20:12 -07:00
Christoph Hellwig
e2e401c50c iscsi-test-cu: support arbitrary device nodes
We support SG_IO on various block devices, including but not limited to:
SCSI disks, CDROMs and tapes, virtio-blk and nvmve.

Instead of checking a filename prefix just treat anything that isn't
an iscsi:// url as a device node.  The ioctl checks after open will weed
out devices (or files) that don't support SG_IO.

Signed-off-by: Christoph Hellwig <hch@lst.de>
2015-04-18 08:43:00 -07:00
Ronnie Sahlberg
ba120e4347 TESTS: Add a test for the SWP flag in the CONTROL mode page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-04-18 08:27:03 -07:00
Ronnie Sahlberg
4e174f5d7c TESTS: Add basic test for CONTROL mode page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-04-18 08:03:15 -07:00
Bart Van Assche
52e45096df Do not pass NULL to access()
Avoid that Valgrind complains about passing a NULL pointer as first
argument to access().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-03-31 06:50:43 -07:00
Ronnie Sahlberg
51bd0ce3ec test-tool: remove the --usb argument and use BLCSECTGET to read max xfer
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-02-16 16:04:28 -08:00
Ronnie Sahlberg
52d9d84f9c README: update the readme and describe the family/suite/test better
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-30 19:54:56 -08:00
Ronnie Sahlberg
d33a0438a4 TESTS: replace read* flags tests with dedicated dpo/fua tests
Remove the flags tests for READ* and replace them with a test for the DPO
and FUA bits.
IF the device claims DPOFUA support in modesense then the READ* CDBs
MUST allow these two flags. IF the device does NOT claim DPOFUA then any
READ* CDB with these flags must fail with invalod field in cdb.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-22 20:05:29 -08:00
Ronnie Sahlberg
ef20220ac2 iscsi-test-cy.c: drop READ6 from the linux tests. it is obsolete 2014-09-21 14:19:35 -07:00
Ronnie Sahlberg
1e3cc445c8 TESTS: Remove some tests that wont work yet for /dev/sg
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 17:15:48 -07:00
Ronnie Sahlberg
59817c7959 TESTS: rename the old and abandoned scsi-usb-sbc testsuite to LINUX
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 16:33:03 -07:00
Ronnie Sahlberg
55c1f0d2ec TESTS: Add support to test against a /dev/sg device on linux
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 16:26:46 -07:00
Ronnie Sahlberg
bd6570c324 TESTS: create an abstraction to connect to a device
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 06:26:53 -07:00
Ronnie Sahlberg
48e14f5ccf TESTS: update main program to use helpers instead of calling directly to libiscsi
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 06:21:02 -07:00
Ronnie Sahlberg
8ed2ad9b69 TESTS: start abstracting away the error string handling from transports
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 19:20:49 -07:00
Ronnie Sahlberg
74a50052cd TESTS: get rid of iscsic2
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:37:35 -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
a41ec1fe60 TESTS: Add tests that get_lba_status for a single range works
Add a test for unmapping a single range of blocks and that
get_lba_status returns correct data.

Test unmapping a single block at offsets 0-255

Test unmapping 1-255 blocks at offset 0 and verify that
get_lba_status at LBA 0 returns a descriptor of 1-255 blocks.
get_lba_status at the last block of the unmapped range returns
a descriptor for a single block.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-14 19:46:12 -07:00
Ronnie Sahlberg
91156cffe9 TESTS: Allow specifying a file instead of a test glob pattern
Allow specifying a --test <file>  in which case the tests listed in the file
will be executed.
This makes it easier than having to specify a potentially huge number
of tests on the command line.
2014-03-26 19:10:12 -07:00
Ronnie Sahlberg
458764a77d TESTS: Add support to specify multiple test glob expressions 2014-03-26 18:35:07 -07:00
Ronnie Sahlberg
68610bd7cf TESTS: The SCSI test is called TestUnitReady, not UnitReady 2014-03-26 18:20:27 -07:00
Jon Hermansen
d34d61a782 add automated XML output option to iscsi-test-cu 2014-03-11 16:15:19 -07:00
Ronnie Sahlberg
cc81b67620 TESTS: Add tests for invalid iSCSI DATASN values. 2014-01-26 09:35:17 -08:00
Ronnie Sahlberg
993be6c439 Free the correct inq task to avoid leaking memory during startup. 2014-01-06 18:26:03 -08: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
bd948c959e Port to CUnit version 2
Linux distributions like openSUSE 12.3 include CUnit version 2.
Apparently libiscsi uses some CUnit version 1 data structures that
have been modified in CUnit version 2. This causes the libiscsi
build to fail against CUnit version 2. Fix this by detecting the
CUnit version during the configure step.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-01 06:22:06 -07:00
Ronnie Sahlberg
8aa6d9de8f TESTS: Add a test for COMPARE_AND_WRITE when the data to verify does not match 2013-09-23 21:58:55 -07:00
Ronnie Sahlberg
9f1a28f753 TESTS: Add an initial simple test for COMPARE_AND_WRITE
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2013-09-22 17:02:30 -07:00
Ronnie Sahlberg
d901700633 Add a test that a sanitize operation will continue across resets
Verify that abort task/abort task set/lun reset/warm reset/cold reset
and full blown session failures will not affect a sanitize that is in
progress
2013-07-21 14:11:13 -07:00
Ronnie Sahlberg
52a83e91af Add POWER_CONDITION modepage marshalling/unmarshalling 2013-07-20 15:35:38 -07:00
Ronnie Sahlberg
a3283fbafd TESTS: Add a test that SANITIZE fails when SWP is on. 2013-07-09 02:27:30 -07:00
Ronnie Sahlberg
6e5a5745aa TESTS: Add a test that SANITIZE commands fail when there is a RESERVATION 2013-07-09 01:51:00 -07:00
Ronnie Sahlberg
accdad5b1a TESTS: Rename the tests and strip off the redundant prefix for the individual tests
We dont need to repeat the opcode all the time so remove it from the indiviual tests

SCSI.Read10.Read10Simple -> SCSI.Read10.Simple
2013-07-05 16:37:04 -07:00
Ronnie Sahlberg
cee82ad135 TESTS: Add tests for the reserved bits/bytes in SANITIZE 2013-07-05 13:32:49 -07:00