本文整理汇总了Python中pyscsi.pyscsi.scsi.SCSI.readcapacity10方法的典型用法代码示例。如果您正苦于以下问题:Python SCSI.readcapacity10方法的具体用法?Python SCSI.readcapacity10怎么用?Python SCSI.readcapacity10使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyscsi.pyscsi.scsi.SCSI
的用法示例。
在下文中一共展示了SCSI.readcapacity10方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import readcapacity10 [as 别名]
def main():
dev = MockReadCapacity10()
dev.opcodes = sbc
s = SCSI(dev)
i = s.readcapacity10().result
assert i["returned_lba"] == 65536
assert i["block_length"] == 4096
d = ReadCapacity10.unmarshall_datain(ReadCapacity10.marshall_datain(i))
assert d == i
示例2: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import readcapacity10 [as 别名]
def main(device):
try:
sd = SCSIDevice(device)
s = SCSI(sd)
print 'ReadCapacity10'
print '==========================================\n'
r = s.readcapacity10().result
for k, v in r.iteritems():
print '%s - %s' % (k, v)
except Exception as e:
print (e.message)
示例3: main
# 需要导入模块: from pyscsi.pyscsi.scsi import SCSI [as 别名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import readcapacity10 [as 别名]
def main():
dev = MockReadCapacity10()
dev.opcodes = sbc
s = SCSI(dev)
s.device.opcodes = sbc
r = s.readcapacity10()
cdb = r.cdb
assert cdb[0] == s.device.opcodes.READ_CAPACITY_10.value
assert cdb[1:10] == bytearray(9)
cdb = r.unmarshall_cdb(cdb)
assert cdb['opcode'] == s.device.opcodes.READ_CAPACITY_10.value
d = ReadCapacity10.unmarshall_cdb(ReadCapacity10.marshall_cdb(cdb))
assert d == cdb