Openstack CLI

CLI conftest

Contains fixtures specific for cinder.

stepler.cli_clients.conftest.remote_executor(nova_api_node, os_faults_steps, credentials)[source]

Function fixture to get remote command executor.

Parameters:
  • nova_api_node (object) – controller (node with nova-api service)
  • os_faults_steps (object) – instantiated os_faults steps
  • credentials (object) – CredentialsManager instance
Returns:

function to execute command on nova_api_node

Return type:

callable

stepler.cli_clients.conftest.cli_cinder_steps(remote_executor)[source]

Function fixture to cinder CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated cinder CLI steps
Return type:CliCinderSteps
stepler.cli_clients.conftest.cli_glance_steps(remote_executor)[source]

Function fixture to glance CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated glance CLI steps
Return type:CliGlanceSteps
stepler.cli_clients.conftest.cli_download_image(nova_api_node, os_faults_steps, cli_glance_steps)[source]

Callable function fixture to download image via CLI.

Parameters:
  • nova_api_node (obj) – controller (node with nova-api service)
  • os_faults_steps (OsFaultsSteps) – instantiated os-faults steps
  • cli_glance_steps (CliGlanceSteps) – instantiated glance CLI steps
Returns:

function to download image via CLI.

Return type:

function

stepler.cli_clients.conftest.cli_heat_steps(remote_executor)[source]

Function fixture to get heat CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:initialized heat CLI steps
Return type:object
stepler.cli_clients.conftest.empty_heat_template_path(nova_api_node, get_template_path, os_faults_steps)[source]

Upload empty heat template to nova_api_node and return its path.

Delete uploaded file on teardown.

Parameters:
  • nova_api_node (obj) – controller (node with nova-api service)
  • get_template_path (callable) – function to get local path to template
  • os_faults_steps (obj) – initialized os-faults steps
Returns:

path to template on nova_api_node

Return type:

str

stepler.cli_clients.conftest.cli_ironic_steps(remote_executor)[source]

Function fixture to Ironic CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated Ironic CLI steps
Return type:CliIronicSteps
stepler.cli_clients.conftest.cli_nova_steps(remote_executor)[source]

Function fixture to nova CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated nova CLI steps.
Return type:CliNovaSteps
stepler.cli_clients.conftest.cli_openstack_steps(remote_executor)[source]

Function fixture to openstack CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated openstack CLI steps.
Return type:CliOpenstackSteps
stepler.cli_clients.conftest.cli_neutron_steps(remote_executor)[source]

Function fixture to neutron CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated neutron CLI steps
Return type:CliNeutronSteps
stepler.cli_clients.conftest.cli_swift_steps(remote_executor)[source]

Function fixture to object storage CLI steps.

Parameters:remote_executor (callable) – function to execute command on controller nodes
Returns:instantiated object storage CLI steps.
Return type:CliSwiftSteps

CLI client steps

class stepler.cli_clients.steps.CliCinderSteps(client)[source]

CLI cinder client steps.

create_volume(size=1, name=None, description=None, image=None, check=True)[source]

Step to create volume using CLI.

Parameters:
  • size (int) – size of created volume (in GB)
  • name (str) – name of created volume
  • description (str) – volume description
  • image (str) – glance image name or ID to create volume from
  • metadata (str) – volume metadata
  • check (bool) – flag whether to check step or not
Returns:

cinder volume

Return type:

dict

create_volume_backup(volume, name=None, description=None, container=None, check=True)[source]

Step to create volume backup using CLI.

Parameters:
  • volume (object) – cinder volume
  • name (str) – name of backup to create
  • description (str) – description
  • container (str) – name of the backup service container
  • check (bool) – flag whether to check step or not
Returns:

cinder volume backup

Return type:

dict

create_volume_snapshot(volume, name=None, description=None, check=True)[source]

Step to create volume snapshot using CLI.

Parameters:
  • volume (object) – cinder volume
  • name (str) – name of snapshot to create
  • description (str) – snapshot description
  • check (bool) – flag whether to check step or not
Returns:

cinder volume snapshot

Return type:

dict

create_volume_transfer(volume, name=None, check=True)[source]

Step to create volume transfer using CLI.

Parameters:
  • volume (object) – cinder volume
  • name (str) – name of transfer to create
  • check (bool) – flag whether to check step or not
Returns:

cinder volume transfer

Return type:

dict

rename_volume(volume, name=None, description=None, check=True)[source]

Step to change volume’s name or description using CLI.

Parameters:
  • volume (object) – cinder volume to edit
  • name (str) – new volume name
  • description (str) – new volume description
  • check (bool) – flag whether to check step or not
show_volume(volume, check=True)[source]

Step to show volume using CLI.

Parameters:
  • volume (object) – cinder volume object to show
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if check failed

show_volume_backup(backup, check=True)[source]

Step to show volume backup using CLI.

Parameters:
  • backup (object) – cinder volume backup object to show
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if check failed

show_volume_snapshot(snapshot, check=True)[source]

Step to show volume snapshot using CLI.

