本文整理汇总了Python中pyscsi.pyscsi.scsi.SCSI.testunitready方法的典型用法代码示例。如果您正苦于以下问题:Python SCSI.testunitready方法的具体用法?Python SCSI.testunitready怎么用?Python SCSI.testunitready使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyscsi.pyscsi.scsi.SCSI
的用法示例。
在下文中一共展示了SCSI.testunitready方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import testunitready [as 别名]
def main(device):
try:
sd = SCSIDevice(device)
s = SCSI(sd)
s.testunitready()
except Exception as e:
print (e)
else:
print ('ReportPriority')
print ('==========================================\n')
try:
r = s.reportpriority().result
for k, v in r.iteritems():
print('%s - %s' % (k, v))
except Exception as e:
print (e)
示例2: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import testunitready [as 别名]
def main():
i = 1
page_code = 0
evpd = 0
while i < len(sys.argv):
if sys.argv[i] == '--help':
return usage()
if sys.argv[i] == '-p':
del sys.argv[i]
page_code = int(sys.argv[i], 16)
evpd = 1
del sys.argv[i]
continue
i += 1
if len(sys.argv) < 2:
return usage()
device = sys.argv[1]
sd = SCSIDevice(device)
s = SCSI(sd)
i = s.testunitready()
if not evpd:
inquiry_standard(s)
return
if page_code == INQUIRY.VPD.SUPPORTED_VPD_PAGES:
inquiry_supported_vpd_pages(s)
return
if page_code == INQUIRY.VPD.BLOCK_LIMITS:
inquiry_block_limits(s)
return
if page_code == INQUIRY.VPD.BLOCK_DEVICE_CHARACTERISTICS:
inquiry_block_dev_char(s)
return
if page_code == INQUIRY.VPD.LOGICAL_BLOCK_PROVISIONING:
inquiry_logical_block_prov(s)
return
if page_code == INQUIRY.VPD.UNIT_SERIAL_NUMBER:
inquiry_unit_serial_number(s)
return
if page_code == INQUIRY.VPD.DEVICE_IDENTIFICATION:
inquiry_device_identification(s)
return
print 'No pretty print for this page, page_code=0x%02x' % page_code
print '=============================================\n'
i = s.inquiry(evpd=1, page_code=page_code).result
for k, v in i.iteritems():
print '%s - %s' % (k, v)
示例3: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import testunitready [as 别名]
def main():
dev = MockTestUnitReady()
dev.opcodes = sbc
s = SCSI(dev)
w = s.testunitready()
cdb = w.cdb
assert cdb[0] == s.device.opcodes.TEST_UNIT_READY.value
assert cdb[1] == 0
assert cdb[2] == 0
assert cdb[3] == 0
assert cdb[4] == 0
assert cdb[5] == 0
cdb = w.unmarshall_cdb(cdb)
assert cdb['opcode'] == s.device.opcodes.TEST_UNIT_READY.value
d = TestUnitReady.unmarshall_cdb(TestUnitReady.marshall_cdb(cdb))
assert d == cdb