Commit Graph

124 Commits

Author SHA1 Message Date
Ronnie Sahlberg
c172e12968 UTILS: Check that an iscsi url was provided on the command line before strdup()ing it 2013-07-20 09:01:38 -07:00
Ronnie Sahlberg
ee689ee3fb TESTS: Update the protection tests 2013-05-12 08:06:08 -07:00
Ronnie Sahlberg
5135836ee5 TESTS: keep the unmarshalled std inq structure around 2013-05-11 17:07:59 -07:00
Ronnie Sahlberg
a048079c90 covnert the old test suite grom popt to getopt_long 2013-04-21 10:19:40 -07:00
Ronnie Sahlberg
179d7b4f55 TESTS: Add different log levels to the TUR test test suite and see how it looks
Add different log levels and update the TUR testsute.
Update the helper for testunitready() so that it
* prints FAILURE messages for normal and verbose levels
* prints selfdocumenting messages for which SCSI command it sends and the expected result for the verbose level
2013-01-06 15:04:31 -08:00
Lee Duncan
d3324decd2 CUnit tests now working for first 2 suites, but
Makefile.am not correct yet.
2013-01-04 18:11:36 -08:00
Lee Duncan
b8da17b3ec Now main() is seperate from guts of testing. 2013-01-03 19:56:30 -08:00
Lee Duncan
ee5000ba9d Moved support routines from iscsi-test to iscsi-support,
in preperation for sharing non-main functions.
2013-01-02 17:15:48 -08:00
Lee Duncan
d9664cb26a Added test for other 5 PGR reservation types. 2012-12-28 11:21:37 -08:00
Lee Duncan
6a122428dd Merge https://github.com/sahlberg/libiscsi 2012-12-27 19:18:53 -08:00
Lee Duncan
fbf8b5e426 - Made PGR test more verbose (naming initiator).
- Added test for Exclusive Access PGR reservation access testing.
2012-12-27 12:51:38 -08:00
Ronnie Sahlberg
91155c42e4 TESTS: Read standard inq page before we spawn the tests
We dont need to call inq so often from the tests if we read the standard page once before the tests begin
2012-12-27 11:47:34 -08:00
Ronnie Sahlberg
3a4605d3e5 TESTS: Remove some READCAPACITY16 we no longer need 2012-12-27 07:04:23 -08:00
Ronnie Sahlberg
5ad957b873 TESTS: Start fixing up the tests so we can test-suite them properly
Dont call READCAPACITY from every single test.
Remove two arguments from the test signatures and turn them into globals.
remove the ret++ silliness.  Tests return 0 : all ok, -2, skipped or -1 : test failed
2012-12-26 18:34:12 -08:00
Ronnie Sahlberg
3c960c1d42 TESTS: Create helpers for VERIFY16 and switch all tests over to use them 2012-12-26 09:25:45 -08:00
Ronnie Sahlberg
eb2a586cc4 Merge remote branch 'gonzoleeman/master' 2012-12-26 05:44:36 -08:00
Ronnie Sahlberg
61ad9b1972 TESTS: Create helpers for verify12 and switch all tests to use them 2012-12-25 16:14:45 -08:00
Ronnie Sahlberg
12179de245 TESTS: create helpers for VERIFY10 and switch all tests over to use it. 2012-12-25 15:48:11 -08:00
Ronnie Sahlberg
2afb5accc4 TESTS: Create helpers for PREFETCH16 and switch all tests over to them 2012-12-25 08:57:05 -08:00
Ronnie Sahlberg
047b650151 TEST: Add helpers for PREFETCH10 and convert all tests to use them 2012-12-25 08:31:30 -08:00
Ronnie Sahlberg
4ee24799ed TESTS: Change all remaining uses of testunitready to use the new helper 2012-12-24 15:09:10 -08:00
Lee Duncan
d72e6b3717 Removed custom struct for tracking Persistent Resvn type. 2012-12-23 21:36:46 -08:00
Ronnie Sahlberg
b9c516147a TESTS: Add helpers for testunitready. Change 0000 and 0360 to use new testunitready helpers 2012-12-23 20:49:38 -08:00
Lee Duncan
9ea26fbca5 Cleanup to make tests easier to read. 2012-12-22 14:12:10 -08:00
Lee Duncan
474cec5556 Added new 1130* test file for PGR simple reserve testing.
Added infrastructure to support reading, setting, and
clearing reservations.
2012-12-22 13:50:55 -08:00
Ronnie Sahlberg
0338e4edd0 TEST: Change the last test to be a more simple REGISTER/UNREGISTER test for persisntet registrations. 2012-12-18 20:30:03 -08:00
Ronnie Sahlberg
2a74fc00bc Initial support for PERSISTENT_RESERVER_OUT and add a simple test to show the api 2012-12-17 21:25:46 -08:00
Ronnie Sahlberg
d324a94051 Add test for the range of service actions for PERSISTENT_RESERVE_IN 2012-12-17 19:42:30 -08:00
Ronnie Sahlberg
c60093eafe Add support for PERSISTENT_RESERVE_IN and add a simple test for READ_KEYS 2012-12-17 19:01:50 -08:00
Ronnie Sahlberg
f1d5510e9c TESTS: Add test that we can talk to a target with IMMEDIATE_DATA==NO and INITIAL_R2T==NO 2012-12-01 11:40:07 -08:00
Ronnie Sahlberg
04970ef95e TESTS: Add a new test that does a one block write using unsilicited immediate data
As part of the test also validate the PDU that libiscsi generates and verify that
1, the PDU we send has the F flag set
2, that datasegmentlength for the PDU is one block
2012-12-01 10:45:42 -08:00
Ronnie Sahlberg
efc556e2e9 TESTS: Create a test that tries to overflow the maxcmdsn counter
so that i/o from the initiator stops flowing and are just queued locally
until teh cmdsn window opens up again.