Parameters:
  • snapshot (object) – cinder volume snapshot object to show
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if check failed

show_volume_transfer(volume_transfer, check=True)[source]

Step to show volume transfer using CLI.

Parameters:
  • volume_transfer (object) – cinder volume transfer object to show
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if check failed

class stepler.cli_clients.steps.CliGlanceSteps(client)[source]

CLI glance client steps.

check_image_list_contains(images, api_version='2')[source]

Step to check that image is in images list.

Parameters:
  • images (list) – glance images
  • api_version (int) – the API version of Glance
Raises:

AssertionError – check failed if image is present in images list

check_image_list_doesnt_contain(images, api_version='2')[source]

Step to check that image doesn’t exist in images list.

Parameters:
  • images (list) – glance images
  • api_version (int) – the API version of Glance
Raises:
  • AssertionError – check failed if image doesn’t present in
  • images list
check_image_location_isnot_removed(image)[source]

Step to check manipulating of image status via removing image location.

Parameters:image (obj) – glance image
Raises:AssertionError – if last image location was removed with exit code=0 and stderr not correct
check_image_property(image, property_key, property_value, api_version='2')[source]
Step to check that output of cli command glance image-show <id>
contains updated property.
Parameters:
  • image (obj) – glance image
  • property_key (str) – name of property for check
  • property_value (str) – value of property for check
  • api_version (int) – glance api version (1 or 2)
Raises:

AssertionError – if output of cli command glance image-show <id> doesn’t contain updated property

check_images_filtered(images, property_filter, api_version='2')[source]

Step to check that images list is filtered.

Parameters:
  • images (list) – glance images
  • property_filter (str) – image field name to filter images
  • api_version (int) – glance api version (1 or 2)
check_negative_delete_non_existing_image(image, api_version='2')[source]

Step to check that we cannot delete removed image.

Parameters:
  • image (object) – glance image
  • api_version (int) – glance api version (1 or 2)
Raises:

AssertionError – if command exit code is 0 or stderr doesn’t contain expected message

check_negative_download_zero_size_image(image, progress=False, api_version='2')[source]

Step to check that zero-size image cannot be downloaded.

Parameters:
  • image (obj) – glance image
  • progress (bool) – option of download command
  • api_version (int) – glance api version (1 or 2)
Raises:

AssertionError – if command exit code is 0 or stderr doesn’t contain expected message.

check_negative_image_create_without_properties(filename, api_version='2')[source]

Step to check image is not created from file without properties.

Parameters:
  • filename (str) – filename (doesn’t matter if it exists or not)
  • api_version (int) – glance api version (1 or 2)
Raises:

AssertionError – if command exit code is 0 or stderr doesn’t contain expected message

check_project_in_image_member_list(image, project, api_version='2')[source]

Step to check image member list.

Parameters:
  • image (obj) – glance image
  • project (obj) – keystone project
  • api_version (int) – glance api version (1 or 2)
Raises:
  • AnsibleExecutionException – if command execution failed
  • AssertionError – if project is not in image member list
create_image_member(image, project, api_version='2', check=True)[source]

Step to create member for glance image.

Parameters:
  • image (obj) – glance image
  • project (obj) – keystone project
  • api_version (int) – glance api version (1 or 2)
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

delete_image(image, api_version='2', check=True)[source]

Step to delete glance image.

Parameters:
  • image (obj) – glance image
  • api_version (int) – API version of Glance
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

delete_image_member(image, project, api_version='2', check=True)[source]

Step to delete member from glance image.

Parameters:
  • image (obj) – glance image
  • project (obj) – keystone project
  • api_version (int) – glance api version (1 or 2)
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

download_image(image, file_option=True, timeout=60, check=True)[source]

Step to download image.

Parameters:
  • image (object) – glance image
  • file_option (bool) – flag to choice option download to file or to use stdout redirecting in order to safe image to file
  • timeout (int, optional) – seconds timeout to download glance image
  • check (bool) – flag whether to check result or not
Returns:

file path of downloaded image at remote machine

Return type:

str

Raises:

AnsibleExecutionException – if image size is zero

image_create(image_file=None, image_name=None, disk_format=None, container_format=None, api_version='2', check=True)[source]

Step to create image.

Parameters:
  • image_file (str|None) – image file to be uploaded; it should be located on the same node where CLI is running
  • image_name (str|None) – name of created image
  • disk_format (str|None) – disk format of image
  • container_format (str|None) – container format of image
  • api_version (int) – API version of Glance (1 or 2)
  • check (bool) – flag whether to check result or not
Returns:

execution result (image dict, exit_code, stdout, stderr)

Return type:

tuple

Raises:

AnsibleExecutionException – if command execution failed

list_images(property_filter=None, api_version='2', check=True)[source]

Step to get glance images list.

Parameters:
  • property_filter (str) – filter Glance images list
  • api_version (int) – the API version of Glance
  • check (bool) – flag whether to check result or not
Returns:

execution result: images_list

Return type:

list

Raises:

AnsibleExecutionException – if command execution failed

remove_image_location(image, url, check=True)[source]

Step to remove image location.

