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
260 def GetChromeVersion(self, machine): argument
265 cmd, machine=machine.name, chromeos_root=self.chromeos_root
269 "Couldn't get Chrome version from %s." % machine.name
276 def ImageMachine(self, machine, label): argument
279 if checksum and (machine.checksum == checksum):
290 f"--remote={machine.name}",
306 self.logger.LogOutput("Pushing image onto machine.")
319 cmd, machine=machine.name, chromeos_root=self.chromeos_root
323 self.logger.LogOutput("Pushing image onto machine.")
331 "Could not image machine: '%s'." % machine.name
335 machine.checksum = checksum
336 machine.image = label.chromeos_image
337 machine.label = label
340 label.chrome_version = self.GetChromeVersion(machine)
350 for machine in self.GetMachines(label):
351 # Make sure the machine's checksums are calculated.
352 if not machine.machine_checksum:
353 machine.SetUpChecksumInfo()
354 # Use the first machine as the basis for comparison.
356 base = machine
357 # Make sure this machine's checksum matches our 'common' checksum.
358 if base.machine_checksum != machine.machine_checksum:
363 mismatch_index >= len(machine.checksum_string)
365 != machine.checksum_string[mismatch_index]
372 "Machine checksums do not match!\n"
375 f"{machine.name}: {machine.checksum_string[:end_ind]}\n"
386 for machine in self.GetMachines(label):
387 if machine.checksum_string:
390 ] = machine.checksum_string
395 assert cros_machine, "Machine can't be None"
401 locked = file_lock_machine.Machine(
410 machine=cros_machine.name,
430 "Checking machine characteristics for %s" % machine_name
442 res = file_lock_machine.Machine(
447 "Could not unlock machine: '%s'." % machine_name
480 % ", ".join(machine.name for machine in machines)
488 machine
489 for machine in self.GetAvailableMachines(label)
490 if not machine.locked
502 # This logic ensures that threads waiting on a machine will get a machine
529 def ReleaseMachine(self, machine): argument
532 if machine.name == m.name:
543 res = file_lock_machine.Machine(m.name, self.locks_dir).Unlock(
549 "Could not unlock machine: '%s'." % m.name
561 "Machine",
587 return "Machine Status:\n%s" % "\n".join(table)
593 for machine in self._all_machines:
594 if machine.name in label.remote:
595 dic[machine.cpuinfo].append(label.name)
611 """Mock cros machine class."""
714 # In test, we assume "lumpy1", "lumpy2" are the same machine.
734 """Mock machine manager class."""
766 "Could not find checksum for machine %s" % machine_name
769 # machine is unreachable, then its machine_checksum is None. Here we
775 def GetChromeVersion(self, machine): argument
779 for machine in self._all_machines:
780 if not machine.locked:
781 machine.locked = True
782 return machine
785 def ImageMachine(self, machine, label): argument
786 if machine or label:
790 def ReleaseMachine(self, machine): argument
791 machine.locked = False
804 for machine in self.GetMachines(label):
805 machine.machine_checksum = common_checksum