Lines Matching full:machine

4 """Machine Manager module."""
37 """Raised when cannot find/access the machine locks directory."""
45 """The machine class."""
82 command, machine=self.name, chromeos_root=self.chromeos_root)
119 #TODO yunlian: when the machine in rebooting, it will not return
123 command, machine=self.name, chromeos_root=self.chromeos_root)
124 assert ret == 0, 'Could not get meminfo from machine: %s' % self.name
131 command, machine=self.name, chromeos_root=self.chromeos_root)
132 assert ret == 0, 'Could not get cpuinfo from machine: %s' % self.name
151 command, machine=self.name, chromeos_root=self.chromeos_root)
159 command, machine=self.name, chromeos_root=self.chromeos_root)
169 assert 0, 'Could not get machine_id from machine: %s' % self.name
190 same machine at the same time.
231 def GetChromeVersion(self, machine): argument
236 cmd, machine=machine.name, chromeos_root=self.chromeos_root)
239 "Couldn't get Chrome version from %s." % machine.name)
245 def ImageMachine(self, machine, label): argument
248 if checksum and (machine.checksum == checksum):
257 '--image_args=%s' % label.image_args, '--remote=%s' % machine.name,
271 self.logger.LogOutput('Pushing image onto machine.')
282 cmd, machine=machine.name, chromeos_root=self.chromeos_root)
285 self.logger.LogOutput('Pushing image onto machine.')
290 raise RuntimeError("Could not image machine: '%s'." % machine.name)
293 machine.checksum = checksum
294 machine.image = label.chromeos_image
295 machine.label = label
298 label.chrome_version = self.GetChromeVersion(machine)
308 for machine in self.GetMachines(label):
309 # Make sure the machine's checksums are calculated.
310 if not machine.machine_checksum:
311 machine.SetUpChecksumInfo()
312 cs = machine.machine_checksum
313 # If this is the first machine we've examined, initialize
317 # Make sure this machine's checksum matches our 'common' checksum.
319 raise BadChecksum('Machine checksums do not match!')
328 for machine in self.GetMachines(label):
329 if machine.checksum_string:
330 self.machine_checksum_string[label.name] = machine.checksum_string
335 assert cros_machine, "Machine can't be None"
341 locked = file_lock_machine.Machine(cros_machine.name,
350 machine=cros_machine.name)
365 'Checking machine characteristics for %s' % machine_name)
374 res = file_lock_machine.Machine(machine_name,
377 self.logger.LogError("Could not unlock machine: '%s'." % machine_name)
406 "following machines: '%s'" % ', '.join(machine.name
407 for machine in machines))
414 machine for machine in self.GetAvailableMachines(label)
415 if not machine.locked
427 # This logic ensures that threads waiting on a machine will get a machine
454 def ReleaseMachine(self, machine): argument
457 if machine.name == m.name:
468 res = file_lock_machine.Machine(m.name, self.locks_dir).Unlock(True)
471 self.logger.LogError("Could not unlock machine: '%s'." % m.name)
481 header = stringify_fmt % ('Machine', 'Thread', 'Lock', 'Status',
498 return 'Machine Status:\n%s' % '\n'.join(table)
504 for machine in self._all_machines:
505 if machine.name in label.remote:
506 dic[machine.cpuinfo].append(label.name)
522 """Mock cros machine class."""
624 #In test, we assume "lumpy1", "lumpy2" are the same machine.
643 """Mock machine manager class."""
659 'Could not find checksum for machine %s' % machine_name)
661 # machine is unreachable, then its machine_checksum is None. Here we
667 def GetChromeVersion(self, machine): argument
671 for machine in self._all_machines:
672 if not machine.locked:
673 machine.locked = True
674 return machine
682 def ReleaseMachine(self, machine): argument
683 machine.locked = False
696 for machine in self.GetMachines(label):
697 machine.machine_checksum = common_checksum