Parameters:
  • image (obj) – glance image
  • url (str) – url for removing
  • check (bool) – flag whether to check result or not
Returns:

execution result (exit_code, stdout, stderr)

Return type:

tuple

Raises:

AnsibleExecutionException – if command execution failed

show_image(image, api_version='2', check=True)[source]

Step to show glance image.

Parameters:
  • image (obj) – glance image
  • api_version (int) – the API version of Glance
  • check (bool) – flag whether to check result or not
Returns:

execution result (image_show, exit_code, stdout, stderr)

Return type:

tuple

Raises:

AssertionError – if check failed

class stepler.cli_clients.steps.CliHeatSteps(client)[source]

Heat CLI steps.

cancel_stack_update(stack, check=True)[source]

Step to cancel stack update.

Parameters:
  • stack (obj) – heat stack to cancel update
  • check (bool) – flag whether to check step or not
create_stack(name, template_file=None, template_url=None, parameters=None, check=True)[source]

Step to create stack.

Parameters:
  • name (str) – name of stack
  • template_file (str, optional) – path to yaml template
  • template_url (str, optional) – template url
  • parameters (dict|None) – parameters for template
  • check (bool) – flag whether check step or not
Returns:

heat stack

Return type:

dict

Raises:

AssertionError – if command exit_code is not 0

delete_stack(stack, check=True)[source]

Step to delete stack.

Parameters:
  • stack (obj) – stack to delete
  • check (bool) – flag whether to check step or not
get_resource_type_template(resource_type, check=True)[source]

Step to check stack resources.

Parameters:
  • resource_type (obj) – heat resource type
  • check (bool) – flag whether to check step or not
Returns:

resource template

Return type:

dict

get_stack_event(stack, resource, event, check=True)[source]

Step to get stack’s events list.

Parameters:
  • stack (obj) – heat stack
  • resource (str) – name of the resource the event belongs to
  • event (str) – ID of event to display details for
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if stack event is empty

Returns:

stack event

Return type:

dict

get_stack_events_list(stack, check=True)[source]

Step to show stack’s events list.

Parameters:
  • stack (obj) – heat stack to show events list
  • check (bool) – flag whether to check step or not
Returns:

list of stack events

Return type:

list

Raises:

AssertionError – if events list is empty

preview_stack(name, template_file, parameters=None, check=True)[source]

Step to preview stack.

Parameters:
  • name (str) – name of stack preview
  • template_file (str) – path to stack template file
  • parameters (dict, optional) – additional parameters to template
  • check (bool) – flag whether to check step or not
Returns:

stack preview result

Return type:

dict

Raises:

AssertionError – if stack preview returns not ‘None’ stack’s id

resume_stack(stack, check=True)[source]

Step to resume stack.

Parameters:
  • stack (obj) – heat stack
  • check (bool) – flag whether to check step or not
show_stack(stack, check=True)[source]

Step to show stack.

Parameters:
  • stack (obj) – heat stack to show
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if output contains wrong stack’s name or id

show_stack_output(stack, output, output_result, check=True)[source]

Step to show a specific stack output.

Parameters:
  • stack (obj) – heat stack
  • output (str) – name of output to show
  • output_result (str) – expected output result
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if output contains unexpected result

stack_resources_check(stack, check=True)[source]

Step to check stack resources.

Parameters:
  • stack (obj) – heat stack
  • check (bool) – flag whether to check step or not
suspend_stack(stack, check=True)[source]

Step to suspend stack.

Parameters:
  • stack (obj) – heat stack
  • check (bool) – flag whether to check step or not
update_stack(stack, template_file, parameters=None, check=True)[source]

Step to update stack.

Parameters:
  • stack (obj) – heat stack to update
  • template_file (str) – path to stack template file
  • parameters (list, optional) – additional parameters to template
  • check (bool) – flag whether to check step or not
class stepler.cli_clients.steps.CliIronicSteps(client)[source]

CLI Ironic client steps.

ironic_chassis_list(check=True)[source]

Step to get Ironic chassis list.

Parameters:check (bool, optional) – flag whether to check result or not
Returns:
(exit_code, stdout, stderr) - result of command shell
execution
Return type:tuple
Raises:TimeoutExpired|AssertionError – if check failed after timeout
ironic_driver_list(check=True)[source]

Step to get Ironic driver list.

Parameters:check (bool, optional) – flag whether to check result or not
Returns:
(exit_code, stdout, stderr) - result of command shell
execution
Return type:tuple
Raises:TimeoutExpired|AssertionError – if check failed after timeout
ironic_node_list(check=True)[source]

Step to get Ironic node list.

Parameters:check (bool, optional) – flag whether to check result or not
Returns:
(exit_code, stdout, stderr) - result of command shell
execution
Return type:tuple
Raises:TimeoutExpired|AssertionError – if check failed after timeout
ironic_port_list(check=True)[source]

Step to get Ironic port list.

Parameters:check (bool, optional) – flag whether to check result or not
Returns:
(exit_code, stdout, stderr) - result of command shell
execution
Return type:tuple
Raises:TimeoutExpired|AssertionError – if check failed after timeout
class stepler.cli_clients.steps.CliNovaSteps(client)[source]