Send a lot of writes that block until we have processed the R2T
back from the target and verify we can still make process when we
have saturated the cmdsn window and are also blocked waiting for R2Ts.
2012-11-27 19:51:22 -08:00
Bernhard Kohl
219533dc7b Returned buffers from poptGetArgs() are free()ed in poptFreeContext()
Calling "free(url);" causes a core dump in glibc-2.15.

Signed-off-by: Bernhard Kohl <bernhard.kohl@gmx.net>
2012-11-18 14:12:30 -08:00
Ronnie Sahlberg
9eb26a368d Fix compiler warnings related to 'const' 2012-11-11 10:03:45 -08:00
Arne Redlich
4d27ecae32 test-tool: fix initiatorname and initiatorname2 issues
gcc-4.6.3 warned about this one on several occasions:
  gcc -DHAVE_CONFIG_H -I.  -I. -I./include "-D_U_=__attribute__((unused))" -I./test-tool  -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -ggdb3 -O0 -MT test-tool/bin_iscsi_test-0000_testunitready_simple.o -MD -MP -MF test-tool/.deps/bin_iscsi_test-0000_testunitready_simple.Tpo -c -o test-tool/bin_iscsi_test-0000_testunitready_simple.o `test -f 'test-tool/0000_testunitready_simple.c' || echo './'`test-tool/0000_testunitready_simple.c
  test-tool/0000_testunitready_simple.c: In function 'T0000_testunitready_simple':
  test-tool/0000_testunitready_simple.c:23:44: warning: declaration of 'initiator' shadows a global declaration [-Wshadow]
  test-tool/iscsi-test.h:20:20: warning: shadowed declaration is here [-Wshadow]

For now the global initiator is renamed to initiatorname1 (and initiator2 is
renamed to initiatorname2, respectively), but ultimately the globals should
probably go away.

While fixing this it also became apparent that initiator-name-2 was parsed
into the "initiator" variable as well.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-10-31 15:32:18 +01:00
Ronnie Sahlberg
6507f4050f Merge pull request #31 from plieven/master
memory leak fixes + suggestion for iscsi context + qemu-kvm bug
2012-10-30 18:54:38 -07:00
Ronnie Sahlberg
9e9c6946c0 TESTS: Add a test that a target handles an unsolicited DATA-OUT correctly.
Send a large number of DATA-OUT PDUs that do not have a matching SCSI-COMMAND
PDU and verify that the target responds correctly. Either by terminating the
session or by just ignoring the data.

Verify also that the target is not "surprised" and crashes.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-10-30 18:44:35 -07:00
Peter Lieven
774ede1f46 ISCSI_URL change strings from dynamic to static 2012-10-30 11:41:51 +01:00
Peter Lieven
d989474a36 ISCSI-TEST free strings malloc'ed by libpopt 2012-10-29 22:07:58 +01:00
Jon Grimm
b81bdd3932 Merge with upstream 2012-10-25 12:56:26 -05:00
Jon Grimm
1eaca70a52 Add MaintenanceIn: Report Supported Opcodes (all) and testcase. 2012-10-25 12:48:37 -05:00
Peter Lieven
03528f3965 TEST: add skip command to skip individual tests
This patch adds a command to skip individual tests. It additionally accepts
more than one test separated by comma.
2012-10-25 10:27:09 +02:00
Ronnie Sahlberg
b700d44f03 TESTS: Add a simple test to check that a target survives huge imemdiate data
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-10-24 21:19:27 -07:00
Ronnie Sahlberg
676bf2372c TEST: Add test that target reset will release a RESERVE6 2012-10-04 21:37:41 -07:00
Ronnie Sahlberg
06e925f2fd TEST: Add a test to verify that reservation are dropped on session termination 2012-10-01 18:41:08 -07:00
Ronnie Sahlberg
30a32b4335 TESTS: Add two tests that RESERVE6 is dropped on LUN-reset as well as session logout 2012-09-30 09:25:39 -07:00
Ronnie Sahlberg
b160b95060 TESTS: Add 'initiator2' variable so we can run tests with two different initiatir names
Update the 0420 test to use different initiator names for the two sessions to the target.
2012-09-30 08:25:23 -07:00
Jon Grimm
26d090e191 Add testcase for RESERVE6/RELEASE6 2012-09-27 14:17:24 -05:00
Jon Grimm
d6bea3db52 merge fixup 2012-09-24 10:22:58 -05:00
Jon Grimm
e55ec72f36 Add Read TOC (0x43) Command Support (and basic testcase). 2012-09-24 10:15:00 -05:00