• Home
  • Raw
  • Download

Lines Matching full:machine

6 """Machine Manager module."""
38 """Raised when cannot find/access the machine locks directory."""
46 """The machine class."""
84 command, machine=self.name, chromeos_root=self.chromeos_root)
127 # TODO yunlian: when the machine in rebooting, it will not return
131 command, machine=self.name, chromeos_root=self.chromeos_root)
132 assert ret == 0, 'Could not get meminfo from machine: %s' % self.name
139 command, machine=self.name, chromeos_root=self.chromeos_root)
140 assert ret == 0, 'Could not get cpuinfo from machine: %s' % self.name
148 # and may differ on the same type of machine.
163 command, machine=self.name, chromeos_root=self.chromeos_root)
171 command, machine=self.name, chromeos_root=self.chromeos_root)
181 assert 0, 'Could not get machine_id from machine: %s' % self.name
201 runs within the same experiment from trying to use the same machine at the
243 def GetChromeVersion(self, machine): argument
248 cmd, machine=machine.name, chromeos_root=self.chromeos_root)
251 machine.name)
257 def ImageMachine(self, machine, label): argument
260 if checksum and (machine.checksum == checksum):
270 '--remote=%s' % machine.name,
284 self.logger.LogOutput('Pushing image onto machine.')
295 cmd, machine=machine.name, chromeos_root=self.chromeos_root)
298 self.logger.LogOutput('Pushing image onto machine.')
303 raise RuntimeError("Could not image machine: '%s'." % machine.name)
306 machine.checksum = checksum
307 machine.image = label.chromeos_image
308 machine.label = label
311 label.chrome_version = self.GetChromeVersion(machine)
321 for machine in self.GetMachines(label):
322 # Make sure the machine's checksums are calculated.
323 if not machine.machine_checksum:
324 machine.SetUpChecksumInfo()
325 # Use the first machine as the basis for comparison.
327 base = machine
328 # Make sure this machine's checksum matches our 'common' checksum.
329 if base.machine_checksum != machine.machine_checksum:
333 if (mismatch_index >= len(machine.checksum_string) or
335 machine.checksum_string[mismatch_index]):
341 'Machine checksums do not match!\n'
344 f'{machine.name}: {machine.checksum_string[:end_ind]}\n'
354 for machine in self.GetMachines(label):
355 if machine.checksum_string:
356 self.machine_checksum_string[label.name] = machine.checksum_string
361 assert cros_machine, "Machine can't be None"
367 locked = file_lock_machine.Machine(cros_machine.name,
376 machine=cros_machine.name)
390 self.logger.LogOutput('Checking machine characteristics for %s' %
400 res = file_lock_machine.Machine(machine_name,
403 self.logger.LogError("Could not unlock machine: '%s'." % machine_name)
432 ', '.join(machine.name for machine in machines))
440 machine for machine in self.GetAvailableMachines(label)
441 if not machine.locked
453 # This logic ensures that threads waiting on a machine will get a machine
480 def ReleaseMachine(self, machine): argument
483 if machine.name == m.name:
494 res = file_lock_machine.Machine(m.name, self.locks_dir).Unlock(True)
497 self.logger.LogError("Could not unlock machine: '%s'." % m.name)
507 header = stringify_fmt % ('Machine', 'Thread', 'Lock', 'Status',
524 return 'Machine Status:\n%s' % '\n'.join(table)
530 for machine in self._all_machines:
531 if machine.name in label.remote:
532 dic[machine.cpuinfo].append(label.name)
548 """Mock cros machine class."""
650 # In test, we assume "lumpy1", "lumpy2" are the same machine.
670 """Mock machine manager class."""
685 assert cm.machine_checksum, ('Could not find checksum for machine %s' %
688 # machine is unreachable, then its machine_checksum is None. Here we
694 def GetChromeVersion(self, machine): argument
698 for machine in self._all_machines:
699 if not machine.locked:
700 machine.locked = True
701 return machine
704 def ImageMachine(self, machine, label): argument
705 if machine or label:
709 def ReleaseMachine(self, machine): argument
710 machine.locked = False
723 for machine in self.GetMachines(label):
724 machine.machine_checksum = common_checksum