CLI nova client steps.

live_evacuate(source_host, target_host, servers, check=True)[source]

Step to execute host-evacuate-live.

This step is executed using CLI because there is no API for it.

Parameters:
  • source_host (str) – source host
  • target_host (str) – target host
  • servers (list) – list of server objects
  • check (bool) – flag whether to check result or not
Raises:

AssertionError – if check failed

nova_list(api_version=None, check=True)[source]

Step to get nova list.

Parameters:
  • api_version (str|None) – micro version for nova list command
  • check (bool) – flag whether to check result or not
Raises:

TimeoutExpired|AssertionError – if check failed after timeout

class stepler.cli_clients.steps.CliOpenstackSteps(client)[source]

CLI openstack client steps.

baremetal_node_list(check=True)[source]

Step to get baremetal node list.

Parameters:check (bool) – flag whether to check result or not
Raises:TimeoutExpired|AssertionError – if check failed after timeout
cancel_stack_update(stack, check=True)[source]

Step to cancel stack update.

Parameters:
  • stack (obj) – heat stack to cancel update
  • check (bool) – flag whether to check step or not
create_stack(name, template_file, parameters=None, check=True)[source]

Step to create stack.

Parameters:
  • name (str) – name of stack
  • template_file (str) – path to yaml template
  • parameters (dict|None) – parameters for template
  • check (bool) – flag whether check step or not
Returns:

heat stack

Return type:

dict

Raises:

AssertionError – if command exit_code is not 0

delete_stack(stack, check=True)[source]

Step to delete stack.

Parameters:
  • stack (obj) – stack to delete
  • check (bool) – flag whether to check step or not
get_resource_type_template(resource_type, check=True)[source]

Step to check stack resources.

Parameters:
  • resource_type (obj) – heat resource type
  • check (bool) – flag whether to check step or not
Returns:

resource template

Return type:

dict

get_stack_event(stack, resource, event, check=True)[source]

Step to get stack’s events list.

Parameters:
  • stack (obj) – heat stack
  • resource (str) – name of the resource the event belongs to
  • event (str) – ID of event to display details for
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if stack event is empty

Returns:

stack event

Return type:

dict

get_stack_events_list(stack, check=True)[source]

Step to show stack’s events list.

Parameters:
  • stack (obj) – heat stack to show events list
  • check (bool) – flag whether to check step or not
Returns:

list of stack events

Return type:

list

Raises:

AssertionError – if events list is empty

resume_stack(stack, check=True)[source]

Step to resume stack.

Parameters:
  • stack (obj) – heat stack
  • check (bool) – flag whether to check step or not
server_list(check=True)[source]

Step to get server list.

Parameters:check (bool) – flag whether to check result or not
Returns:result of command shell execution
Return type:str
Raises:TimeoutExpired|AssertionError – if check failed after timeout
show_stack(stack, check=True)[source]

Step to show stack.

Parameters:
  • stack (obj) – heat stack to show
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if output contains wrong stack’s name or id

show_stack_output(stack, output, output_result, check=True)[source]

Step to show a specific stack output.

Parameters:
  • stack (obj) – heat stack
  • output (str) – name of output to show
  • output_result (str) – expected output result
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if output contains unexpected result

stack_resources_check(stack, check=True)[source]

Step to check stack resources.

Parameters:
  • stack (obj) – heat stack
  • check (bool) – flag whether to check step or not
suspend_stack(stack, check=True)[source]

Step to suspend stack.

Parameters:
  • stack (obj) – heat stack
  • check (bool) – flag whether to check step or not
update_stack(stack, template_file, parameters=None, check=True)[source]

Step to update stack.

Parameters:
  • stack (obj) – heat stack to update
  • template_file (str) – path to stack template file
  • parameters (list, optional) – additional parameters to template
  • check (bool) – flag whether to check step or not
class stepler.cli_clients.steps.CliNeutronSteps(client)[source]

CLI neutron client steps.

check_negative_router_create_with_distributed_option(project, username, password, distributed, name=None)[source]

Step to check that router is not created with distributed option.

In case of creation of the router with explicit distributed option by user with member role this creation should be prohibited by policy.

Parameters:
  • project (str) – name of the project
  • username (str) – user name
  • password (str) – user password
  • distributed (bool) – flag whether to create DVR or not
  • name (str) – name of created router
Raises:

AssertionError – if command exit code is 0 or stderr doesn’t contain expected message

create_router(name=None, project=None, username=None, password=None, distributed=None, expected_error=False, check=True)[source]

Step to create router using CLI.

Parameters:
  • name (str) – name of created router
  • project (str) – name of the project
  • username (str) – user name
  • password (str) – user password
  • distributed (bool) – flag whether to create DVR or not
  • expected_error (bool) – flag whether to expect error during router creation or not
  • check (bool) – flag whether to check step or not
Returns:

(router or None, exit_code, stdout, stderr)

Return type:

tuple

class stepler.cli_clients.steps.CliSwiftSteps(client)[source]

