python-openstackclient 7.4.0__py3-none-any.whl → 8.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/common/availability_zone.py +3 -6
- openstackclient/common/clientmanager.py +2 -1
- openstackclient/common/envvars.py +57 -0
- openstackclient/common/extension.py +3 -11
- openstackclient/common/limits.py +1 -1
- openstackclient/common/project_cleanup.py +3 -2
- openstackclient/common/quota.py +54 -28
- openstackclient/compute/client.py +7 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +10 -4
- openstackclient/compute/v2/console_connection.py +48 -0
- openstackclient/compute/v2/flavor.py +14 -18
- openstackclient/compute/v2/host.py +3 -3
- openstackclient/compute/v2/hypervisor.py +10 -4
- openstackclient/compute/v2/hypervisor_stats.py +1 -1
- openstackclient/compute/v2/keypair.py +18 -13
- openstackclient/compute/v2/server.py +144 -121
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +8 -17
- openstackclient/compute/v2/server_group.py +6 -6
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +6 -6
- openstackclient/compute/v2/server_volume.py +4 -4
- openstackclient/compute/v2/service.py +9 -13
- openstackclient/compute/v2/usage.py +4 -6
- openstackclient/identity/client.py +2 -4
- openstackclient/identity/common.py +95 -17
- openstackclient/identity/v2_0/ec2creds.py +4 -3
- openstackclient/identity/v2_0/endpoint.py +12 -10
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +1 -1
- openstackclient/identity/v2_0/service.py +7 -7
- openstackclient/identity/v2_0/user.py +6 -21
- openstackclient/identity/v3/access_rule.py +2 -5
- openstackclient/identity/v3/application_credential.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +6 -7
- openstackclient/identity/v3/domain.py +63 -44
- openstackclient/identity/v3/ec2creds.py +4 -3
- openstackclient/identity/v3/endpoint.py +104 -88
- openstackclient/identity/v3/endpoint_group.py +1 -1
- openstackclient/identity/v3/group.py +116 -72
- openstackclient/identity/v3/identity_provider.py +1 -2
- openstackclient/identity/v3/limit.py +4 -9
- openstackclient/identity/v3/mapping.py +4 -3
- openstackclient/identity/v3/policy.py +5 -8
- openstackclient/identity/v3/project.py +23 -6
- openstackclient/identity/v3/region.py +2 -5
- openstackclient/identity/v3/registered_limit.py +4 -8
- openstackclient/identity/v3/role.py +15 -16
- openstackclient/identity/v3/service.py +8 -8
- openstackclient/identity/v3/service_provider.py +3 -6
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +1 -2
- openstackclient/identity/v3/trust.py +74 -25
- openstackclient/identity/v3/user.py +47 -11
- openstackclient/image/client.py +7 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +41 -48
- openstackclient/image/v2/metadef_namespaces.py +4 -3
- openstackclient/image/v2/metadef_resource_type_association.py +1 -2
- openstackclient/image/v2/metadef_resource_types.py +1 -2
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +9 -1370
- openstackclient/network/client.py +4 -16
- openstackclient/network/common.py +16 -12
- openstackclient/network/utils.py +3 -3
- openstackclient/network/v2/address_group.py +5 -9
- openstackclient/network/v2/address_scope.py +2 -3
- openstackclient/network/v2/default_security_group_rule.py +1 -2
- openstackclient/network/v2/floating_ip.py +69 -47
- openstackclient/network/v2/floating_ip_port_forwarding.py +7 -7
- openstackclient/network/v2/ip_availability.py +1 -2
- openstackclient/network/v2/l3_conntrack_helper.py +8 -12
- openstackclient/network/v2/local_ip.py +24 -26
- openstackclient/network/v2/local_ip_association.py +4 -5
- openstackclient/network/v2/ndp_proxy.py +9 -10
- openstackclient/network/v2/network.py +12 -16
- openstackclient/network/v2/network_agent.py +29 -37
- openstackclient/network/v2/network_auto_allocated_topology.py +4 -5
- openstackclient/network/v2/network_flavor.py +1 -1
- openstackclient/network/v2/network_flavor_profile.py +5 -5
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +5 -8
- openstackclient/network/v2/network_qos_policy.py +4 -4
- openstackclient/network/v2/network_qos_rule.py +7 -16
- openstackclient/network/v2/network_rbac.py +4 -4
- openstackclient/network/v2/network_segment.py +6 -7
- openstackclient/network/v2/network_segment_range.py +16 -20
- openstackclient/network/v2/network_trunk.py +24 -16
- openstackclient/network/v2/port.py +28 -29
- openstackclient/network/v2/router.py +53 -42
- openstackclient/network/v2/security_group.py +13 -19
- openstackclient/network/v2/security_group_rule.py +10 -11
- openstackclient/network/v2/subnet.py +31 -30
- openstackclient/network/v2/subnet_pool.py +4 -4
- openstackclient/object/client.py +2 -3
- openstackclient/object/v1/container.py +2 -3
- openstackclient/object/v1/object.py +2 -9
- openstackclient/shell.py +22 -5
- openstackclient/tests/functional/base.py +7 -3
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- openstackclient/tests/functional/compute/v2/test_server.py +2 -3
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/test_user.py +1 -1
- openstackclient/tests/functional/identity/v3/common.py +3 -8
- openstackclient/tests/functional/identity/v3/test_application_credential.py +10 -10
- openstackclient/tests/functional/identity/v3/test_endpoint.py +3 -3
- openstackclient/tests/functional/identity/v3/test_group.py +3 -3
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -7
- openstackclient/tests/functional/identity/v3/test_limit.py +4 -4
- openstackclient/tests/functional/identity/v3/test_project.py +5 -14
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +3 -3
- openstackclient/tests/functional/identity/v3/test_role.py +1 -1
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +13 -31
- openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -7
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/network/v2/common.py +7 -3
- openstackclient/tests/functional/network/v2/test_address_group.py +4 -0
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +15 -11
- openstackclient/tests/functional/network/v2/test_local_ip.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +2 -3
- openstackclient/tests/functional/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/functional/network/v2/test_port.py +17 -7
- openstackclient/tests/functional/network/v2/test_router.py +42 -0
- openstackclient/tests/functional/network/v2/test_subnet_pool.py +4 -0
- openstackclient/tests/unit/api/test_compute_v2.py +67 -87
- openstackclient/tests/unit/common/test_availability_zone.py +6 -14
- openstackclient/tests/unit/common/test_command.py +1 -1
- openstackclient/tests/unit/common/test_extension.py +5 -7
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_project_cleanup.py +5 -6
- openstackclient/tests/unit/common/test_quota.py +51 -28
- openstackclient/tests/unit/compute/v2/fakes.py +85 -315
- openstackclient/tests/unit/compute/v2/test_agent.py +16 -16
- openstackclient/tests/unit/compute/v2/test_aggregate.py +56 -60
- openstackclient/tests/unit/compute/v2/test_console.py +34 -17
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +72 -72
- openstackclient/tests/unit/compute/v2/test_host.py +8 -8
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +22 -30
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +36 -29
- openstackclient/tests/unit/compute/v2/test_server.py +693 -606
- openstackclient/tests/unit/compute/v2/test_server_backup.py +36 -77
- openstackclient/tests/unit/compute/v2/test_server_event.py +18 -20
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +37 -78
- openstackclient/tests/unit/compute/v2/test_server_migration.py +41 -41
- openstackclient/tests/unit/compute/v2/test_server_volume.py +12 -12
- openstackclient/tests/unit/compute/v2/test_service.py +39 -45
- openstackclient/tests/unit/compute/v2/test_usage.py +5 -5
- openstackclient/tests/unit/identity/v2_0/fakes.py +1 -1
- openstackclient/tests/unit/identity/v3/test_access_rule.py +1 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +48 -26
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +102 -6
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +84 -46
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +62 -54
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
- openstackclient/tests/unit/network/v2/test_network.py +4 -4
- openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
- openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
- openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +21 -22
- openstackclient/tests/unit/network/v2/test_router.py +130 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +15 -17
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- openstackclient/tests/unit/volume/v2/fakes.py +1 -2
- openstackclient/tests/unit/volume/v2/test_service.py +57 -91
- openstackclient/tests/unit/volume/v2/test_volume.py +109 -106
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
- openstackclient/tests/unit/volume/v3/fakes.py +2 -8
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
- openstackclient/tests/unit/volume/v3/test_service.py +221 -141
- openstackclient/tests/unit/volume/v3/test_volume.py +131 -120
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +4 -4
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +683 -49
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
- openstackclient/volume/client.py +1 -3
- openstackclient/volume/v2/consistency_group.py +4 -8
- openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
- openstackclient/volume/v2/qos_specs.py +1 -2
- openstackclient/volume/v2/service.py +41 -38
- openstackclient/volume/v2/volume.py +71 -53
- openstackclient/volume/v2/volume_backup.py +15 -10
- openstackclient/volume/v2/volume_snapshot.py +129 -93
- openstackclient/volume/v2/volume_transfer_request.py +0 -3
- openstackclient/volume/v2/volume_type.py +10 -21
- openstackclient/volume/v3/block_storage_cluster.py +3 -3
- openstackclient/volume/v3/block_storage_log_level.py +22 -28
- openstackclient/volume/v3/block_storage_manage.py +1 -3
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +218 -58
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +31 -27
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +489 -13
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +11 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +238 -259
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -47
- python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
- openstackclient/tests/functional/volume/v1/__init__.py +0 -0
- openstackclient/tests/functional/volume/v1/common.py +0 -35
- openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
- openstackclient/tests/functional/volume/v1/test_service.py +0 -76
- openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
- openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
- openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
- openstackclient/tests/unit/volume/v1/__init__.py +0 -0
- openstackclient/tests/unit/volume/v1/fakes.py +0 -615
- openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
- openstackclient/tests/unit/volume/v1/test_service.py +0 -295
- openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
- openstackclient/tests/unit/volume/v1/test_type.py +0 -633
- openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
- openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
- openstackclient/volume/v1/__init__.py +0 -0
- openstackclient/volume/v1/qos_specs.py +0 -377
- openstackclient/volume/v1/service.py +0 -136
- openstackclient/volume/v1/volume.py +0 -734
- openstackclient/volume/v1/volume_backup.py +0 -302
- openstackclient/volume/v1/volume_snapshot.py +0 -433
- openstackclient/volume/v1/volume_transfer_request.py +0 -200
- openstackclient/volume/v1/volume_type.py +0 -520
- python_openstackclient-7.4.0.dist-info/METADATA +0 -172
- python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
2
|
-
# not use this file except in compliance with the License. You may obtain
|
|
3
|
-
# a copy of the License at
|
|
4
|
-
#
|
|
5
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
#
|
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
|
-
# License for the specific language governing permissions and limitations
|
|
11
|
-
# under the License.
|
|
12
|
-
|
|
13
|
-
import uuid
|
|
14
|
-
|
|
15
|
-
from openstackclient.tests.functional.volume.v1 import common
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class VolumeTests(common.BaseVolumeTests):
|
|
19
|
-
"""Functional tests for volume."""
|
|
20
|
-
|
|
21
|
-
def test_volume_create_and_delete(self):
|
|
22
|
-
"""Test create, delete multiple"""
|
|
23
|
-
name1 = uuid.uuid4().hex
|
|
24
|
-
cmd_output = self.openstack(
|
|
25
|
-
'volume create ' + '--size 1 ' + name1,
|
|
26
|
-
parse_output=True,
|
|
27
|
-
)
|
|
28
|
-
self.assertEqual(
|
|
29
|
-
1,
|
|
30
|
-
cmd_output["size"],
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
name2 = uuid.uuid4().hex
|
|
34
|
-
cmd_output = self.openstack(
|
|
35
|
-
'volume create ' + '--size 2 ' + name2,
|
|
36
|
-
parse_output=True,
|
|
37
|
-
)
|
|
38
|
-
self.assertEqual(
|
|
39
|
-
2,
|
|
40
|
-
cmd_output["size"],
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
self.wait_for_status("volume", name1, "available")
|
|
44
|
-
self.wait_for_status("volume", name2, "available")
|
|
45
|
-
del_output = self.openstack('volume delete ' + name1 + ' ' + name2)
|
|
46
|
-
self.assertOutput('', del_output)
|
|
47
|
-
|
|
48
|
-
def test_volume_list(self):
|
|
49
|
-
"""Test create, list filter"""
|
|
50
|
-
name1 = uuid.uuid4().hex
|
|
51
|
-
cmd_output = self.openstack(
|
|
52
|
-
'volume create ' + '--size 1 ' + name1,
|
|
53
|
-
parse_output=True,
|
|
54
|
-
)
|
|
55
|
-
self.addCleanup(self.openstack, 'volume delete ' + name1)
|
|
56
|
-
self.assertEqual(
|
|
57
|
-
1,
|
|
58
|
-
cmd_output["size"],
|
|
59
|
-
)
|
|
60
|
-
self.wait_for_status("volume", name1, "available")
|
|
61
|
-
|
|
62
|
-
name2 = uuid.uuid4().hex
|
|
63
|
-
cmd_output = self.openstack(
|
|
64
|
-
'volume create ' + '--size 2 ' + name2,
|
|
65
|
-
parse_output=True,
|
|
66
|
-
)
|
|
67
|
-
self.addCleanup(self.openstack, 'volume delete ' + name2)
|
|
68
|
-
self.assertEqual(
|
|
69
|
-
2,
|
|
70
|
-
cmd_output["size"],
|
|
71
|
-
)
|
|
72
|
-
self.wait_for_status("volume", name2, "available")
|
|
73
|
-
|
|
74
|
-
# Test list
|
|
75
|
-
cmd_output = self.openstack(
|
|
76
|
-
'volume list ',
|
|
77
|
-
parse_output=True,
|
|
78
|
-
)
|
|
79
|
-
names = [x["Name"] for x in cmd_output]
|
|
80
|
-
self.assertIn(name1, names)
|
|
81
|
-
self.assertIn(name2, names)
|
|
82
|
-
|
|
83
|
-
# Test list --long
|
|
84
|
-
cmd_output = self.openstack(
|
|
85
|
-
'volume list --long',
|
|
86
|
-
parse_output=True,
|
|
87
|
-
)
|
|
88
|
-
bootable = [x["Bootable"] for x in cmd_output]
|
|
89
|
-
self.assertIn('false', bootable)
|
|
90
|
-
|
|
91
|
-
# Test list --name
|
|
92
|
-
cmd_output = self.openstack(
|
|
93
|
-
'volume list ' + '--name ' + name1,
|
|
94
|
-
parse_output=True,
|
|
95
|
-
)
|
|
96
|
-
names = [x["Name"] for x in cmd_output]
|
|
97
|
-
self.assertIn(name1, names)
|
|
98
|
-
self.assertNotIn(name2, names)
|
|
99
|
-
|
|
100
|
-
def test_volume_set_and_unset(self):
|
|
101
|
-
"""Tests create volume, set, unset, show, delete"""
|
|
102
|
-
name = uuid.uuid4().hex
|
|
103
|
-
cmd_output = self.openstack(
|
|
104
|
-
'volume create '
|
|
105
|
-
+ '--size 1 '
|
|
106
|
-
+ '--description aaaa '
|
|
107
|
-
+ '--property Alpha=a '
|
|
108
|
-
+ name,
|
|
109
|
-
parse_output=True,
|
|
110
|
-
)
|
|
111
|
-
self.assertEqual(
|
|
112
|
-
name,
|
|
113
|
-
cmd_output["name"],
|
|
114
|
-
)
|
|
115
|
-
self.assertEqual(
|
|
116
|
-
1,
|
|
117
|
-
cmd_output["size"],
|
|
118
|
-
)
|
|
119
|
-
self.assertEqual(
|
|
120
|
-
'aaaa',
|
|
121
|
-
cmd_output["display_description"],
|
|
122
|
-
)
|
|
123
|
-
self.assertEqual(
|
|
124
|
-
{'Alpha': 'a'},
|
|
125
|
-
cmd_output["properties"],
|
|
126
|
-
)
|
|
127
|
-
self.assertEqual(
|
|
128
|
-
'false',
|
|
129
|
-
cmd_output["bootable"],
|
|
130
|
-
)
|
|
131
|
-
self.wait_for_status("volume", name, "available")
|
|
132
|
-
|
|
133
|
-
# Test volume set
|
|
134
|
-
new_name = uuid.uuid4().hex
|
|
135
|
-
self.addCleanup(self.openstack, 'volume delete ' + new_name)
|
|
136
|
-
raw_output = self.openstack(
|
|
137
|
-
'volume set '
|
|
138
|
-
+ '--name '
|
|
139
|
-
+ new_name
|
|
140
|
-
+ ' --size 2 '
|
|
141
|
-
+ '--description bbbb '
|
|
142
|
-
+ '--no-property '
|
|
143
|
-
+ '--property Beta=b '
|
|
144
|
-
+ '--property Gamma=c '
|
|
145
|
-
+ '--bootable '
|
|
146
|
-
+ name,
|
|
147
|
-
)
|
|
148
|
-
self.assertOutput('', raw_output)
|
|
149
|
-
|
|
150
|
-
cmd_output = self.openstack(
|
|
151
|
-
'volume show ' + new_name,
|
|
152
|
-
parse_output=True,
|
|
153
|
-
)
|
|
154
|
-
self.assertEqual(
|
|
155
|
-
new_name,
|
|
156
|
-
cmd_output["name"],
|
|
157
|
-
)
|
|
158
|
-
self.assertEqual(
|
|
159
|
-
2,
|
|
160
|
-
cmd_output["size"],
|
|
161
|
-
)
|
|
162
|
-
self.assertEqual(
|
|
163
|
-
'bbbb',
|
|
164
|
-
cmd_output["display_description"],
|
|
165
|
-
)
|
|
166
|
-
self.assertEqual(
|
|
167
|
-
{'Beta': 'b', 'Gamma': 'c'},
|
|
168
|
-
cmd_output["properties"],
|
|
169
|
-
)
|
|
170
|
-
self.assertEqual(
|
|
171
|
-
'true',
|
|
172
|
-
cmd_output["bootable"],
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
# Test volume unset
|
|
176
|
-
raw_output = self.openstack(
|
|
177
|
-
'volume unset ' + '--property Beta ' + new_name,
|
|
178
|
-
)
|
|
179
|
-
self.assertOutput('', raw_output)
|
|
180
|
-
|
|
181
|
-
cmd_output = self.openstack(
|
|
182
|
-
'volume show ' + new_name,
|
|
183
|
-
parse_output=True,
|
|
184
|
-
)
|
|
185
|
-
self.assertEqual(
|
|
186
|
-
{'Gamma': 'c'},
|
|
187
|
-
cmd_output["properties"],
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
def test_volume_create_and_list_and_show_backward_compatibility(self):
|
|
191
|
-
"""Test backward compatibility of create, list, show"""
|
|
192
|
-
name1 = uuid.uuid4().hex
|
|
193
|
-
output = self.openstack(
|
|
194
|
-
'volume create ' + '-c display_name -c id ' + '--size 1 ' + name1,
|
|
195
|
-
parse_output=True,
|
|
196
|
-
)
|
|
197
|
-
self.assertIn('display_name', output)
|
|
198
|
-
self.assertEqual(name1, output['display_name'])
|
|
199
|
-
self.assertIn('id', output)
|
|
200
|
-
volume_id = output['id']
|
|
201
|
-
self.assertIsNotNone(volume_id)
|
|
202
|
-
self.assertNotIn('name', output)
|
|
203
|
-
self.addCleanup(self.openstack, 'volume delete ' + volume_id)
|
|
204
|
-
|
|
205
|
-
self.wait_for_status("volume", name1, "available")
|
|
206
|
-
|
|
207
|
-
output = self.openstack(
|
|
208
|
-
'volume list ' + '-c "Display Name"',
|
|
209
|
-
parse_output=True,
|
|
210
|
-
)
|
|
211
|
-
for each_volume in output:
|
|
212
|
-
self.assertIn('Display Name', each_volume)
|
|
213
|
-
|
|
214
|
-
output = self.openstack(
|
|
215
|
-
'volume list ' + '-c "Name"',
|
|
216
|
-
parse_output=True,
|
|
217
|
-
)
|
|
218
|
-
for each_volume in output:
|
|
219
|
-
self.assertIn('Name', each_volume)
|
|
220
|
-
|
|
221
|
-
output = self.openstack(
|
|
222
|
-
'volume show ' + '-c display_name -c id ' + name1,
|
|
223
|
-
parse_output=True,
|
|
224
|
-
)
|
|
225
|
-
self.assertIn('display_name', output)
|
|
226
|
-
self.assertEqual(name1, output['display_name'])
|
|
227
|
-
self.assertIn('id', output)
|
|
228
|
-
self.assertNotIn('name', output)
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
2
|
-
# not use this file except in compliance with the License. You may obtain
|
|
3
|
-
# a copy of the License at
|
|
4
|
-
#
|
|
5
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
#
|
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
|
-
# License for the specific language governing permissions and limitations
|
|
11
|
-
# under the License.
|
|
12
|
-
|
|
13
|
-
import time
|
|
14
|
-
import uuid
|
|
15
|
-
|
|
16
|
-
from openstackclient.tests.functional.volume.v1 import common
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class VolumeTypeTests(common.BaseVolumeTests):
|
|
20
|
-
"""Functional tests for volume type."""
|
|
21
|
-
|
|
22
|
-
def test_volume_type_create_list(self):
|
|
23
|
-
name = uuid.uuid4().hex
|
|
24
|
-
cmd_output = self.openstack(
|
|
25
|
-
'volume type create --private ' + name,
|
|
26
|
-
parse_output=True,
|
|
27
|
-
)
|
|
28
|
-
self.addCleanup(
|
|
29
|
-
self.openstack,
|
|
30
|
-
'volume type delete ' + name,
|
|
31
|
-
)
|
|
32
|
-
self.assertEqual(name, cmd_output['name'])
|
|
33
|
-
|
|
34
|
-
cmd_output = self.openstack(
|
|
35
|
-
f'volume type show {name}',
|
|
36
|
-
parse_output=True,
|
|
37
|
-
)
|
|
38
|
-
self.assertEqual(self.NAME, cmd_output['name'])
|
|
39
|
-
|
|
40
|
-
cmd_output = self.openstack('volume type list', parse_output=True)
|
|
41
|
-
self.assertIn(self.NAME, [t['Name'] for t in cmd_output])
|
|
42
|
-
|
|
43
|
-
cmd_output = self.openstack(
|
|
44
|
-
'volume type list --default',
|
|
45
|
-
parse_output=True,
|
|
46
|
-
)
|
|
47
|
-
self.assertEqual(1, len(cmd_output))
|
|
48
|
-
self.assertEqual('lvmdriver-1', cmd_output[0]['Name'])
|
|
49
|
-
|
|
50
|
-
def test_volume_type_set_unset_properties(self):
|
|
51
|
-
name = uuid.uuid4().hex
|
|
52
|
-
cmd_output = self.openstack(
|
|
53
|
-
'volume type create --private ' + name,
|
|
54
|
-
parse_output=True,
|
|
55
|
-
)
|
|
56
|
-
self.addCleanup(self.openstack, 'volume type delete ' + name)
|
|
57
|
-
self.assertEqual(name, cmd_output['name'])
|
|
58
|
-
|
|
59
|
-
raw_output = self.openstack(
|
|
60
|
-
f'volume type set --property a=b --property c=d {name}'
|
|
61
|
-
)
|
|
62
|
-
self.assertEqual("", raw_output)
|
|
63
|
-
cmd_output = self.openstack(
|
|
64
|
-
f'volume type show {name}',
|
|
65
|
-
parse_output=True,
|
|
66
|
-
)
|
|
67
|
-
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
68
|
-
|
|
69
|
-
raw_output = self.openstack(f'volume type unset --property a {name}')
|
|
70
|
-
self.assertEqual("", raw_output)
|
|
71
|
-
cmd_output = self.openstack(
|
|
72
|
-
f'volume type show {name}',
|
|
73
|
-
parse_output=True,
|
|
74
|
-
)
|
|
75
|
-
self.assertEqual({'c': 'd'}, cmd_output['properties'])
|
|
76
|
-
|
|
77
|
-
def test_volume_type_set_unset_multiple_properties(self):
|
|
78
|
-
name = uuid.uuid4().hex
|
|
79
|
-
cmd_output = self.openstack(
|
|
80
|
-
'volume type create --private ' + name,
|
|
81
|
-
parse_output=True,
|
|
82
|
-
)
|
|
83
|
-
self.addCleanup(self.openstack, 'volume type delete ' + name)
|
|
84
|
-
self.assertEqual(name, cmd_output['name'])
|
|
85
|
-
|
|
86
|
-
raw_output = self.openstack(
|
|
87
|
-
f'volume type set --property a=b --property c=d {name}'
|
|
88
|
-
)
|
|
89
|
-
self.assertEqual("", raw_output)
|
|
90
|
-
cmd_output = self.openstack(
|
|
91
|
-
f'volume type show {name}',
|
|
92
|
-
parse_output=True,
|
|
93
|
-
)
|
|
94
|
-
self.assertEqual({'a': 'b', 'c': 'd'}, cmd_output['properties'])
|
|
95
|
-
|
|
96
|
-
raw_output = self.openstack(
|
|
97
|
-
f'volume type unset --property a --property c {name}'
|
|
98
|
-
)
|
|
99
|
-
self.assertEqual("", raw_output)
|
|
100
|
-
cmd_output = self.openstack(
|
|
101
|
-
f'volume type show {name}',
|
|
102
|
-
parse_output=True,
|
|
103
|
-
)
|
|
104
|
-
self.assertEqual({}, cmd_output['properties'])
|
|
105
|
-
|
|
106
|
-
def test_multi_delete(self):
|
|
107
|
-
vol_type1 = uuid.uuid4().hex
|
|
108
|
-
vol_type2 = uuid.uuid4().hex
|
|
109
|
-
self.openstack(f'volume type create {vol_type1}')
|
|
110
|
-
time.sleep(5)
|
|
111
|
-
self.openstack(f'volume type create {vol_type2}')
|
|
112
|
-
time.sleep(5)
|
|
113
|
-
cmd = f'volume type delete {vol_type1} {vol_type2}'
|
|
114
|
-
raw_output = self.openstack(cmd)
|
|
115
|
-
self.assertOutput('', raw_output)
|
|
116
|
-
|
|
117
|
-
# NOTE: Add some basic functional tests with the old format to
|
|
118
|
-
# make sure the command works properly, need to change
|
|
119
|
-
# these to new test format when beef up all tests for
|
|
120
|
-
# volume type commands.
|
|
121
|
-
def test_encryption_type(self):
|
|
122
|
-
encryption_type = uuid.uuid4().hex
|
|
123
|
-
# test create new encryption type
|
|
124
|
-
cmd_output = self.openstack(
|
|
125
|
-
'volume type create '
|
|
126
|
-
'--encryption-provider LuksEncryptor '
|
|
127
|
-
'--encryption-cipher aes-xts-plain64 '
|
|
128
|
-
'--encryption-key-size 128 '
|
|
129
|
-
'--encryption-control-location front-end ' + encryption_type
|
|
130
|
-
)
|
|
131
|
-
expected = {
|
|
132
|
-
'provider': 'LuksEncryptor',
|
|
133
|
-
'cipher': 'aes-xts-plain64',
|
|
134
|
-
'key_size': 128,
|
|
135
|
-
'control_location': 'front-end',
|
|
136
|
-
}
|
|
137
|
-
for attr, value in expected.items():
|
|
138
|
-
self.assertEqual(value, cmd_output['encryption'][attr])
|
|
139
|
-
# test show encryption type
|
|
140
|
-
cmd_output = self.openstack(
|
|
141
|
-
'volume type show --encryption-type ' + encryption_type,
|
|
142
|
-
parse_output=True,
|
|
143
|
-
)
|
|
144
|
-
expected = {
|
|
145
|
-
'provider': 'LuksEncryptor',
|
|
146
|
-
'cipher': 'aes-xts-plain64',
|
|
147
|
-
'key_size': 128,
|
|
148
|
-
'control_location': 'front-end',
|
|
149
|
-
}
|
|
150
|
-
for attr, value in expected.items():
|
|
151
|
-
self.assertEqual(value, cmd_output['encryption'][attr])
|
|
152
|
-
# test list encryption type
|
|
153
|
-
cmd_output = self.openstack(
|
|
154
|
-
'volume type list --encryption-type',
|
|
155
|
-
parse_output=True,
|
|
156
|
-
)
|
|
157
|
-
encryption_output = [
|
|
158
|
-
t['Encryption'] for t in cmd_output if t['Name'] == encryption_type
|
|
159
|
-
][0]
|
|
160
|
-
expected = {
|
|
161
|
-
'provider': 'LuksEncryptor',
|
|
162
|
-
'cipher': 'aes-xts-plain64',
|
|
163
|
-
'key_size': 128,
|
|
164
|
-
'control_location': 'front-end',
|
|
165
|
-
}
|
|
166
|
-
for attr, value in expected.items():
|
|
167
|
-
self.assertEqual(value, encryption_output[attr])
|
|
168
|
-
# test set new encryption type
|
|
169
|
-
raw_output = self.openstack(
|
|
170
|
-
'volume type set '
|
|
171
|
-
'--encryption-provider LuksEncryptor '
|
|
172
|
-
'--encryption-cipher aes-xts-plain64 '
|
|
173
|
-
'--encryption-key-size 128 '
|
|
174
|
-
'--encryption-control-location front-end ' + self.NAME
|
|
175
|
-
)
|
|
176
|
-
self.assertEqual('', raw_output)
|
|
177
|
-
|
|
178
|
-
name = uuid.uuid4().hex
|
|
179
|
-
cmd_output = self.openstack(
|
|
180
|
-
'volume type create --private ' + name,
|
|
181
|
-
parse_output=True,
|
|
182
|
-
)
|
|
183
|
-
self.addCleanup(
|
|
184
|
-
self.openstack,
|
|
185
|
-
'volume type delete ' + name,
|
|
186
|
-
)
|
|
187
|
-
self.assertEqual(name, cmd_output['name'])
|
|
188
|
-
|
|
189
|
-
cmd_output = self.openstack(
|
|
190
|
-
'volume type show --encryption-type ' + name,
|
|
191
|
-
parse_output=True,
|
|
192
|
-
)
|
|
193
|
-
expected = {
|
|
194
|
-
'provider': 'LuksEncryptor',
|
|
195
|
-
'cipher': 'aes-xts-plain64',
|
|
196
|
-
'key_size': 128,
|
|
197
|
-
'control_location': 'front-end',
|
|
198
|
-
}
|
|
199
|
-
for attr, value in expected.items():
|
|
200
|
-
self.assertEqual(value, cmd_output['encryption'][attr])
|
|
201
|
-
# test unset encryption type
|
|
202
|
-
raw_output = self.openstack(
|
|
203
|
-
'volume type unset --encryption-type ' + name
|
|
204
|
-
)
|
|
205
|
-
self.assertEqual('', raw_output)
|
|
206
|
-
cmd_output = self.openstack(
|
|
207
|
-
'volume type show --encryption-type ' + name,
|
|
208
|
-
parse_output=True,
|
|
209
|
-
)
|
|
210
|
-
self.assertEqual({}, cmd_output['encryption'])
|
|
211
|
-
# test delete encryption type
|
|
212
|
-
raw_output = self.openstack('volume type delete ' + encryption_type)
|
|
213
|
-
self.assertEqual('', raw_output)
|
|
File without changes
|