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
-
-
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 failedAssertionError– 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 fileor 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: 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 emptyReturns: 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: 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
-
-
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
-
-
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 emptyReturns: 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: 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_URLto 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:
- Create volume
Steps:
- Change volume description with unicode symbols using CLI
- Check that volume description was changed
Teardown:
- 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:
- Create volume
Steps:
- Change volume name with unicode symbols using CLI
- Check that volume name was changed
Teardown:
- 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:
- Create volume
Steps:
- Create volume backup with unicode container name using CLI
- Check that backup status is available
Teardown:
- Delete volume backup
- 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:
- Create volume
Steps:
- Create volume backup with unicode symbols description using CLI
- Check that backup status is available
Teardown:
- Delete volume backup
- 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:
- Create volume
Steps:
- Create volume backup with unicode symbols name using CLI
- Check that backup status is available
Teardown:
- Delete volume backup
- 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:
- Create volume
Steps:
- Create volume snapshot with unicode symbols description
- using CLI
- Check that snapshot status is available
Teardown:
- Delete volume snapshot
- 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:
- Create volume
Steps:
- Create volume snapshot with unicode symbols name using CLI
- Check that snapshot status is available
Teardown:
- Delete volume snapshot
- 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:
- Create volume
Steps:
- Create volume transfer with unicode name using CLI
- Check that volume status is ‘awaiting-transfer’
Teardown:
- Delete volume transfer
- 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:
- Create image
Steps:
- Create volume from image using image name
Teardown:
- Delete volume
- 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:
- Create volume with unicode symbols description using CLI
- Check that volume status is available
Teardown:
- 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:
- Create volume with unicode symbols name using CLI
- Check that volume status is available
Teardown:
- 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:
- Create volume
Steps:
- Create volume backup with unicode container name using API
- Check CLI command
cinder backup-show <backup id>
Teardown:
- Delete volume backup
- 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:
- Create volume
Steps:
- Create volume backup with unicode description using API
- Check CLI command
cinder backup-show <backup id>
Teardown:
- Delete volume backup
- 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:
- Create volume
Steps:
- Create volume backup with unicode name using API
- Check CLI command
cinder backup-show <backup id>
Teardown:
- Delete volume backup
- 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:
- Create volume
Steps:
- Create volume snapshot with unicode description using API
- Check CLI command
cinder snapshot-show <snapshot id>
Teardown:
- Delete volume snapshot
- 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:
- Create volume
Steps:
- Create volume snapshot with unicode name using API
- Check CLI command
cinder snapshot-show <snapshot id>
Teardown:
- Delete volume snapshot
- 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:
- Create volume
Steps:
- Create volume transfer with unicode name using API
- Check CLI command
cinder transfer-show <transfer id>
Teardown:
- Delete volume transfer
- 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:
- Create cirros image
- Create flavor
- Create network, subnet, router
- Create keypair
- Create security group
Steps:
- Create two servers on host-1
- Assign floating ip for servers
- Execute ‘nova host-evacuate-live’ from host-1 to host-2
- Check that servers are hosted on host-2
- Check ping between servers
Teardown:
- Delete servers
- Delete security group
- Delete keypair
- Delete network, subnet, router
- Delete flavor
- Delete cirros image
Tests for openstack CLI client¶
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:
- Create cirros image
- Create flavor
- Create network
- Create subnet
- Create router
- Set router default gateway to public network
- Add router interface to created network
Steps:
- Create 2’nd flavor
- Read Heat resources template from file
- Create stack with template with parameters
- Start stack updating with 2’nd flavor
- Cancel stack updating with CLI
- Check stack status
Teardown:
- Delete stack
- Delete router
- Delete subnet
- Delete network
- Delete flavors
- 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:
- Call
openstack orchestration resource type show {resource_type_name} - Check that template to be shown in console
- Call
-
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:
- Create stack
Steps:
- Call
openstack stack check - Check that stack’s stack_status is CHECK_COMPLETE
Teardown:
- 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:
- Upload template to node
Steps:
- Create stack with template from file
- Check that stack is exists
Teardown:
- 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:
- Create stack from URL
- Check that stack exists
Teardown:
- 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:
- Create stack
Steps:
- Delete stack via cli command
- 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:
- Upload template to node
Steps:
- 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:
- Create stack
Steps:
- Suspend stack
- Call
openstack stack resume - Check that stack’s stack_status is RESUME_COMPLETE
Teardown:
- Delete stack
-
stepler.cli_clients.tests.test_heat.test_stack_show(empty_stack, cli_openstack_steps)[source]¶ Scenario: Show stack with openstack CLI.
Setup:
- Create stack
Steps:
- Call
openstack stack show - Check that result has correct stack_name and id
Teardown:
- 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:
- Create stack
- Call
openstack stack event show - Check that result table is not empty
Teardown:
- 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:
- Create stack
Steps:
- Call
openstack stack event list - Check that result table is not empty
Teardown:
- 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:
- Create stack
Steps:
- Call
openstack stack output show - Check that result has only particular output
Teardown:
- 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:
- Create private cirros image
- Create non-admin project
Steps:
- Run cli command ‘glance member-create <image_id> <project_id>’
- Check that project is in image member-list via API
Teardown:
- Delete project
- 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:
- Create cirros image
- Create non-admin project
Steps:
- Bind project to image via API
- Run cli command ‘glance member-delete <image_id> <project_id>’
- Check that project not in image member-list via API
Teardown:
- Delete project
- 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:
- Upload cirros image
Steps:
- Download cirros image via CLI
- Compare md5 of uploaded cirros image and downloaded cirros image
Teardown:
- 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:
- Create a zero-size image
- Run cli command ‘glance image-download <image_id>’ without/with option ‘–progress’
- Check that command is failed with error ‘Image is not active’
- (api_version=1) or ‘Image has no data’ (api_version=2)
Teardown:
- 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:
- Create 3 images with disk format qcow2 with Glance API
- Create 3 images with disk format ami with Glance API
- Check that created images filtered with disk_format using CLI
Teardown:
- 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:
- Create 3 images with disk format qcow2 with Glance API
- Check that created images filtered using CLI
Teardown:
- 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:
- Create image with name 試験画像 with Glance API
- Check that created image is in list using CLI
Teardown:
- 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:
- Create 3 images with disk format qcow2 with Glance API
- Check that created images is in list using CLI
Teardown:
- 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:
- Create image with name 試験画像 with Glance API
- Delete image via API
- 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:
- Create image
- Delete created image
- 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:
- Create cirros image
- Create non-admin project
Steps:
- Bind project to image via API
- Check cli command ‘glance member-list –image_id <id>’ shows bound
- project
Teardown:
- Delete project
- 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:
- Set show_multiple_locations=True in /etc/glance/glance-api.conf and restart glance service.
Steps:
- Create glance image
- Add 2 urls to image locations
- Check that user can’t manipulate of image status through locations removal
Teardown:
- Set show_multiple_locations=False in /etc/glance/glance-api.conf and restart glance service.
- 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:
- Create ubuntu image
Steps:
- Update image property
- Check that output cli command ‘glance image-show <id>’ contains updated property
TearDown:
- 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:
- Run cli command ‘glance image-create –file <filename>’
- 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:
- Create project
- Create user for project
- Grant member role to user
Steps:
- Create router without parameter Distributed using CLI
- Check that router parameter Distributed = True
Teardown:
- Delete router
- Delete user
- 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:
- Create project
- Create user for project
- Grant member role to user
Steps:
- Try to create router with parameter Distributed = True/False using CLI
- Check that router creation is disallowed by policy
Teardown:
- Delete user
- Delete project