CLI object storage client steps.

check_container_presence(container_name, must_present=True)[source]

Step to check that container is in container list.

Parameters:
  • container_name (str) – object storage container
  • must_present (bool) – flag whether container should present or not
Raises:
  • AssertionError – check failed if container exists/doesn’t exist in
  • containers list
check_object_in_container(container_name, object_name)[source]

Step to check if object presents into container objects list.

Parameters:
  • container_name (str) – object storage container
  • object_name (str) – name of object to upload
Raises:
  • AssertionError – check failed if object does not present in
  • container objects list
create(container_name, check=True)[source]

Step to create swift container.

Parameters:
  • container_name (str) – name of created container
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

delete(container_name, check=True)[source]

Step to delete swift container.

Parameters:
  • container_name (str) – object storage container
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

execute_command(cmd, use_openrc=True, environ=None, **kwargs)[source]

Execute swift cli command in shell.

Swift can’t determine keystone version, so we set OS_AUTH_URL to point to correct keystone endpoint.

Parameters:
  • cmd (str) – client command to execute
  • use_openrc (bool) – add ‘source openrc’ before cmd executing
  • environ (dict) – shell environment variables to set before cmd executing. By default it not set any variable
  • **kwargs – base class arguments
Returns:

(exit_code, stdout, stderr) - result of command execution

Return type:

tuple

Raises:

AssertionError – if result check was failed

list(container_name=None, check=True)[source]

Step to get swift list.

Parameters:
  • container_name (str) – object storage container
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

upload(container_name, object_name, check=True)[source]

Step to upload object to container.

Parameters:
  • container_name (str) – object storage container
  • object_name (str) – name of object to upload
  • check (bool) – flag whether to check result or not
Raises:

AnsibleExecutionException – if command execution failed

Openstack CLI tests

Tests for cinder CLI client

stepler.cli_clients.tests.test_cinder.test_change_volume_description_with_unicode(volume, cli_cinder_steps, volume_steps)[source]

Scenario: Change volume description with unicode symbols.

Setup:

  1. Create volume

Steps:

  1. Change volume description with unicode symbols using CLI
  2. Check that volume description was changed

Teardown:

  1. Delete volume
stepler.cli_clients.tests.test_cinder.test_change_volume_name_with_unicode(volume, cli_cinder_steps, volume_steps)[source]

Scenario: Change volume name with unicode symbols.

Setup:

  1. Create volume

Steps:

  1. Change volume name with unicode symbols using CLI
  2. Check that volume name was changed

Teardown:

  1. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_backup_with_unicode_container(volume, cli_cinder_steps, backup_steps)[source]

Scenario: Create volume backup with unicode container name.

Setup:

  1. Create volume

Steps:

  1. Create volume backup with unicode container name using CLI
  2. Check that backup status is available

Teardown:

  1. Delete volume backup
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_backup_with_unicode_description(volume, cli_cinder_steps, backup_steps)[source]

Scenario: Create volume backup with unicode symbols description.

Setup:

  1. Create volume

Steps:

  1. Create volume backup with unicode symbols description using CLI
  2. Check that backup status is available

Teardown:

  1. Delete volume backup
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_backup_with_unicode_name(volume, cli_cinder_steps, backup_steps)[source]

Scenario: Create volume backup with unicode symbols name.

Setup:

  1. Create volume

Steps:

  1. Create volume backup with unicode symbols name using CLI
  2. Check that backup status is available

Teardown:

  1. Delete volume backup
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_snapshot_with_unicode_description(volume, cli_cinder_steps, snapshot_steps)[source]

Scenario: Create snapshot with unicode symbols description.

Setup:

  1. Create volume

Steps:

  1. Create volume snapshot with unicode symbols description
    using CLI
  2. Check that snapshot status is available

Teardown:

  1. Delete volume snapshot
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_snapshot_with_unicode_name(volume, cli_cinder_steps, snapshot_steps)[source]

Scenario: Create snapshot with unicode symbols name.

Setup:

  1. Create volume

Steps:

  1. Create volume snapshot with unicode symbols name using CLI
  2. Check that snapshot status is available

Teardown:

  1. Delete volume snapshot
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_transfer_with_unicode_name(volume, transfer_steps, cli_cinder_steps, volume_steps)[source]

Scenario: Create volume transfer with unicode name.

Note: transfer_steps fixture is used for transfer cleanup.

Setup:

  1. Create volume

Steps:

  1. Create volume transfer with unicode name using CLI
  2. Check that volume status is ‘awaiting-transfer’

Teardown:

  1. Delete volume transfer
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_volume_using_image_name(ubuntu_image, cli_cinder_steps, volume_steps)[source]

Scenario: Create volume from image using image name.

Setup:

  1. Create image

Steps:

  1. Create volume from image using image name

Teardown:

  1. Delete volume
  2. Delete image
stepler.cli_clients.tests.test_cinder.test_create_volume_with_unicode_description(cli_cinder_steps, volume_steps)[source]

Scenario: Create volume with unicode symbols description.

Steps:

  1. Create volume with unicode symbols description using CLI
  2. Check that volume status is available

