+ flavor.id, flavor_alt_extra_specs)
+ return flavor
+
+ def boot_vm(self, name=None, **kwargs):
+ """Boot the virtual machine
+
+ It allows booting multiple machines for the child testcases. It forces
+ the same configuration for all subtestcases.
+
+ Returns: vm
+
+ Raises: expection on error
+ """
+ assert self.cloud
+ vm1 = self.cloud.create_server(
+ name if name else '{}-vm_{}'.format(self.case_name, self.guid),
+ image=self.image.id, flavor=self.flavor.id,
+ auto_ip=False, network=self.network.id,
+ timeout=self.create_server_timeout, wait=True, **kwargs)
+ self.__logger.debug("vm: %s", vm1)
+ return vm1
+
+ def check_regex_in_console(self, name, regex=' login: ', loop=1):
+ """Wait for specific message in console
+
+ Returns: True or False on errors
+ """
+ assert self.cloud
+ for iloop in range(loop):
+ console = self.cloud.get_server_console(name)
+ self.__logger.debug("console: \n%s", console)
+ if re.search(regex, console):
+ self.__logger.debug("regex found: ''%s' in console", regex)
+ return True
+ else:
+ self.__logger.debug(
+ "try %s: cannot find regex '%s' in console",
+ iloop + 1, regex)
+ time.sleep(10)
+ self.__logger.error("cannot find regex '%s' in console", regex)
+ return False