• Home
  • Raw
  • Download

Lines Matching full:machine

4 """Machine Manager module."""
37 """Raised when cannot find/access the machine locks directory."""
45 """The machine class."""
82 machine=self.name,
120 #TODO yunlian: when the machine in rebooting, it will not return
125 machine=self.name,
127 assert ret == 0, 'Could not get meminfo from machine: %s' % self.name
135 machine=self.name,
137 assert ret == 0, 'Could not get cpuinfo from machine: %s' % self.name
157 machine=self.name,
167 machine=self.name,
178 assert 0, 'Could not get machine_id from machine: %s' % self.name
199 same machine at the same time.
240 def GetChromeVersion(self, machine): argument
246 machine=machine.name,
250 machine.name)
256 def ImageMachine(self, machine, label): argument
259 if checksum and (machine.checksum == checksum):
268 machine.name, '--logging_level=%s' % self.log_level]
280 self.logger.LogOutput('Pushing image onto machine.')
291 machine=machine.name,
295 self.logger.LogOutput('Pushing image onto machine.')
300 raise RuntimeError("Could not image machine: '%s'." % machine.name)
303 machine.checksum = checksum
304 machine.image = label.chromeos_image
305 machine.label = label
308 label.chrome_version = self.GetChromeVersion(machine)
318 for machine in self.GetMachines(label):
319 # Make sure the machine's checksums are calculated.
320 if not machine.machine_checksum:
321 machine.SetUpChecksumInfo()
322 cs = machine.machine_checksum
323 # If this is the first machine we've examined, initialize
327 # Make sure this machine's checksum matches our 'common' checksum.
329 raise BadChecksum('Machine checksums do not match!')
338 for machine in self.GetMachines(label):
339 if machine.checksum_string:
340 self.machine_checksum_string[label.name] = machine.checksum_string
345 assert cros_machine, "Machine can't be None"
351 locked = file_lock_machine.Machine(cros_machine.name,
360 machine=cros_machine.name)
374 self.logger.LogOutput('Checking machine characteristics for %s' %
384 res = file_lock_machine.Machine(machine_name,
387 self.logger.LogError("Could not unlock machine: '%s'." % machine_name)
416 ', '.join(machine.name for machine in machines))
422 unlocked_machines = [machine
423 for machine in self.GetAvailableMachines(label)
424 if not machine.locked]
435 # This logic ensures that threads waiting on a machine will get a machine
462 def ReleaseMachine(self, machine): argument
465 if machine.name == m.name:
476 res = file_lock_machine.Machine(m.name, self.locks_dir).Unlock(True)
479 self.logger.LogError("Could not unlock machine: '%s'." % m.name)
489 header = stringify_fmt % ('Machine', 'Thread', 'Lock', 'Status',
506 return 'Machine Status:\n%s' % '\n'.join(table)
512 for machine in self._all_machines:
513 if machine.name in label.remote:
514 dic[machine.cpuinfo].append(label.name)
530 """Mock cros machine class."""
632 #In test, we assume "lumpy1", "lumpy2" are the same machine.
651 """Mock machine manager class."""
666 assert cm.machine_checksum, ('Could not find checksum for machine %s' %
669 # machine is unreachable, then its machine_checksum is None. Here we
675 def GetChromeVersion(self, machine): argument
679 for machine in self._all_machines:
680 if not machine.locked:
681 machine.locked = True
682 return machine
690 def ReleaseMachine(self, machine): argument
691 machine.locked = False
704 for machine in self.GetMachines(label):
705 machine.machine_checksum = common_checksum