Teardown:

  1. Delete volume
stepler.cli_clients.tests.test_cinder.test_create_volume_with_unicode_name(cli_cinder_steps, volume_steps)[source]

Scenario: Create volume with unicode symbols name.

Steps:

  1. Create volume with unicode symbols name using CLI
  2. Check that volume status is available

Teardown:

  1. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_backup_with_unicode_container_name(volume, create_backup, cli_cinder_steps)[source]

Scenario: Show volume backup with unicode container name.

Setup:

  1. Create volume

Steps:

  1. Create volume backup with unicode container name using API
  2. Check CLI command cinder backup-show <backup id>

Teardown:

  1. Delete volume backup
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_backup_with_unicode_description(volume, create_backup, cli_cinder_steps)[source]

Scenario: Show volume backup with unicode description.

Setup:

  1. Create volume

Steps:

  1. Create volume backup with unicode description using API
  2. Check CLI command cinder backup-show <backup id>

Teardown:

  1. Delete volume backup
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_backup_with_unicode_name(volume, create_backup, cli_cinder_steps)[source]

Scenario: Show volume backup with unicode name.

Setup:

  1. Create volume

Steps:

  1. Create volume backup with unicode name using API
  2. Check CLI command cinder backup-show <backup id>

Teardown:

  1. Delete volume backup
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_snapshot_with_unicode_description(volume, snapshot_steps, cli_cinder_steps)[source]

Scenario: Show volume snapshot with unicode description.

Setup:

  1. Create volume

Steps:

  1. Create volume snapshot with unicode description using API
  2. Check CLI command cinder snapshot-show <snapshot id>

Teardown:

  1. Delete volume snapshot
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_snapshot_with_unicode_name(volume, snapshot_steps, cli_cinder_steps)[source]

Scenario: Show volume snapshot with unicode name.

Setup:

  1. Create volume

Steps:

  1. Create volume snapshot with unicode name using API
  2. Check CLI command cinder snapshot-show <snapshot id>

Teardown:

  1. Delete volume snapshot
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_transfer_with_unicode_name(volume, create_volume_transfer, cli_cinder_steps)[source]

Scenario: Show volume transfer with unicode name.

Setup:

  1. Create volume

Steps:

  1. Create volume transfer with unicode name using API
  2. Check CLI command cinder transfer-show <transfer id>

Teardown:

  1. Delete volume transfer
  2. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_volume_with_unicode_description(volume_steps, cli_cinder_steps)[source]

Scenario: Show volume with unicode description.

Steps:

  1. Create volume with unicode description using API
  2. Check CLI command cinder show <volume id>

Teardown:

  1. Delete volume
stepler.cli_clients.tests.test_cinder.test_show_volume_with_unicode_name(volume_steps, cli_cinder_steps)[source]

Scenario: Show volume with unicode name.

Steps:

  1. Create volume with unicode name using API
  2. Check CLI command cinder show <volume id>

Teardown:

  1. Delete volume

Tests for nova CLI client

stepler.cli_clients.tests.test_nova.test_live_evacuation(cirros_image, flavor, net_subnet_router, keypair, security_group, create_floating_ip, nova_availability_zone_hosts, cli_nova_steps, server_steps)[source]

Scenario: Live evacuate all servers from one host to another.

Setup:

  1. Create cirros image
  2. Create flavor
  3. Create network, subnet, router
  4. Create keypair
  5. Create security group

Steps:

  1. Create two servers on host-1
  2. Assign floating ip for servers
  3. Execute ‘nova host-evacuate-live’ from host-1 to host-2
  4. Check that servers are hosted on host-2
  5. Check ping between servers

Teardown:

  1. Delete servers
  2. Delete security group
  3. Delete keypair
  4. Delete network, subnet, router
  5. Delete flavor
  6. Delete cirros image
stepler.cli_clients.tests.test_nova.test_nova_list(server, cli_nova_steps, api_version)[source]

Scenario: nova list works via shell.

Setup::

  1. Create server

Steps::

  1. Execute in shell nova list or
    nova --os-compute-api-version <api_version> list

Teardown:

  1. Delete server

Tests for openstack CLI client

stepler.cli_clients.tests.test_openstack.test_baremetal_node_list(cli_openstack_steps)[source]

Scenario: openstack baremetal list works via shell.

Steps::

  1. Execute in shell openstack baremetal list
stepler.cli_clients.tests.test_openstack.test_server_list(server, cli_openstack_steps)[source]

Scenario: nova list works via shell.

Setup::

  1. Create nova server and wait it active

Steps::

  1. Execute in shell openstack server list

Teardown:

  1. Remove nova server

Heat CLI tests

stepler.cli_clients.tests.test_heat.test_cancel_stack_update(cirros_image, flavor, net_subnet_router, create_flavor, read_heat_template, create_stack, cli_openstack_steps, stack_steps)[source]

Scenario: Cancel stack updating with heat CLI.

Note

This test verifies bug #1570825

Setup:

  1. Create cirros image
  2. Create flavor
  3. Create network
  4. Create subnet
  5. Create router
  6. Set router default gateway to public network
  7. Add router interface to created network

Steps:

  1. Create 2’nd flavor
  2. Read Heat resources template from file
  3. Create stack with template with parameters
  4. Start stack updating with 2’nd flavor
  5. Cancel stack updating with CLI
  6. Check stack status

Teardown:

  1. Delete stack
  2. Delete router
  3. Delete subnet
  4. Delete network
  5. Delete flavors
  6. Delete cirros image
stepler.cli_clients.tests.test_heat.test_resource_type_template(cli_openstack_steps, heat_resource_type_steps)[source]

Scenario: Show resource type template with openstack CLI.

Steps:

  1. Call openstack orchestration resource type show {resource_type_name}
  2. Check that template to be shown in console
stepler.cli_clients.tests.test_heat.test_stack_check_resources(empty_stack, cli_openstack_steps, stack_steps)[source]

Scenario: Check stack resources with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Call openstack stack check
  2. Check that stack’s stack_status is CHECK_COMPLETE

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_create_from_file(empty_heat_template_path, cli_openstack_steps, stack_steps)[source]

Scenario: Create stack from template file with CLI.

Setup:

  1. Upload template to node

Steps:

  1. Create stack with template from file
  2. Check that stack is exists

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_create_from_url(cli_heat_steps, stack_steps)[source]

Scenario: Create stack from template url with CLI.

Steps:

  1. Create stack from URL
  2. Check that stack exists

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_delete(empty_stack, cli_openstack_steps, stack_steps)[source]

Scenario: Delete stack with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Delete stack via cli command
  2. Check that stack is not exist
stepler.cli_clients.tests.test_heat.test_stack_preview(empty_heat_template_path, cli_heat_steps)[source]

Scenario: Preview stack with heat CLI.

Setup:

  1. Upload template to node

Steps:

  1. Preview stack
stepler.cli_clients.tests.test_heat.test_stack_resume(empty_stack, cli_openstack_steps, stack_steps)[source]

Scenario: Resume stack with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Suspend stack
  2. Call openstack stack resume
  3. Check that stack’s stack_status is RESUME_COMPLETE

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_show(empty_stack, cli_openstack_steps)[source]

Scenario: Show stack with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Call openstack stack show
  2. Check that result has correct stack_name and id

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_show_event(create_stack, read_heat_template, cli_openstack_steps, stack_steps)[source]

Scenario: Show stack’s event details with openstack CLI.

Steps:

  1. Create stack
  2. Call openstack stack event show
  3. Check that result table is not empty

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_show_events_list(empty_stack, cli_openstack_steps)[source]

Scenario: Show stack events_list with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Call openstack stack event list
  2. Check that result table is not empty

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_show_particular_output(read_heat_template, cli_openstack_steps, stack_steps)[source]

Scenario: Show only particular stack output with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Call openstack stack output show
  2. Check that result has only particular output

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_suspend(empty_stack, cli_openstack_steps, stack_steps)[source]

Scenario: Suspend stack with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Call openstack stack suspend
  2. Check that stack’s stack_status is SUSPEND_COMPLETE

Teardown:

  1. Delete stack
stepler.cli_clients.tests.test_heat.test_stack_update(empty_heat_template_path, empty_stack, cli_openstack_steps, stack_steps)[source]

Scenario: Update stack with openstack CLI.

Setup:

  1. Create stack

Steps:

  1. Update stack with CLI
  2. Check that stack status is update_complete

Teardown:

  1. Delete stack

Tests for glance CLI client

stepler.cli_clients.tests.test_glance.test_create_image_member(cirros_image_private, project, cli_glance_steps, glance_steps, api_version)[source]

Scenario: Verify ‘glance member-create’ command.

Setup:

  1. Create private cirros image
  2. Create non-admin project

Steps:

  1. Run cli command ‘glance member-create <image_id> <project_id>’
  2. Check that project is in image member-list via API

Teardown:

  1. Delete project
  2. Delete cirros image
stepler.cli_clients.tests.test_glance.test_delete_image_member(cirros_image_private, project, cli_glance_steps, glance_steps, api_version)[source]

Scenario: Verify ‘glance member-delete’ command.

Setup:

  1. Create cirros image
  2. Create non-admin project

Steps:

  1. Bind project to image via API
  2. Run cli command ‘glance member-delete <image_id> <project_id>’
  3. Check that project not in image member-list via API

Teardown:

  1. Delete project
  2. Delete cirros image
stepler.cli_clients.tests.test_glance.test_download_glance_image(cirros_image, cli_download_image, glance_steps, file_option)[source]

Scenario: Download glance image via CLI.

Setup:

  1. Upload cirros image

Steps:

  1. Download cirros image via CLI
  2. Compare md5 of uploaded cirros image and downloaded cirros image

Teardown:

  1. Delete cirros image
stepler.cli_clients.tests.test_glance.test_download_zero_size_image(glance_steps, cli_glance_steps, api_version, progress)[source]

Scenario: Verify that zero-size image can’t be downloaded.

Steps:

  1. Create a zero-size image
  2. Run cli command ‘glance image-download <image_id>’ without/with option ‘–progress’
  3. Check that command is failed with error ‘Image is not active’
    (api_version=1) or ‘Image has no data’ (api_version=2)

Teardown:

  1. Delete image
stepler.cli_clients.tests.test_glance.test_filter_disk_formats_in_images_list(glance_steps, cli_glance_steps, api_version=2)[source]

Scenario: Check that created images are filtered.

Steps:

  1. Create 3 images with disk format qcow2 with Glance API
  2. Create 3 images with disk format ami with Glance API
  3. Check that created images filtered with disk_format using CLI

Teardown:

  1. Delete images
stepler.cli_clients.tests.test_glance.test_filter_names_in_images_list(glance_steps, cli_glance_steps, api_version=2)[source]

Scenario: Check that created images are filtered.

Steps:

  1. Create 3 images with disk format qcow2 with Glance API
  2. Check that created images filtered using CLI

Teardown:

  1. Delete images
stepler.cli_clients.tests.test_glance.test_image_list_contains_created_image(glance_steps, cli_glance_steps, api_version)[source]

Scenario: Check support of unicode symbols in image name.

Steps:

  1. Create image with name 試験画像 with Glance API
  2. Check that created image is in list using CLI

Teardown:

  1. Delete image
stepler.cli_clients.tests.test_glance.test_image_list_contains_created_qcow2_images(glance_steps, cli_glance_steps, api_version)[source]

Scenario: Check that created images are contained in images list.

Steps:

  1. Create 3 images with disk format qcow2 with Glance API
  2. Check that created images is in list using CLI

Teardown:

  1. Delete images
stepler.cli_clients.tests.test_glance.test_image_list_doesnt_contain_deleted_image(glance_steps, cli_glance_steps, api_version)[source]

Scenario: Check support of unicode symbols in image name.

Steps:

  1. Create image with name 試験画像 with Glance API
  2. Delete image via API
  3. Check that image deleted using CLI command
stepler.cli_clients.tests.test_glance.test_negative_remove_deleted_image(glance_steps, cli_glance_steps, api_version)[source]

Scenario: Try to remove already deleted image.

Steps:

  1. Create image
  2. Delete created image
  3. Try to remove deleted image
stepler.cli_clients.tests.test_glance.test_project_in_image_member_list(cirros_image_private, project, cli_glance_steps, glance_steps, api_version)[source]

Scenario: Verify ‘glance member-list’ command.

Test checks that ‘glance member-list –image_id <id>’ shows bound project.

Setup:

  1. Create cirros image
  2. Create non-admin project

Steps:

  1. Bind project to image via API
  2. Check cli command ‘glance member-list –image_id <id>’ shows bound
    project

Teardown:

  1. Delete project
  2. Delete cirros image
stepler.cli_clients.tests.test_glance.test_status_manipulation_via_locations(enable_multi_locations, glance_steps, cli_glance_steps)[source]

Scenario: Glance image status manipulation through locations removal.

Setup:

  1. Set show_multiple_locations=True in /etc/glance/glance-api.conf and restart glance service.

Steps:

  1. Create glance image
  2. Add 2 urls to image locations
  3. Check that user can’t manipulate of image status through locations removal

Teardown:

  1. Set show_multiple_locations=False in /etc/glance/glance-api.conf and restart glance service.
  2. Delete glance image
stepler.cli_clients.tests.test_glance.test_update_image_property(ubuntu_image, glance_steps, cli_glance_steps, api_version)[source]

Scenario: Update image property.

SetUp:

  1. Create ubuntu image

Steps:

  1. Update image property
  2. Check that output cli command ‘glance image-show <id>’ contains updated property

TearDown:

  1. Delete ubuntu image
stepler.cli_clients.tests.test_glance.test_upload_image_without_properties(cli_glance_steps, api_version)[source]

Scenario: Verify image is not created from file without properties.

Test checks image from file can’t be created without disk-format and container-format

Steps:

  1. Run cli command ‘glance image-create –file <filename>’
  2. Check that command failed with expected error message

Neutron CLI tests

stepler.cli_clients.tests.test_neutron.test_create_distributed_router_with_member_user(cli_neutron_steps, new_user_with_project, router_steps, routers_cleanup)[source]

Scenario: Check DVR creation without distributed option.

Setup:

  1. Create project
  2. Create user for project
  3. Grant member role to user

Steps:

  1. Create router without parameter Distributed using CLI
  2. Check that router parameter Distributed = True

Teardown:

  1. Delete router
  2. Delete user
  3. Delete project
stepler.cli_clients.tests.test_neutron.test_negative_create_distributed_router_with_member_user(cli_neutron_steps, new_user_with_project, router_steps, routers_cleanup, distributed)[source]

Scenario: Check DVR creation with distributed option.

Setup:

  1. Create project
  2. Create user for project
  3. Grant member role to user

Steps:

  1. Try to create router with parameter Distributed = True/False using CLI
  2. Check that router creation is disallowed by policy

Teardown:

  1. Delete user
  2. Delete project