python-openstackclient 8.3.0__py3-none-any.whl → 10.0.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/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +58 -42
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +14 -6
- openstackclient/common/pagination.py +8 -2
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +13 -7
- openstackclient/common/quota.py +126 -114
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +39 -21
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +14 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +29 -14
- openstackclient/compute/v2/server.py +251 -171
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +21 -12
- openstackclient/compute/v2/server_group.py +21 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +24 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +10 -4
- openstackclient/compute/v2/service.py +14 -7
- openstackclient/compute/v2/usage.py +26 -21
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +103 -41
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +26 -12
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +26 -12
- openstackclient/identity/v3/application_credential.py +59 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +36 -16
- openstackclient/identity/v3/domain.py +37 -18
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +42 -20
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +71 -50
- openstackclient/identity/v3/group.py +55 -32
- openstackclient/identity/v3/identity_provider.py +92 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +115 -92
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +211 -122
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +116 -109
- openstackclient/identity/v3/role.py +61 -31
- openstackclient/identity/v3/role_assignment.py +23 -6
- openstackclient/identity/v3/service.py +36 -16
- openstackclient/identity/v3/service_provider.py +37 -15
- openstackclient/identity/v3/tag.py +23 -17
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +32 -14
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +49 -26
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +14 -9
- openstackclient/image/v2/image.py +76 -49
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +109 -13
- openstackclient/image/v2/metadef_objects.py +28 -15
- openstackclient/image/v2/metadef_properties.py +24 -13
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +15 -6
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +36 -22
- openstackclient/network/v2/address_group.py +27 -16
- openstackclient/network/v2/address_scope.py +24 -13
- openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +214 -0
- openstackclient/network/v2/bgpvpn/port_association.py +490 -0
- openstackclient/network/v2/bgpvpn/router_association.py +288 -0
- openstackclient/network/v2/default_security_group_rule.py +19 -10
- openstackclient/network/v2/floating_ip.py +110 -159
- openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +466 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +574 -0
- openstackclient/network/v2/ip_availability.py +13 -5
- openstackclient/network/v2/l3_conntrack_helper.py +22 -13
- openstackclient/network/v2/local_ip.py +24 -13
- openstackclient/network/v2/local_ip_association.py +14 -7
- openstackclient/network/v2/ndp_proxy.py +20 -11
- openstackclient/network/v2/network.py +129 -196
- openstackclient/network/v2/network_agent.py +46 -25
- openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
- openstackclient/network/v2/network_flavor.py +27 -16
- openstackclient/network/v2/network_flavor_profile.py +23 -12
- openstackclient/network/v2/network_meter.py +21 -10
- openstackclient/network/v2/network_meter_rule.py +21 -11
- openstackclient/network/v2/network_qos_policy.py +25 -15
- openstackclient/network/v2/network_qos_rule.py +32 -17
- openstackclient/network/v2/network_qos_rule_type.py +13 -5
- openstackclient/network/v2/network_rbac.py +23 -12
- openstackclient/network/v2/network_segment.py +20 -11
- openstackclient/network/v2/network_segment_range.py +56 -29
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +38 -22
- openstackclient/network/v2/port.py +54 -29
- openstackclient/network/v2/router.py +75 -52
- openstackclient/network/v2/security_group.py +87 -157
- openstackclient/network/v2/security_group_rule.py +100 -280
- openstackclient/network/v2/subnet.py +49 -28
- openstackclient/network/v2/subnet_pool.py +30 -17
- openstackclient/network/v2/taas/tap_flow.py +22 -11
- openstackclient/network/v2/taas/tap_mirror.py +22 -11
- openstackclient/network/v2/taas/tap_service.py +23 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +25 -15
- openstackclient/object/v1/object.py +25 -15
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +25 -19
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +56 -138
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_module.py +12 -7
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +62 -23
- openstackclient/tests/unit/compute/v2/fakes.py +25 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
- openstackclient/tests/unit/compute/v2/test_server.py +17 -104
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/identity/v3/fakes.py +3 -0
- openstackclient/tests/unit/identity/v3/test_group.py +4 -14
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_limit.py +197 -145
- openstackclient/tests/unit/identity/v3/test_project.py +831 -512
- openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +355 -220
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +16 -16
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +2 -2
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_router.py +8 -9
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
- openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +1 -0
- openstackclient/tests/unit/volume/v2/test_consistency_group.py +8 -2
- openstackclient/tests/unit/volume/v2/test_volume.py +7 -6
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +1 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +94 -15
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +37 -25
- openstackclient/volume/v2/consistency_group_snapshot.py +27 -12
- openstackclient/volume/v2/qos_specs.py +30 -19
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +69 -34
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -22
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +52 -26
- openstackclient/volume/v2/volume_transfer_request.py +33 -15
- openstackclient/volume/v2/volume_type.py +46 -27
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +103 -46
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +55 -26
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +32 -13
- openstackclient/volume/v3/volume_group_type.py +26 -13
- openstackclient/volume/v3/volume_message.py +15 -7
- openstackclient/volume/v3/volume_snapshot.py +71 -34
- openstackclient/volume/v3/volume_transfer_request.py +33 -15
- openstackclient/volume/v3/volume_type.py +45 -27
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +279 -267
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.0.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-8.3.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
from typing import ClassVar
|
|
13
14
|
import uuid
|
|
14
15
|
|
|
15
16
|
from openstackclient.tests.functional.volume.v2 import common
|
|
@@ -18,24 +19,27 @@ from openstackclient.tests.functional.volume.v2 import common
|
|
|
18
19
|
class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
19
20
|
"""Functional tests for volume snapshot."""
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
VOLUME_NAME = uuid.uuid4().hex
|
|
23
|
+
VOLUME_ID: ClassVar[str]
|
|
22
24
|
|
|
23
25
|
@classmethod
|
|
24
26
|
def setUpClass(cls):
|
|
25
27
|
super().setUpClass()
|
|
26
28
|
# create a volume for all tests to create snapshot
|
|
27
29
|
cmd_output = cls.openstack(
|
|
28
|
-
'volume create ' + '--size 1 ' + cls.
|
|
30
|
+
'volume create ' + '--size 1 ' + cls.VOLUME_NAME,
|
|
29
31
|
parse_output=True,
|
|
30
32
|
)
|
|
31
|
-
cls.wait_for_status('volume', cls.
|
|
33
|
+
cls.wait_for_status('volume', cls.VOLUME_NAME, 'available')
|
|
32
34
|
cls.VOLUME_ID = cmd_output['id']
|
|
33
35
|
|
|
34
36
|
@classmethod
|
|
35
37
|
def tearDownClass(cls):
|
|
36
38
|
try:
|
|
37
|
-
cls.wait_for_status('volume', cls.
|
|
38
|
-
raw_output = cls.openstack(
|
|
39
|
+
cls.wait_for_status('volume', cls.VOLUME_NAME, 'available')
|
|
40
|
+
raw_output = cls.openstack(
|
|
41
|
+
'volume delete --force ' + cls.VOLUME_NAME
|
|
42
|
+
)
|
|
39
43
|
cls.assertOutput('', raw_output)
|
|
40
44
|
finally:
|
|
41
45
|
super().tearDownClass()
|
|
@@ -44,7 +48,10 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
44
48
|
"""Test create, delete multiple"""
|
|
45
49
|
name1 = uuid.uuid4().hex
|
|
46
50
|
cmd_output = self.openstack(
|
|
47
|
-
'volume snapshot create '
|
|
51
|
+
'volume snapshot create '
|
|
52
|
+
+ name1
|
|
53
|
+
+ ' --volume '
|
|
54
|
+
+ self.VOLUME_NAME,
|
|
48
55
|
parse_output=True,
|
|
49
56
|
)
|
|
50
57
|
self.assertEqual(
|
|
@@ -54,7 +61,10 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
54
61
|
|
|
55
62
|
name2 = uuid.uuid4().hex
|
|
56
63
|
cmd_output = self.openstack(
|
|
57
|
-
'volume snapshot create '
|
|
64
|
+
'volume snapshot create '
|
|
65
|
+
+ name2
|
|
66
|
+
+ ' --volume '
|
|
67
|
+
+ self.VOLUME_NAME,
|
|
58
68
|
parse_output=True,
|
|
59
69
|
)
|
|
60
70
|
self.assertEqual(
|
|
@@ -76,7 +86,10 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
76
86
|
"""Test create, list filter"""
|
|
77
87
|
name1 = uuid.uuid4().hex
|
|
78
88
|
cmd_output = self.openstack(
|
|
79
|
-
'volume snapshot create '
|
|
89
|
+
'volume snapshot create '
|
|
90
|
+
+ name1
|
|
91
|
+
+ ' --volume '
|
|
92
|
+
+ self.VOLUME_NAME,
|
|
80
93
|
parse_output=True,
|
|
81
94
|
)
|
|
82
95
|
self.addCleanup(self.wait_for_delete, 'volume snapshot', name1)
|
|
@@ -97,7 +110,10 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
97
110
|
|
|
98
111
|
name2 = uuid.uuid4().hex
|
|
99
112
|
cmd_output = self.openstack(
|
|
100
|
-
'volume snapshot create '
|
|
113
|
+
'volume snapshot create '
|
|
114
|
+
+ name2
|
|
115
|
+
+ ' --volume '
|
|
116
|
+
+ self.VOLUME_NAME,
|
|
101
117
|
parse_output=True,
|
|
102
118
|
)
|
|
103
119
|
self.addCleanup(self.wait_for_delete, 'volume snapshot', name2)
|
|
@@ -146,7 +162,7 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
146
162
|
|
|
147
163
|
# Test list --volume
|
|
148
164
|
cmd_output = self.openstack(
|
|
149
|
-
'volume snapshot list ' + '--volume ' + self.
|
|
165
|
+
'volume snapshot list ' + '--volume ' + self.VOLUME_NAME,
|
|
150
166
|
parse_output=True,
|
|
151
167
|
)
|
|
152
168
|
names = [x["Name"] for x in cmd_output]
|
|
@@ -169,7 +185,7 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
169
185
|
cmd_output = self.openstack(
|
|
170
186
|
'volume snapshot create '
|
|
171
187
|
+ '--volume '
|
|
172
|
-
+ self.
|
|
188
|
+
+ self.VOLUME_NAME
|
|
173
189
|
+ ' --description aaaa '
|
|
174
190
|
+ '--property Alpha=a '
|
|
175
191
|
+ name,
|
|
@@ -173,9 +173,9 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
173
173
|
'volume type list --encryption-type',
|
|
174
174
|
parse_output=True,
|
|
175
175
|
)
|
|
176
|
-
encryption_output =
|
|
176
|
+
encryption_output = next(
|
|
177
177
|
t['Encryption'] for t in cmd_output if t['Name'] == encryption_type
|
|
178
|
-
|
|
178
|
+
)
|
|
179
179
|
expected = {
|
|
180
180
|
'provider': 'LuksEncryptor',
|
|
181
181
|
'cipher': 'aes-xts-plain64',
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
from typing import ClassVar
|
|
14
|
+
|
|
13
15
|
import fixtures
|
|
14
16
|
|
|
15
17
|
from openstackclient.tests.functional.volume import base
|
|
@@ -18,6 +20,8 @@ from openstackclient.tests.functional.volume import base
|
|
|
18
20
|
class BaseVolumeTests(base.BaseVolumeTests):
|
|
19
21
|
"""Base class for Volume functional tests."""
|
|
20
22
|
|
|
23
|
+
haz_volume_v3: ClassVar[bool]
|
|
24
|
+
|
|
21
25
|
@classmethod
|
|
22
26
|
def setUpClass(cls):
|
|
23
27
|
super().setUpClass()
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
from typing import ClassVar
|
|
13
14
|
import uuid
|
|
14
15
|
|
|
15
16
|
from openstackclient.tests.functional.volume.v3 import common
|
|
@@ -18,169 +19,82 @@ from openstackclient.tests.functional.volume.v3 import common
|
|
|
18
19
|
class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
19
20
|
"""Functional tests for volume snapshot."""
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
VOLUME_NAME = uuid.uuid4().hex
|
|
23
|
+
VOLUME_ID: ClassVar[str]
|
|
22
24
|
|
|
23
25
|
@classmethod
|
|
24
26
|
def setUpClass(cls):
|
|
25
27
|
super().setUpClass()
|
|
26
|
-
# create a volume
|
|
28
|
+
# create a test volume used by all snapshot tests
|
|
27
29
|
cmd_output = cls.openstack(
|
|
28
|
-
'volume create ' + '--size 1 ' + cls.
|
|
30
|
+
'volume create ' + '--size 1 ' + cls.VOLUME_NAME,
|
|
29
31
|
parse_output=True,
|
|
30
32
|
)
|
|
31
|
-
cls.wait_for_status('volume', cls.
|
|
33
|
+
cls.wait_for_status('volume', cls.VOLUME_NAME, 'available')
|
|
32
34
|
cls.VOLUME_ID = cmd_output['id']
|
|
33
35
|
|
|
34
36
|
@classmethod
|
|
35
37
|
def tearDownClass(cls):
|
|
36
38
|
try:
|
|
37
|
-
cls.wait_for_status('volume', cls.
|
|
38
|
-
raw_output = cls.openstack(
|
|
39
|
+
cls.wait_for_status('volume', cls.VOLUME_NAME, 'available')
|
|
40
|
+
raw_output = cls.openstack(
|
|
41
|
+
'volume delete --force ' + cls.VOLUME_NAME
|
|
42
|
+
)
|
|
39
43
|
cls.assertOutput('', raw_output)
|
|
40
44
|
finally:
|
|
41
45
|
super().tearDownClass()
|
|
42
46
|
|
|
43
|
-
def
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
cmd_output = self.openstack(
|
|
47
|
-
'volume snapshot create ' + name1 + ' --volume ' + self.VOLLY,
|
|
48
|
-
parse_output=True,
|
|
49
|
-
)
|
|
50
|
-
self.assertEqual(
|
|
51
|
-
name1,
|
|
52
|
-
cmd_output["name"],
|
|
53
|
-
)
|
|
47
|
+
def test_volume_snapshot(self):
|
|
48
|
+
# create volume snapshot
|
|
49
|
+
name = uuid.uuid4().hex
|
|
54
50
|
|
|
55
|
-
name2 = uuid.uuid4().hex
|
|
56
51
|
cmd_output = self.openstack(
|
|
57
|
-
'volume snapshot create '
|
|
52
|
+
'volume snapshot create '
|
|
53
|
+
+ '--volume '
|
|
54
|
+
+ self.VOLUME_NAME
|
|
55
|
+
+ ' --description aaaa '
|
|
56
|
+
+ '--property Alpha=a '
|
|
57
|
+
+ name,
|
|
58
58
|
parse_output=True,
|
|
59
59
|
)
|
|
60
|
-
|
|
61
|
-
name2,
|
|
62
|
-
cmd_output["name"],
|
|
63
|
-
)
|
|
60
|
+
snap_id = cmd_output['id']
|
|
64
61
|
|
|
65
|
-
self.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'volume snapshot delete ' +
|
|
62
|
+
self.addCleanup(self.wait_for_delete, 'volume snapshot', snap_id)
|
|
63
|
+
# delete volume snapshot
|
|
64
|
+
self.addCleanup(
|
|
65
|
+
self.openstack,
|
|
66
|
+
'volume snapshot delete ' + snap_id,
|
|
70
67
|
)
|
|
71
|
-
self.
|
|
72
|
-
self.wait_for_delete('volume snapshot', name1)
|
|
73
|
-
self.wait_for_delete('volume snapshot', name2)
|
|
68
|
+
self.wait_for_status('volume snapshot', snap_id, 'available')
|
|
74
69
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
cmd_output = self.openstack(
|
|
79
|
-
'volume snapshot create ' + name1 + ' --volume ' + self.VOLLY,
|
|
70
|
+
# show volume snapshot
|
|
71
|
+
snapshot_info = self.openstack(
|
|
72
|
+
'volume snapshot show ' + name,
|
|
80
73
|
parse_output=True,
|
|
81
74
|
)
|
|
82
|
-
self.addCleanup(self.wait_for_delete, 'volume snapshot', name1)
|
|
83
|
-
self.addCleanup(self.openstack, 'volume snapshot delete ' + name1)
|
|
84
|
-
self.assertEqual(
|
|
85
|
-
name1,
|
|
86
|
-
cmd_output["name"],
|
|
87
|
-
)
|
|
88
|
-
self.assertEqual(
|
|
89
|
-
self.VOLUME_ID,
|
|
90
|
-
cmd_output["volume_id"],
|
|
91
|
-
)
|
|
92
|
-
self.assertEqual(
|
|
93
|
-
1,
|
|
94
|
-
cmd_output["size"],
|
|
95
|
-
)
|
|
96
|
-
self.wait_for_status('volume snapshot', name1, 'available')
|
|
97
75
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
parse_output=True,
|
|
102
|
-
)
|
|
103
|
-
self.addCleanup(self.wait_for_delete, 'volume snapshot', name2)
|
|
104
|
-
self.addCleanup(self.openstack, 'volume snapshot delete ' + name2)
|
|
105
|
-
self.assertEqual(
|
|
106
|
-
name2,
|
|
107
|
-
cmd_output["name"],
|
|
108
|
-
)
|
|
109
|
-
self.assertEqual(
|
|
110
|
-
self.VOLUME_ID,
|
|
111
|
-
cmd_output["volume_id"],
|
|
112
|
-
)
|
|
113
|
-
self.assertEqual(
|
|
114
|
-
1,
|
|
115
|
-
cmd_output["size"],
|
|
116
|
-
)
|
|
117
|
-
self.wait_for_status('volume snapshot', name2, 'available')
|
|
118
|
-
raw_output = self.openstack(
|
|
119
|
-
'volume snapshot set ' + '--state error ' + name2
|
|
120
|
-
)
|
|
121
|
-
self.assertOutput('', raw_output)
|
|
76
|
+
self.assertEqual(name, snapshot_info['name'])
|
|
77
|
+
self.assertEqual('aaaa', snapshot_info["description"])
|
|
78
|
+
self.assertEqual({'Alpha': 'a'}, snapshot_info["properties"])
|
|
122
79
|
|
|
123
|
-
#
|
|
80
|
+
# list volume snapshot --name
|
|
124
81
|
cmd_output = self.openstack(
|
|
125
|
-
'volume snapshot list
|
|
82
|
+
'volume snapshot list --name ' + name,
|
|
126
83
|
parse_output=True,
|
|
127
84
|
)
|
|
128
|
-
names = [x[
|
|
129
|
-
self.
|
|
130
|
-
self.assertIn(name2, names)
|
|
85
|
+
names = [x['Name'] for x in cmd_output]
|
|
86
|
+
self.assertIn(name, names)
|
|
131
87
|
|
|
132
|
-
#
|
|
88
|
+
# list volume snapshot --volume
|
|
133
89
|
cmd_output = self.openstack(
|
|
134
|
-
'volume snapshot list ' + '--volume ' + self.
|
|
90
|
+
'volume snapshot list ' + '--volume ' + self.VOLUME_NAME,
|
|
135
91
|
parse_output=True,
|
|
136
92
|
)
|
|
137
93
|
names = [x["Name"] for x in cmd_output]
|
|
138
|
-
self.assertIn(
|
|
139
|
-
self.assertIn(name2, names)
|
|
94
|
+
self.assertIn(name, names)
|
|
140
95
|
|
|
141
|
-
#
|
|
142
|
-
cmd_output = self.openstack(
|
|
143
|
-
'volume snapshot list ' + '--name ' + name1,
|
|
144
|
-
parse_output=True,
|
|
145
|
-
)
|
|
146
|
-
names = [x["Name"] for x in cmd_output]
|
|
147
|
-
self.assertIn(name1, names)
|
|
148
|
-
self.assertNotIn(name2, names)
|
|
149
|
-
|
|
150
|
-
def test_volume_snapshot_set(self):
|
|
151
|
-
"""Test create, set, unset, show, delete volume snapshot"""
|
|
152
|
-
name = uuid.uuid4().hex
|
|
96
|
+
# set volume snapshot
|
|
153
97
|
new_name = name + "_"
|
|
154
|
-
cmd_output = self.openstack(
|
|
155
|
-
'volume snapshot create '
|
|
156
|
-
+ '--volume '
|
|
157
|
-
+ self.VOLLY
|
|
158
|
-
+ ' --description aaaa '
|
|
159
|
-
+ '--property Alpha=a '
|
|
160
|
-
+ name,
|
|
161
|
-
parse_output=True,
|
|
162
|
-
)
|
|
163
|
-
self.addCleanup(self.wait_for_delete, 'volume snapshot', new_name)
|
|
164
|
-
self.addCleanup(self.openstack, 'volume snapshot delete ' + new_name)
|
|
165
|
-
self.assertEqual(
|
|
166
|
-
name,
|
|
167
|
-
cmd_output["name"],
|
|
168
|
-
)
|
|
169
|
-
self.assertEqual(
|
|
170
|
-
1,
|
|
171
|
-
cmd_output["size"],
|
|
172
|
-
)
|
|
173
|
-
self.assertEqual(
|
|
174
|
-
'aaaa',
|
|
175
|
-
cmd_output["description"],
|
|
176
|
-
)
|
|
177
|
-
self.assertEqual(
|
|
178
|
-
{'Alpha': 'a'},
|
|
179
|
-
cmd_output["properties"],
|
|
180
|
-
)
|
|
181
|
-
self.wait_for_status('volume snapshot', name, 'available')
|
|
182
|
-
|
|
183
|
-
# Test volume snapshot set
|
|
184
98
|
raw_output = self.openstack(
|
|
185
99
|
'volume snapshot set '
|
|
186
100
|
+ '--name '
|
|
@@ -188,11 +102,10 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
188
102
|
+ ' --description bbbb '
|
|
189
103
|
+ '--property Alpha=c '
|
|
190
104
|
+ '--property Beta=b '
|
|
191
|
-
+
|
|
105
|
+
+ snap_id,
|
|
192
106
|
)
|
|
193
107
|
self.assertOutput('', raw_output)
|
|
194
108
|
|
|
195
|
-
# Show snapshot set result
|
|
196
109
|
cmd_output = self.openstack(
|
|
197
110
|
'volume snapshot show ' + new_name,
|
|
198
111
|
parse_output=True,
|
|
@@ -201,10 +114,6 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
201
114
|
new_name,
|
|
202
115
|
cmd_output["name"],
|
|
203
116
|
)
|
|
204
|
-
self.assertEqual(
|
|
205
|
-
1,
|
|
206
|
-
cmd_output["size"],
|
|
207
|
-
)
|
|
208
117
|
self.assertEqual(
|
|
209
118
|
'bbbb',
|
|
210
119
|
cmd_output["description"],
|
|
@@ -214,7 +123,7 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
214
123
|
cmd_output["properties"],
|
|
215
124
|
)
|
|
216
125
|
|
|
217
|
-
#
|
|
126
|
+
# unset volume snapshot
|
|
218
127
|
raw_output = self.openstack(
|
|
219
128
|
'volume snapshot unset ' + '--property Alpha ' + new_name,
|
|
220
129
|
)
|
|
@@ -229,16 +138,25 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
|
|
|
229
138
|
cmd_output["properties"],
|
|
230
139
|
)
|
|
231
140
|
|
|
232
|
-
#
|
|
141
|
+
# set volume snapshot --no-property, --state error
|
|
233
142
|
raw_output = self.openstack(
|
|
234
|
-
'volume snapshot set '
|
|
143
|
+
'volume snapshot set '
|
|
144
|
+
+ '--no-property '
|
|
145
|
+
+ '--state error '
|
|
146
|
+
+ new_name,
|
|
235
147
|
)
|
|
236
148
|
self.assertOutput('', raw_output)
|
|
149
|
+
|
|
237
150
|
cmd_output = self.openstack(
|
|
238
151
|
'volume snapshot show ' + new_name,
|
|
239
152
|
parse_output=True,
|
|
240
153
|
)
|
|
241
|
-
self.
|
|
242
|
-
|
|
243
|
-
|
|
154
|
+
self.assertEqual({}, cmd_output["properties"])
|
|
155
|
+
|
|
156
|
+
# list volume snapshot --long --status
|
|
157
|
+
cmd_output = self.openstack(
|
|
158
|
+
'volume snapshot list ' + '--long ' + '--status error',
|
|
159
|
+
parse_output=True,
|
|
244
160
|
)
|
|
161
|
+
names = [x["Name"] for x in cmd_output]
|
|
162
|
+
self.assertIn(new_name, names)
|
|
@@ -173,9 +173,9 @@ class VolumeTypeTests(common.BaseVolumeTests):
|
|
|
173
173
|
'volume type list --encryption-type',
|
|
174
174
|
parse_output=True,
|
|
175
175
|
)
|
|
176
|
-
encryption_output =
|
|
176
|
+
encryption_output = next(
|
|
177
177
|
t['Encryption'] for t in cmd_output if t['Name'] == encryption_type
|
|
178
|
-
|
|
178
|
+
)
|
|
179
179
|
expected = {
|
|
180
180
|
'provider': 'LuksEncryptor',
|
|
181
181
|
'cipher': 'aes-xts-plain64',
|
|
@@ -38,18 +38,15 @@ def _build_compute_az_datalist(compute_az, long_datalist=False):
|
|
|
38
38
|
return (datalist,)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def
|
|
41
|
+
def _build_network_az_datalist(network_az, long_datalist=False):
|
|
42
42
|
datalist = ()
|
|
43
43
|
if not long_datalist:
|
|
44
|
-
datalist = (
|
|
45
|
-
volume_az.name,
|
|
46
|
-
'available',
|
|
47
|
-
)
|
|
44
|
+
datalist = (network_az.name, network_az.state)
|
|
48
45
|
else:
|
|
49
46
|
datalist = (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
network_az.name,
|
|
48
|
+
network_az.state,
|
|
49
|
+
network_az.resource,
|
|
53
50
|
'',
|
|
54
51
|
'',
|
|
55
52
|
'',
|
|
@@ -57,22 +54,12 @@ def _build_volume_az_datalist(volume_az, long_datalist=False):
|
|
|
57
54
|
return (datalist,)
|
|
58
55
|
|
|
59
56
|
|
|
60
|
-
def
|
|
57
|
+
def _build_volume_az_datalist(volume_az, long_datalist=False):
|
|
61
58
|
datalist = ()
|
|
62
59
|
if not long_datalist:
|
|
63
|
-
datalist = (
|
|
64
|
-
network_az.name,
|
|
65
|
-
network_az.state,
|
|
66
|
-
)
|
|
60
|
+
datalist = (volume_az.name, 'available')
|
|
67
61
|
else:
|
|
68
|
-
datalist = (
|
|
69
|
-
network_az.name,
|
|
70
|
-
network_az.state,
|
|
71
|
-
network_az.resource,
|
|
72
|
-
'',
|
|
73
|
-
'',
|
|
74
|
-
'',
|
|
75
|
-
)
|
|
62
|
+
datalist = (volume_az.name, 'available', '', '', '', '')
|
|
76
63
|
return (datalist,)
|
|
77
64
|
|
|
78
65
|
|
|
@@ -82,10 +69,6 @@ class TestAvailabilityZoneList(
|
|
|
82
69
|
compute_fakes.FakeClientMixin,
|
|
83
70
|
utils.TestCommand,
|
|
84
71
|
):
|
|
85
|
-
compute_azs = compute_fakes.create_availability_zones()
|
|
86
|
-
volume_azs = volume_fakes.create_availability_zones(count=1)
|
|
87
|
-
network_azs = network_fakes.create_availability_zones()
|
|
88
|
-
|
|
89
72
|
short_columnslist = ('Zone Name', 'Zone Status')
|
|
90
73
|
long_columnslist = (
|
|
91
74
|
'Zone Name',
|
|
@@ -99,11 +82,14 @@ class TestAvailabilityZoneList(
|
|
|
99
82
|
def setUp(self):
|
|
100
83
|
super().setUp()
|
|
101
84
|
|
|
85
|
+
self.compute_azs = compute_fakes.create_availability_zones()
|
|
102
86
|
self.compute_client.availability_zones.return_value = self.compute_azs
|
|
87
|
+
self.network_azs = network_fakes.create_availability_zones()
|
|
88
|
+
self.network_client.availability_zones.return_value = self.network_azs
|
|
89
|
+
self.volume_azs = volume_fakes.create_availability_zones(count=1)
|
|
103
90
|
self.volume_sdk_client.availability_zones.return_value = (
|
|
104
91
|
self.volume_azs
|
|
105
92
|
)
|
|
106
|
-
self.network_client.availability_zones.return_value = self.network_azs
|
|
107
93
|
|
|
108
94
|
# Get the command object to test
|
|
109
95
|
self.cmd = availability_zone.ListAvailabilityZone(self.app, None)
|
|
@@ -119,17 +105,17 @@ class TestAvailabilityZoneList(
|
|
|
119
105
|
columns, data = self.cmd.take_action(parsed_args)
|
|
120
106
|
|
|
121
107
|
self.compute_client.availability_zones.assert_called_with(details=True)
|
|
122
|
-
self.volume_sdk_client.availability_zones.assert_called_with()
|
|
123
108
|
self.network_client.availability_zones.assert_called_with()
|
|
109
|
+
self.volume_sdk_client.availability_zones.assert_called_with()
|
|
124
110
|
|
|
125
111
|
self.assertEqual(self.short_columnslist, columns)
|
|
126
112
|
datalist = ()
|
|
127
113
|
for compute_az in self.compute_azs:
|
|
128
114
|
datalist += _build_compute_az_datalist(compute_az)
|
|
129
|
-
for volume_az in self.volume_azs:
|
|
130
|
-
datalist += _build_volume_az_datalist(volume_az)
|
|
131
115
|
for network_az in self.network_azs:
|
|
132
116
|
datalist += _build_network_az_datalist(network_az)
|
|
117
|
+
for volume_az in self.volume_azs:
|
|
118
|
+
datalist += _build_volume_az_datalist(volume_az)
|
|
133
119
|
self.assertEqual(datalist, tuple(data))
|
|
134
120
|
|
|
135
121
|
def test_availability_zone_list_long(self):
|
|
@@ -147,8 +133,8 @@ class TestAvailabilityZoneList(
|
|
|
147
133
|
columns, data = self.cmd.take_action(parsed_args)
|
|
148
134
|
|
|
149
135
|
self.compute_client.availability_zones.assert_called_with(details=True)
|
|
150
|
-
self.volume_sdk_client.availability_zones.assert_called_with()
|
|
151
136
|
self.network_client.availability_zones.assert_called_with()
|
|
137
|
+
self.volume_sdk_client.availability_zones.assert_called_with()
|
|
152
138
|
|
|
153
139
|
self.assertEqual(self.long_columnslist, columns)
|
|
154
140
|
datalist = ()
|
|
@@ -156,14 +142,14 @@ class TestAvailabilityZoneList(
|
|
|
156
142
|
datalist += _build_compute_az_datalist(
|
|
157
143
|
compute_az, long_datalist=True
|
|
158
144
|
)
|
|
159
|
-
for volume_az in self.volume_azs:
|
|
160
|
-
datalist += _build_volume_az_datalist(
|
|
161
|
-
volume_az, long_datalist=True
|
|
162
|
-
)
|
|
163
145
|
for network_az in self.network_azs:
|
|
164
146
|
datalist += _build_network_az_datalist(
|
|
165
147
|
network_az, long_datalist=True
|
|
166
148
|
)
|
|
149
|
+
for volume_az in self.volume_azs:
|
|
150
|
+
datalist += _build_volume_az_datalist(
|
|
151
|
+
volume_az, long_datalist=True
|
|
152
|
+
)
|
|
167
153
|
self.assertEqual(datalist, tuple(data))
|
|
168
154
|
|
|
169
155
|
def test_availability_zone_list_compute(self):
|
|
@@ -181,8 +167,8 @@ class TestAvailabilityZoneList(
|
|
|
181
167
|
columns, data = self.cmd.take_action(parsed_args)
|
|
182
168
|
|
|
183
169
|
self.compute_client.availability_zones.assert_called_with(details=True)
|
|
184
|
-
self.volume_sdk_client.availability_zones.assert_not_called()
|
|
185
170
|
self.network_client.availability_zones.assert_not_called()
|
|
171
|
+
self.volume_sdk_client.availability_zones.assert_not_called()
|
|
186
172
|
|
|
187
173
|
self.assertEqual(self.short_columnslist, columns)
|
|
188
174
|
datalist = ()
|
|
@@ -190,12 +176,12 @@ class TestAvailabilityZoneList(
|
|
|
190
176
|
datalist += _build_compute_az_datalist(compute_az)
|
|
191
177
|
self.assertEqual(datalist, tuple(data))
|
|
192
178
|
|
|
193
|
-
def
|
|
179
|
+
def test_availability_zone_list_network(self):
|
|
194
180
|
arglist = [
|
|
195
|
-
'--
|
|
181
|
+
'--network',
|
|
196
182
|
]
|
|
197
183
|
verifylist = [
|
|
198
|
-
('
|
|
184
|
+
('network', True),
|
|
199
185
|
]
|
|
200
186
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
201
187
|
|
|
@@ -205,21 +191,21 @@ class TestAvailabilityZoneList(
|
|
|
205
191
|
columns, data = self.cmd.take_action(parsed_args)
|
|
206
192
|
|
|
207
193
|
self.compute_client.availability_zones.assert_not_called()
|
|
208
|
-
self.
|
|
209
|
-
self.
|
|
194
|
+
self.network_client.availability_zones.assert_called_with()
|
|
195
|
+
self.volume_sdk_client.availability_zones.assert_not_called()
|
|
210
196
|
|
|
211
197
|
self.assertEqual(self.short_columnslist, columns)
|
|
212
198
|
datalist = ()
|
|
213
|
-
for
|
|
214
|
-
datalist +=
|
|
199
|
+
for network_az in self.network_azs:
|
|
200
|
+
datalist += _build_network_az_datalist(network_az)
|
|
215
201
|
self.assertEqual(datalist, tuple(data))
|
|
216
202
|
|
|
217
|
-
def
|
|
203
|
+
def test_availability_zone_list_volume(self):
|
|
218
204
|
arglist = [
|
|
219
|
-
'--
|
|
205
|
+
'--volume',
|
|
220
206
|
]
|
|
221
207
|
verifylist = [
|
|
222
|
-
('
|
|
208
|
+
('volume', True),
|
|
223
209
|
]
|
|
224
210
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
225
211
|
|
|
@@ -229,11 +215,11 @@ class TestAvailabilityZoneList(
|
|
|
229
215
|
columns, data = self.cmd.take_action(parsed_args)
|
|
230
216
|
|
|
231
217
|
self.compute_client.availability_zones.assert_not_called()
|
|
232
|
-
self.
|
|
233
|
-
self.
|
|
218
|
+
self.network_client.availability_zones.assert_not_called()
|
|
219
|
+
self.volume_sdk_client.availability_zones.assert_called_with()
|
|
234
220
|
|
|
235
221
|
self.assertEqual(self.short_columnslist, columns)
|
|
236
222
|
datalist = ()
|
|
237
|
-
for
|
|
238
|
-
datalist +=
|
|
223
|
+
for volume_az in self.volume_azs:
|
|
224
|
+
datalist += _build_volume_az_datalist(volume_az)
|
|
239
225
|
self.assertEqual(datalist, tuple(data))
|
|
@@ -294,7 +294,7 @@ class TestExtensionShow(TestExtension):
|
|
|
294
294
|
|
|
295
295
|
self.cmd = extension.ShowExtension(self.app, None)
|
|
296
296
|
|
|
297
|
-
self.
|
|
297
|
+
self.network_client.find_extension.return_value = (
|
|
298
298
|
self.extension_details
|
|
299
299
|
)
|
|
300
300
|
|
|
@@ -322,7 +322,7 @@ class TestExtensionShow(TestExtension):
|
|
|
322
322
|
|
|
323
323
|
columns, data = self.cmd.take_action(parsed_args)
|
|
324
324
|
|
|
325
|
-
self.
|
|
325
|
+
self.network_client.find_extension.assert_called_with(
|
|
326
326
|
self.extension_details.alias, ignore_missing=False
|
|
327
327
|
)
|
|
328
328
|
|