Skip to content

Instantly share code, notes, and snippets.

@zeroDivisible
Created February 4, 2016 15:51
Show Gist options
  • Save zeroDivisible/094a85d3ee88d11dd1aa to your computer and use it in GitHub Desktop.
Save zeroDivisible/094a85d3ee88d11dd1aa to your computer and use it in GitHub Desktop.
@types.set(image=types.ImageResourceType,
flavor=types.FlavorResourceType)
@validation.image_valid_on_flavor("flavor", "image")
@validation.required_services(consts.Service.NOVA)
@validation.required_openstack(users=True)
@scenario.configure(context={"cleanup": ["nova"]})
def boot_and_get_console_output(self, image, flavor,
length=None, **kwargs):
"""Get text console output from server.
This simple scenario tests the nova console-log command by retrieving
the text console log output.
:param image: image to be used to boot an instance
:param flavor: flavor to be used to boot an instance
:param length: The number of tail log lines you would like to retrieve.
None (default value) or -1 means unlimited length.
:param kwargs: Optional additional arguments for server creation
:returns: Text console log output for server
"""
server = self._boot_server(image, flavor, **kwargs)
self._get_server_console_output(server, length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment