Lines Matching full:machine
6 """Machine Manager module."""
37 """Raised when cannot find/access the machine locks directory."""
45 """The machine class."""
84 command, machine=self.name, chromeos_root=self.chromeos_root
128 # TODO yunlian: when the machine in rebooting, it will not return
132 command, machine=self.name, chromeos_root=self.chromeos_root
134 assert ret == 0, "Could not get meminfo from machine: %s" % self.name
141 command, machine=self.name, chromeos_root=self.chromeos_root
143 assert ret == 0, "Could not get cpuinfo from machine: %s" % self.name
151 # and may differ on the same type of machine.
172 command, machine=self.name, chromeos_root=self.chromeos_root
181 command, machine=self.name, chromeos_root=self.chromeos_root
192 assert 0, "Could not get machine_id from machine: %s" % self.name
212 runs within the same experiment from trying to use the same machine at the
258 def GetChromeVersion(self, machine): argument
263 cmd, machine=machine.name, chromeos_root=self.chromeos_root
267 "Couldn't get Chrome version from %s." % machine.name
274 def ImageMachine(self, machine, label): argument
277 if checksum and (machine.checksum == checksum):
288 "--remote=%s" % machine.name,
302 self.logger.LogOutput("Pushing image onto machine.")
315 cmd, machine=machine.name, chromeos_root=self.chromeos_root
319 self.logger.LogOutput("Pushing image onto machine.")
327 "Could not image machine: '%s'." % machine.name
331 machine.checksum = checksum
332 machine.image = label.chromeos_image
333 machine.label = label
336 label.chrome_version = self.GetChromeVersion(machine)
346 for machine in self.GetMachines(label):
347 # Make sure the machine's checksums are calculated.
348 if not machine.machine_checksum:
349 machine.SetUpChecksumInfo()
350 # Use the first machine as the basis for comparison.
352 base = machine
353 # Make sure this machine's checksum matches our 'common' checksum.
354 if base.machine_checksum != machine.machine_checksum:
359 mismatch_index >= len(machine.checksum_string)
361 != machine.checksum_string[mismatch_index]
368 "Machine checksums do not match!\n"
371 f"{machine.name}: {machine.checksum_string[:end_ind]}\n"
382 for machine in self.GetMachines(label):
383 if machine.checksum_string:
386 ] = machine.checksum_string
391 assert cros_machine, "Machine can't be None"
397 locked = file_lock_machine.Machine(
406 machine=cros_machine.name,
426 "Checking machine characteristics for %s" % machine_name
438 res = file_lock_machine.Machine(
443 "Could not unlock machine: '%s'." % machine_name
476 % ", ".join(machine.name for machine in machines)
484 machine
485 for machine in self.GetAvailableMachines(label)
486 if not machine.locked
498 # This logic ensures that threads waiting on a machine will get a machine
525 def ReleaseMachine(self, machine): argument
528 if machine.name == m.name:
539 res = file_lock_machine.Machine(m.name, self.locks_dir).Unlock(
545 "Could not unlock machine: '%s'." % m.name
557 "Machine",
583 return "Machine Status:\n%s" % "\n".join(table)
589 for machine in self._all_machines:
590 if machine.name in label.remote:
591 dic[machine.cpuinfo].append(label.name)
607 """Mock cros machine class."""
710 # In test, we assume "lumpy1", "lumpy2" are the same machine.
730 """Mock machine manager class."""
751 "Could not find checksum for machine %s" % machine_name
754 # machine is unreachable, then its machine_checksum is None. Here we
760 def GetChromeVersion(self, machine): argument
764 for machine in self._all_machines:
765 if not machine.locked:
766 machine.locked = True
767 return machine
770 def ImageMachine(self, machine, label): argument
771 if machine or label:
775 def ReleaseMachine(self, machine): argument
776 machine.locked = False
789 for machine in self.GetMachines(label):
790 machine.machine_checksum = common_checksum