class TmpMachine(QEMUMachineX64): name = 'qemu%d' % n cores= n def get_ncores(self): return self.cores # 60 seconds per core def get_boot_timeout(self): return self.cores * 60 # 120 seconds per core def get_test_timeout(self): return self.cores * 120 machines.add_machine(TmpMachine) @machines.add_machine class QEMUMachineX32Uniproc(QEMUMachineX32): '''Uniprocessor x86_32 QEMU''' name = 'qemu1-32' def get_ncores(self): return 1 @machines.add_machine class QEMUMachineX32Multiproc(QEMUMachineX32): '''Multiprocessor x86_32 QEMU (4 CPUs)''' name = 'qemu4-32' def get_ncores(self):
self.lockprocess = None self.masterfd = None def __rackboot(self, args): debug.checkcmd([RACKBOOT] + args + [self.get_machine_name()]) def setup(self): self.__rackboot(["-b", "-n"]) def __rackpower(self, arg): try: debug.checkcmd([RACKPOWER, arg, self.get_machine_name()]) except subprocess.CalledProcessError: debug.warning("rackpower %s %s failed" % (arg, self.get_machine_name())) def reboot(self): self.__rackpower('-r') def shutdown(self): self.__rackpower('-d') def get_output(self): return self.console_out for n in sorted(UWMachine._uw_machines.keys()): class TmpMachine(UWMachine): name = n machines.add_machine(TmpMachine)