本文整理匯總了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