1ISCSI-TEST-CU(1) iscsi-test-cu: iSCSI/SCSI pr ISCSI-TEST-CU(1)
2
3
4
6 iscsi-test-cu - iSCSI/SCSI test suite
7
9 iscsi-test-cu [ OPTIONS ] <ISCSI-PORTAL>
10
11 iscsi-test-cu [-i --initiator-name=<IQN>] [-I --initiator-name-2=<IQN>]
12 [-l --list] [-t --test=<family>|*[.<suite>|*[.<test>|*]]]
13 [-d --dataloss] [-s --allow-sanitize] [-V --Verbose-scsi]
14 [-x --xml] [-? --help]
15
17 iscsi-test-cu is a test suite for iSCSI/SCSI.
18
20 iSCSI portal format is
21 'iscsi://[<username>[%<password>]@]<host>[:<port>]/<iqn-name>/<lun>'
22
23 Port is the TCP port on the target to connect to. Default is 3260.
24
25 Username and password are only required if the target requires CHAP
26 authentication. Optionally you can specify the username and password
27 via the environment variables LIBISCSI_CHAP_USERNAME and
28 LIBISCSI_CHAP_PASSWORD.
29
30 Host can be specified either as a hostname, an IPv4 address or an IPv6
31 address. Examples:
32
33 iscsi://192.0.2.1/iqn.ronnie.test/1
34 iscsi://[2001:DB8::1]:3261/iqn.ronnie.test/1
35 iscsi://ronnie%password@iscsi.example.com/iqn.ronnie.test/1
36
37
38
40 -i --initiator-name=<IQN>
41 All tests use at least one iSCSI connection to the target and this
42 is the initiator name used for that primary session and it defaults
43 to 'iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test'
44
45 This argument is used to change what initiator name to use for the
46 primary session.
47
48 -I --initiator-name-2=<IQN>
49 Some tests use a second connection to the target, such as the 'it
50 nexus loss tests'. The default name used for this second connection
51 is 'iqn.2007-10.com.github:sahlberg:libiscsi:iscsi-test-2'
52
53 This argument is used to change what initiator name to use for the
54 secondary session.
55
56 -l --list
57 This argument lists all available tests.
58
59 The tests are divided up into 'families', 'suites' and 'tests'
60 separated by '.'.
61
62 iscsi-test-cu -l
63 ALL
64 ALL.CompareAndWrite
65 ALL.CompareAndWrite.Simple
66 ALL.CompareAndWrite.Miscompare
67 ALL.GetLBAStatus
68 ALL.GetLBAStatus.Simple
69 ALL.GetLBAStatus.BeyondEol
70 ...
71
72
73
74 -t --test=<family>|*[.<suite>|*[.<test>|*]]
75 This argument specifies a comma-separated list of the test
76 expressions to run. If this argument is omitted then all tests will
77 be executed. You can also just specify a filename from which to
78 read the list of tests.
79
80 To run all tests:
81 iscsi-test-cu --test=ALL iscsi://192.0.2.1/iqn.ronnie/test/1
82
83 To run the READ16 test suite:
84 iscsi-test-cu --test=SCSI.Read16.* \
85 iscsi://192.0.2.1/iqn.ronnie/test/1
86
87 To just run a single specific test:
88 iscsi-test-cu --test=iSCSI.iSCSIResiduals.Read10Invalid \
89 iscsi://192.0.2.1/iqn.ronnie/test/1
90
91 Run all tests in the TestUnitReady suite and also the Reaqd16.Flags test
92 iscsi-test-cu --test=SCSI.TestUnitReady.*,SCSI.Read16.Flags \
93 iscsi://192.0.2.1/iqn.ronnie/test/1
94
95 Run all tests listed in the file ~/tests-to-run
96 iscsi-test-cu --test=~/tests-to-run
97 iscsi://192.0.2.1/iqn.ronnie/test/1
98
99
100
101 -d --dataloss
102 By default the test tool will only run non-destructive tests. To
103 test commands that mutates the data, such as the Write* tests you
104 must specify the --dataloss flag.
105
106 The tests that requre --dataloss will overwrite the data on the LUN
107 and any and all data on that LUN will be destroyed when running
108 these tests.
109
110 -s --allow-sanitize
111 The SBC SANITIZE opcode is expected to take significant time before
112 it completes and thus tests for this opcode are not suitable for
113 normal test runs.
114
115 By default any SBC SANITIZE tests will be skipped. Use these
116 arguments if you really want to perform SANITIZE tests.
117
118 -V --Verbose-scsi
119 The tests aims to be self-documenting. By specifying the -V flag
120 the test tool will print all SCSI commands that are sent to the
121 device, the arguments and the expected result.
122
123 If a test fails, re-run the failing test with the -V argument to
124 see why it failed. If that also fails it is time to pull out
125 wireshark and have a look at what happened.
126
127 iscsi-test-cu --test SCSI.Read10.BeyondEol iscsi://192.0.2.1/iqn.ronnie.test/1 -V
128 Suite: Read10
129 Test: BeyondEol ...
130 Test READ10 1-256 blocks one block beyond the end
131 Send READ10 (Expecting LBA_OUT_OF_RANGE) LBA:2097152 blocks:1 rdprotect:0 dpo:0 fua:0 fua_nv:0 group:0
132 [OK] READ10 returned ILLEGAL_REQUEST/LBA_OUT_OF_RANGE.
133 ...
134
135
136
137 -x --xml
138 This option to produce test results in machine readable format for
139 automated testing.
140
141 iscsi-test-cu can produce machine-readable test results for
142 consumption by your CI server. Use the --xml option with any test
143 suite(s), and a file called CUnitAutomated-Results.xml will be
144 written to your current working directory. These results can be
145 converted to JUnit format using this script:
146 http://git.cyrusimap.org/cyrus-imapd/plain/cunit/cunit-to-junit.pl
147
148 The return status of the script reflects whether the tests were
149 successful or not. If you would rather have the script return a
150 status to reflect whether the conversion from cunit to junit was
151 successful you can patch the script with this:
152
153 diff --git a/cunit-to-junit.pl.orig b/cunit-to-junit.pl
154 index 7cf9320..9182ff0 100644
155 --- a/cunit-to-junit.pl.orig
156 +++ b/cunit-to-junit.pl
157 @@ -226,4 +226,4 @@ foreach my $s (@suites)
158 }
159
160 print "$0: ran $nrun tests, $nfailed failed\n";
161 -exit(1) if ($nfailed > 0);
162 +#exit(1) if ($nfailed > 0);
163
164
165
166 -? --help
167 Display basic help text.
168
170 http://github.com/sahlberg/libiscsi
171
172
173
174iscsi-test-cu 02/16/2015 ISCSI-TEST-CU(1)