tool to validate iscsi commands

ronnie sahlberg ronniesahlberg at gmail.com
Sat Apr 18 08:39:49 PDT 2015


* From the T10 Reflector (t10 at t10.org), posted by:
* ronnie sahlberg <ronniesahlberg at gmail.com>
*
Hi Felipe,
Python
---------
If you want to generate SCSI commands semi-interactively you can do this
using :
https://github.com/rosjat/python-scsi
If you also install my
https://github.com/sahlberg/libiscsi
You can then interact with SCSI devices either through /dev/sg* device
nodes on Linux, or via iSCSI devices by specifying an iSCSi URL.
Python is very nice for this and this module above will return the
unmarshalled data in a simple dict you can inspect.
Example for the CONTROL page:
  sudo python
  >>> from pyscsi.pyscsi.scsi import SCSI
  >>> from pyscsi.pyscsi.scsi_device import SCSIDevice
  >>> from pyscsi.pyscsi import scsi_enum_modesense6 as MODESENSE6
  >>> s = SCSI(SCSIDevice("iscsi://127.0.0.1/iqn.ronnie.test/1"))
  >>> res = s.modesense6(page_code=MODESENSE6.PAGE_CODE.CONTROL).result
  >>> print res
{'device_specific_parameter': 16, 'medium_type': 0, 'mode_pages':
[{'dpicz': 0, 'ua_intlck_ctrl': 0, 'rac': 0, 'qerr': 0,
'queue_algorithm_modifier': 1, 'd_sense': 0, 'gltsd': 1,
'autoload_mode': 0, 'vs': 0, 'page_code': 10, 'spf': 0, 'ps': 0,
'nuar': 0, 'rlec': 0, 'ato': 0, 'tas': 0, 'rwwp': 0,
'busy_timeout_period': 0, 'extended_self_test_completion_time': 512,
'atmpe': 0, 'swp': 0, 'tst': 0, 'tmf_only': 0}]}
libiscsi test-suite
----------------------
For automated testing it is probably better to use the test tool in
the libiscsi repository above.
It currently only have limited tests for the CONTROL page but I am
happy to extend it with your suggestions.
The two current tests are:
iscsi-test-cu iscsi://127.0.0.1/iqn.ronnie.test/1 --test
SCSI.ModeSense6.Control -V
This test verifies that you can read the page through both ALL-PAGES
as well as reading the CONTROL page directly and that the data is the
same.
(some targets fail here)
It also does some basic sanity checks to verify that fields are not
set to reserved vales and so.
iscsi-test-cu iscsi://127.0.0.1/iqn.ronnie.test/1 --test
SCSI.ModeSense6.Control-SWP -V --dataloss
This test is specific for the SWP flag for this argument and it will
verify that MODE_SELECT changing this flag works and that the device
does become read-only properly.
I should probably add some tests for the D_SENSE flag too....
best regards
ronnie sahlberg
On Fri, Apr 17, 2015 at 1:47 PM, Felipe Gutierrez <felipe at usto.re> wrote:
> Thanks Elliott, I will test it.
>
> On Fri, Apr 17, 2015 at 2:06 PM, Elliott, Robert (Server Storage)
> <Elliott at hp.com> wrote:
>>
>> Ronnie Sahlburg has an iSCSI-based test suite for linux that you might
>> find helpful.
>>
>>
>>
>> SNIA presentation in 2013:
>>
>>
>>
http://www.snia.org/sites/default/files2/SDC2013/presentations/TestingMethodo
logies/RonnieSahlberg_iscsi_testing.pdf
>>
>>
>>
>> 2014 announcement adding support for /dev/sg devices:
>>
>> http://marc.info/?l=linux-scsi&m=141131513312063&w=2
>>
>>
>>
>> -----Original Message-----
>> From: linux-scsi-owner at vger.kernel.org
>> [mailto:linux-scsi-owner at vger.kernel.org] On Behalf Of ronnie sahlberg
>> Sent: Sunday, September 21, 2014 10:59 AM
>> To: linux-scsi at vger.kernel.org
>> Subject: SCSI test tool for linux (and others)
>>
>>
>>
>> I have recently converted my iscsi based test suite to allow running
>>
>> it against /dev/sg* devices in addition to iscsi targets.
>>
>>
>>
>> The purpose here is to create a tool that can be used by vendors to
>>
>> test that their device will be well supported by the Linux SCSI stack.
>>
>> To have a tool that you can send to vendors and ask that "please run
>>
>> these tests, if you pass you have higher probability to interoperate
>>
>> well with us".
>>
>>
>>
>> In order to do this I added a new "Family" of tests to my tool, which
>>
>> I called LINUX.
>>
>>
>>
>> …
>>
>> LINUX.*.* currently runs some >150 different suites/tests and hundreds
>>
>> of thousands of individual checks/asserts.
>>
>>
>>
>> ---
>>
>> Robert Elliott, HP Server Storage
>>
>>
>>
>> From: owner-t10 at t10.org [mailto:owner-t10 at t10.org] On Behalf Of Felipe
>> Gutierrez
>> Sent: Friday, April 17, 2015 8:49 AM
>> To: t10 at t10.org
>> Subject: tool to validate iscsi commands
>>
>>
>>
>> Hello,
>>
>>
>>
>> I wounder to know if there is an iSCSI tool to generate iSCSI commands.
>>
>>
>>
>> I have to code the MODE_SENSE_6 - CONTROL_MODE_PAGE that only VMWare iSCSI
>> is requesting. The microsoft initiator and linux open-iscsi are not
>> requesting it.
>>
>>
>>
>> I coded this message as says
>> http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc5r03.pdf "7.5.10 Control mode
page
>> - Table 415", but I am not sure ho to validate it.
>>
>>
>>
>> Does the better way is to use some tool to send this exactly command and
>> check it?
>>
>>
>>
>> Thanks.
>>
>> Felipe
>
>
*
* For T10 Reflector information, send a message with
* 'info t10' (no quotes) in the message body to majordomo at t10.org



More information about the T10 mailing list