def register_key_example(device):
    with asi_context_linux(device) as asi:
        command = PersistentReserveOutCommand(
            service_action=PERSISTENT_RESERVE_OUT_SERVICE_ACTION_CODES.REGISTER,
            service_action_reservation_key=0xABBA)
        response = sync_wait(command.execute(asi))
        return response
Example #2
0
 def test_generate_command(self):
     """
     Operation code (0x5e)
     Service action: Read Reservation (0x01)
     Allocation length (0x20)
     """
     from infi.asi.cdb.persist.output import PersistentReserveOutCommand, PERSISTENT_RESERVE_OUT_SERVICE_ACTION_CODES
     obj = PersistentReserveOutCommand(service_action=PERSISTENT_RESERVE_OUT_SERVICE_ACTION_CODES.RESERVE)
     self.assertEquals(obj.pack(), b"\x5f\x01\x01\x00\x00\x00\x00\x00\x18\x00")