python-openstackclient 9.0.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 +97 -99
- 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 +249 -169
- 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 +78 -47
- 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 +23 -11
- 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 +38 -16
- 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 +38 -16
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +43 -23
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +40 -16
- 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 -6
- 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 +74 -48
- 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_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/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 +11 -7
- 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 +6 -26
- 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 +11 -96
- 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_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- 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_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 +60 -3
- 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 +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +57 -29
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +46 -20
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +50 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- 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 +89 -39
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +53 -24
- 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 +69 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +271 -260
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +4 -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-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
from collections.abc import Iterable, Mapping, Sequence
|
|
13
14
|
import json
|
|
14
15
|
import logging
|
|
15
16
|
import os
|
|
16
17
|
import shlex
|
|
17
18
|
import subprocess
|
|
19
|
+
from typing import Any, Literal, cast, overload
|
|
18
20
|
|
|
19
21
|
from tempest.lib.cli import output_parser
|
|
20
22
|
from tempest.lib import exceptions
|
|
@@ -24,7 +26,7 @@ ADMIN_CLOUD = os.environ.get('OS_ADMIN_CLOUD', 'devstack-admin')
|
|
|
24
26
|
LOG = logging.getLogger(__name__)
|
|
25
27
|
|
|
26
28
|
|
|
27
|
-
def execute(cmd, *, fail_ok=False):
|
|
29
|
+
def execute(cmd: str, *, fail_ok: bool = False) -> str:
|
|
28
30
|
"""Executes specified command for the given action."""
|
|
29
31
|
LOG.debug('Executing: %s', cmd)
|
|
30
32
|
cmdlist = shlex.split(cmd)
|
|
@@ -53,15 +55,37 @@ def execute(cmd, *, fail_ok=False):
|
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
class TestCase(testtools.TestCase):
|
|
58
|
+
@overload
|
|
56
59
|
@classmethod
|
|
57
60
|
def openstack(
|
|
58
61
|
cls,
|
|
59
|
-
cmd,
|
|
62
|
+
cmd: str,
|
|
60
63
|
*,
|
|
61
|
-
cloud=ADMIN_CLOUD,
|
|
62
|
-
fail_ok=False,
|
|
63
|
-
parse_output=False,
|
|
64
|
-
):
|
|
64
|
+
cloud: str | None = ADMIN_CLOUD,
|
|
65
|
+
fail_ok: bool = False,
|
|
66
|
+
parse_output: Literal[False] = False,
|
|
67
|
+
) -> str: ...
|
|
68
|
+
|
|
69
|
+
@overload
|
|
70
|
+
@classmethod
|
|
71
|
+
def openstack(
|
|
72
|
+
cls,
|
|
73
|
+
cmd: str,
|
|
74
|
+
*,
|
|
75
|
+
cloud: str | None = ADMIN_CLOUD,
|
|
76
|
+
fail_ok: bool = False,
|
|
77
|
+
parse_output: Literal[True] = ...,
|
|
78
|
+
) -> Any: ...
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def openstack(
|
|
82
|
+
cls,
|
|
83
|
+
cmd: str,
|
|
84
|
+
*,
|
|
85
|
+
cloud: str | None = ADMIN_CLOUD,
|
|
86
|
+
fail_ok: bool = False,
|
|
87
|
+
parse_output: bool = False,
|
|
88
|
+
) -> str | Any:
|
|
65
89
|
"""Executes openstackclient command for the given action
|
|
66
90
|
|
|
67
91
|
:param cmd: A string representation of the command to execute.
|
|
@@ -92,7 +116,7 @@ class TestCase(testtools.TestCase):
|
|
|
92
116
|
format_args.append('-f json')
|
|
93
117
|
|
|
94
118
|
output = execute(
|
|
95
|
-
' '.join(['openstack'
|
|
119
|
+
' '.join(['openstack', *auth_args, cmd, *format_args]),
|
|
96
120
|
fail_ok=fail_ok,
|
|
97
121
|
)
|
|
98
122
|
|
|
@@ -106,7 +130,9 @@ class TestCase(testtools.TestCase):
|
|
|
106
130
|
return output
|
|
107
131
|
|
|
108
132
|
@classmethod
|
|
109
|
-
def is_service_enabled(
|
|
133
|
+
def is_service_enabled(
|
|
134
|
+
cls, service: str, version: str | None = None
|
|
135
|
+
) -> bool:
|
|
110
136
|
"""Ask client cloud if service is available
|
|
111
137
|
|
|
112
138
|
:param service: The service name or type. This should be either an
|
|
@@ -126,7 +152,9 @@ class TestCase(testtools.TestCase):
|
|
|
126
152
|
return bool(ret)
|
|
127
153
|
|
|
128
154
|
@classmethod
|
|
129
|
-
def is_extension_enabled(
|
|
155
|
+
def is_extension_enabled(
|
|
156
|
+
cls, alias: str, *, service: str = 'network'
|
|
157
|
+
) -> bool:
|
|
130
158
|
"""Ask client cloud if extension is enabled"""
|
|
131
159
|
extensions = cls.openstack(
|
|
132
160
|
f'extension list --{service}',
|
|
@@ -135,38 +163,44 @@ class TestCase(testtools.TestCase):
|
|
|
135
163
|
return alias in [x['Alias'] for x in extensions]
|
|
136
164
|
|
|
137
165
|
@classmethod
|
|
138
|
-
def get_openstack_configuration_value(cls, configuration):
|
|
166
|
+
def get_openstack_configuration_value(cls, configuration: str) -> str:
|
|
139
167
|
opts = cls.get_opts([configuration])
|
|
140
168
|
return cls.openstack('configuration show ' + opts)
|
|
141
169
|
|
|
142
170
|
@classmethod
|
|
143
|
-
def get_opts(cls, fields, output_format='value'):
|
|
171
|
+
def get_opts(cls, fields: list[str], output_format: str = 'value') -> str:
|
|
144
172
|
return ' -f {} {}'.format(
|
|
145
173
|
output_format, ' '.join(['-c ' + it for it in fields])
|
|
146
174
|
)
|
|
147
175
|
|
|
148
176
|
@classmethod
|
|
149
|
-
def assertOutput(cls, expected, actual):
|
|
177
|
+
def assertOutput(cls, expected: str, actual: str) -> None:
|
|
150
178
|
if expected != actual:
|
|
151
179
|
raise Exception(expected + ' != ' + actual)
|
|
152
180
|
|
|
153
181
|
@classmethod
|
|
154
|
-
def assertInOutput(cls, expected, actual):
|
|
182
|
+
def assertInOutput(cls, expected: str, actual: str) -> None:
|
|
155
183
|
if expected not in actual:
|
|
156
184
|
raise Exception(expected + ' not in ' + actual)
|
|
157
185
|
|
|
158
186
|
@classmethod
|
|
159
|
-
def assertsOutputNotNone(cls, observed):
|
|
187
|
+
def assertsOutputNotNone(cls, observed: Any) -> None:
|
|
160
188
|
if observed is None:
|
|
161
189
|
raise Exception('No output observed')
|
|
162
190
|
|
|
163
|
-
def assert_table_structure(
|
|
191
|
+
def assert_table_structure(
|
|
192
|
+
self, items: Iterable[Mapping[str, Any]], field_names: Sequence[str]
|
|
193
|
+
) -> None:
|
|
164
194
|
"""Verify that all items have keys listed in field_names."""
|
|
165
195
|
for item in items:
|
|
166
196
|
for field in field_names:
|
|
167
197
|
self.assertIn(field, item)
|
|
168
198
|
|
|
169
|
-
def assert_show_fields(
|
|
199
|
+
def assert_show_fields(
|
|
200
|
+
self,
|
|
201
|
+
show_output: Iterable[Mapping[str, Any]],
|
|
202
|
+
field_names: Sequence[str],
|
|
203
|
+
) -> None:
|
|
170
204
|
"""Verify that all items have keys listed in field_names."""
|
|
171
205
|
|
|
172
206
|
# field_names = ['name', 'description']
|
|
@@ -186,17 +220,18 @@ class TestCase(testtools.TestCase):
|
|
|
186
220
|
o.update(item)
|
|
187
221
|
return o
|
|
188
222
|
|
|
189
|
-
def parse_show(self, raw_output):
|
|
223
|
+
def parse_show(self, raw_output: str) -> list[dict[str, Any]]:
|
|
190
224
|
"""Return list of dicts with item values parsed from cli output."""
|
|
191
225
|
|
|
192
226
|
items = []
|
|
193
227
|
table_ = output_parser.table(raw_output)
|
|
194
228
|
for row in table_['values']:
|
|
195
229
|
item = {}
|
|
196
|
-
item[row[0]] = row[1]
|
|
230
|
+
item[str(row[0])] = row[1]
|
|
197
231
|
items.append(item)
|
|
198
232
|
return items
|
|
199
233
|
|
|
200
|
-
def parse_listing(self, raw_output):
|
|
234
|
+
def parse_listing(self, raw_output: str) -> list[dict[str, Any]]:
|
|
201
235
|
"""Return list of dicts with basic item parsed from cli output."""
|
|
202
|
-
|
|
236
|
+
# need to add hints to tempest
|
|
237
|
+
return cast(list[dict[str, Any]], output_parser.listing(raw_output))
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
# License for the specific language governing permissions and limitations
|
|
14
14
|
# under the License.
|
|
15
15
|
|
|
16
|
+
from typing import ClassVar
|
|
17
|
+
|
|
16
18
|
from tempest.lib import exceptions as tempest_exc
|
|
17
19
|
|
|
18
20
|
from openstackclient.tests.functional import base
|
|
@@ -21,6 +23,8 @@ from openstackclient.tests.functional import base
|
|
|
21
23
|
class ExtensionTests(base.TestCase):
|
|
22
24
|
"""Functional tests for extension"""
|
|
23
25
|
|
|
26
|
+
haz_network: ClassVar[bool]
|
|
27
|
+
|
|
24
28
|
@classmethod
|
|
25
29
|
def setUpClass(cls):
|
|
26
30
|
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 tempest.lib.common.utils import data_utils
|
|
@@ -25,7 +26,8 @@ class QuotaTests(base.TestCase):
|
|
|
25
26
|
test runs as these may run in parallel and otherwise step on each other.
|
|
26
27
|
"""
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
haz_network: ClassVar[bool]
|
|
30
|
+
PROJECT_NAME: ClassVar[str]
|
|
29
31
|
|
|
30
32
|
@classmethod
|
|
31
33
|
def setUpClass(cls):
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#
|
|
13
13
|
|
|
14
14
|
import time
|
|
15
|
+
from typing import cast
|
|
15
16
|
import uuid
|
|
16
17
|
|
|
17
18
|
from tempest.lib import exceptions
|
|
@@ -35,18 +36,18 @@ class ComputeTestCase(base.TestCase):
|
|
|
35
36
|
|
|
36
37
|
@classmethod
|
|
37
38
|
def get_flavor(cls) -> str:
|
|
39
|
+
valid_flavors = ['m1.tiny', 'cirros256']
|
|
38
40
|
# NOTE(rtheis): Get cirros256 or m1.tiny flavors since functional
|
|
39
41
|
# tests may create other flavors.
|
|
40
42
|
flavors = cls.openstack("flavor list", parse_output=True)
|
|
41
|
-
server_flavor = None
|
|
42
43
|
for flavor in flavors:
|
|
43
44
|
if flavor['Name'] in ['m1.tiny', 'cirros256']:
|
|
44
|
-
|
|
45
|
-
break
|
|
46
|
-
|
|
47
|
-
assert server_flavor is not None
|
|
45
|
+
return cast(str, flavor['Name'])
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
raise Exception(
|
|
48
|
+
f'Failed to find a suitable flavor. Required one of: '
|
|
49
|
+
f'{", ".join(valid_flavors)}'
|
|
50
|
+
)
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def get_image(cls) -> str:
|
|
@@ -54,18 +55,17 @@ class ComputeTestCase(base.TestCase):
|
|
|
54
55
|
# create other images. Image may be named '-uec' or
|
|
55
56
|
# '-disk'.
|
|
56
57
|
images = cls.openstack("image list", parse_output=True)
|
|
57
|
-
server_image = None
|
|
58
58
|
for image in images:
|
|
59
59
|
if image['Name'].startswith('cirros-') and (
|
|
60
60
|
image['Name'].endswith('-uec')
|
|
61
61
|
or image['Name'].endswith('-disk')
|
|
62
62
|
):
|
|
63
|
-
|
|
64
|
-
break
|
|
63
|
+
return cast(str, image['Name'])
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
raise Exception(
|
|
66
|
+
'Failed to find a suitable image. Required one matching one of '
|
|
67
|
+
'the following patterns: cirros-*-uec, cirros-*-disk'
|
|
68
|
+
)
|
|
69
69
|
|
|
70
70
|
@classmethod
|
|
71
71
|
def get_network(cls) -> str:
|
|
@@ -78,7 +78,8 @@ class ComputeTestCase(base.TestCase):
|
|
|
78
78
|
)
|
|
79
79
|
except exceptions.CommandFailed:
|
|
80
80
|
return ''
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
return '='.join(('--nic net-id', cmd_output['id']))
|
|
82
83
|
|
|
83
84
|
def server_create(self, name=None, cleanup=True):
|
|
84
85
|
"""Create server, with cleanup"""
|
|
@@ -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 import base
|
|
@@ -19,6 +20,7 @@ class FlavorTests(base.TestCase):
|
|
|
19
20
|
"""Functional tests for flavor."""
|
|
20
21
|
|
|
21
22
|
PROJECT_NAME = uuid.uuid4().hex
|
|
23
|
+
PROJECT_ID: ClassVar[str]
|
|
22
24
|
|
|
23
25
|
@classmethod
|
|
24
26
|
def setUpClass(cls):
|
|
@@ -28,7 +30,7 @@ class FlavorTests(base.TestCase):
|
|
|
28
30
|
"project create --enable " + cls.PROJECT_NAME,
|
|
29
31
|
parse_output=True,
|
|
30
32
|
)
|
|
31
|
-
cls.
|
|
33
|
+
cls.PROJECT_ID = cmd_output["id"]
|
|
32
34
|
|
|
33
35
|
@classmethod
|
|
34
36
|
def tearDownClass(cls):
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import itertools
|
|
14
14
|
import json
|
|
15
15
|
import time
|
|
16
|
+
from typing import ClassVar
|
|
16
17
|
import uuid
|
|
17
18
|
|
|
18
19
|
from tempest.lib import exceptions
|
|
@@ -25,6 +26,8 @@ from openstackclient.tests.functional.volume.v2 import common as volume_common
|
|
|
25
26
|
class ServerTests(common.ComputeTestCase):
|
|
26
27
|
"""Functional tests for openstack server commands"""
|
|
27
28
|
|
|
29
|
+
haz_network: ClassVar[bool]
|
|
30
|
+
|
|
28
31
|
@classmethod
|
|
29
32
|
def setUpClass(cls):
|
|
30
33
|
super().setUpClass()
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
13
|
import os
|
|
14
|
+
from typing import ClassVar
|
|
14
15
|
import unittest
|
|
15
16
|
|
|
16
17
|
import fixtures
|
|
@@ -57,19 +58,22 @@ class IdentityTests(base.TestCase):
|
|
|
57
58
|
CATALOG_LIST_HEADERS = ['Name', 'Type', 'Endpoints']
|
|
58
59
|
ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type']
|
|
59
60
|
|
|
61
|
+
PROJECT_NAME: ClassVar[str]
|
|
62
|
+
PROJECT_DESCRIPTION: ClassVar[str]
|
|
63
|
+
|
|
60
64
|
@classmethod
|
|
61
65
|
def setUpClass(cls):
|
|
62
66
|
super().setUpClass()
|
|
63
67
|
# create dummy project
|
|
64
|
-
cls.
|
|
65
|
-
cls.
|
|
68
|
+
cls.PROJECT_NAME = data_utils.rand_name('TestProject')
|
|
69
|
+
cls.PROJECT_DESCRIPTION = data_utils.rand_name('description')
|
|
66
70
|
try:
|
|
67
71
|
cls.openstack(
|
|
68
72
|
'--os-identity-api-version 2 '
|
|
69
73
|
'project create '
|
|
70
|
-
f'--description {cls.
|
|
74
|
+
f'--description {cls.PROJECT_DESCRIPTION} '
|
|
71
75
|
'--enable '
|
|
72
|
-
f'{cls.
|
|
76
|
+
f'{cls.PROJECT_NAME}'
|
|
73
77
|
)
|
|
74
78
|
except tempest_exceptions.CommandFailed:
|
|
75
79
|
# Good chance this is due to Identity v2 admin not being enabled
|
|
@@ -83,7 +87,7 @@ class IdentityTests(base.TestCase):
|
|
|
83
87
|
try:
|
|
84
88
|
cls.openstack(
|
|
85
89
|
'--os-identity-api-version 2 '
|
|
86
|
-
f'project delete {cls.
|
|
90
|
+
f'project delete {cls.PROJECT_NAME}'
|
|
87
91
|
)
|
|
88
92
|
finally:
|
|
89
93
|
super().tearDownClass()
|
|
@@ -125,7 +129,7 @@ class IdentityTests(base.TestCase):
|
|
|
125
129
|
email = data_utils.rand_name() + '@example.com'
|
|
126
130
|
raw_output = self.openstack(
|
|
127
131
|
'user create '
|
|
128
|
-
f'--project {self.
|
|
132
|
+
f'--project {self.PROJECT_NAME} '
|
|
129
133
|
f'--password {password} '
|
|
130
134
|
f'--email {email} '
|
|
131
135
|
'--enable '
|
|
@@ -39,14 +39,14 @@ class RoleTests(common.IdentityTests):
|
|
|
39
39
|
username = self._create_dummy_user()
|
|
40
40
|
raw_output = self.openstack(
|
|
41
41
|
'role add '
|
|
42
|
-
f'--project {self.
|
|
42
|
+
f'--project {self.PROJECT_NAME} '
|
|
43
43
|
f'--user {username} '
|
|
44
44
|
f'{role_name}'
|
|
45
45
|
)
|
|
46
46
|
self.addCleanup(
|
|
47
47
|
self.openstack,
|
|
48
48
|
'role remove '
|
|
49
|
-
f'--project {self.
|
|
49
|
+
f'--project {self.PROJECT_NAME} '
|
|
50
50
|
f'--user {username} '
|
|
51
51
|
f'{role_name}',
|
|
52
52
|
)
|
|
@@ -58,13 +58,13 @@ class RoleTests(common.IdentityTests):
|
|
|
58
58
|
username = self._create_dummy_user()
|
|
59
59
|
add_raw_output = self.openstack(
|
|
60
60
|
'role add '
|
|
61
|
-
f'--project {self.
|
|
61
|
+
f'--project {self.PROJECT_NAME} '
|
|
62
62
|
f'--user {username} '
|
|
63
63
|
f'{role_name}'
|
|
64
64
|
)
|
|
65
65
|
del_raw_output = self.openstack(
|
|
66
66
|
'role remove '
|
|
67
|
-
f'--project {self.
|
|
67
|
+
f'--project {self.PROJECT_NAME} '
|
|
68
68
|
f'--user {username} '
|
|
69
69
|
f'{role_name}'
|
|
70
70
|
)
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
13
|
import os
|
|
14
|
+
from typing import ClassVar
|
|
14
15
|
|
|
15
16
|
import fixtures
|
|
16
17
|
from tempest.lib.common.utils import data_utils
|
|
@@ -147,30 +148,35 @@ class IdentityTests(base.TestCase):
|
|
|
147
148
|
'Region ID',
|
|
148
149
|
]
|
|
149
150
|
|
|
151
|
+
DOMAIN_NAME: ClassVar[str]
|
|
152
|
+
DOMAIN_DESCRIPTION: ClassVar[str]
|
|
153
|
+
PROJECT_NAME: ClassVar[str]
|
|
154
|
+
PROJECT_DESCRIPTION: ClassVar[str]
|
|
155
|
+
|
|
150
156
|
@classmethod
|
|
151
157
|
def setUpClass(cls):
|
|
152
158
|
super().setUpClass()
|
|
153
159
|
# create dummy domain
|
|
154
|
-
cls.
|
|
155
|
-
cls.
|
|
160
|
+
cls.DOMAIN_NAME = data_utils.rand_name('TestDomain')
|
|
161
|
+
cls.DOMAIN_DESCRIPTION = data_utils.rand_name('description')
|
|
156
162
|
cls.openstack(
|
|
157
163
|
'--os-identity-api-version 3 '
|
|
158
164
|
'domain create '
|
|
159
|
-
f'--description {cls.
|
|
165
|
+
f'--description {cls.DOMAIN_DESCRIPTION} '
|
|
160
166
|
'--enable '
|
|
161
|
-
f'{cls.
|
|
167
|
+
f'{cls.DOMAIN_NAME}'
|
|
162
168
|
)
|
|
163
169
|
|
|
164
170
|
# create dummy project
|
|
165
|
-
cls.
|
|
166
|
-
cls.
|
|
171
|
+
cls.PROJECT_NAME = data_utils.rand_name('TestProject')
|
|
172
|
+
cls.PROJECT_DESCRIPTION = data_utils.rand_name('description')
|
|
167
173
|
cls.openstack(
|
|
168
174
|
'--os-identity-api-version 3 '
|
|
169
175
|
'project create '
|
|
170
|
-
f'--domain {cls.
|
|
171
|
-
f'--description {cls.
|
|
176
|
+
f'--domain {cls.DOMAIN_NAME} '
|
|
177
|
+
f'--description {cls.PROJECT_DESCRIPTION} '
|
|
172
178
|
'--enable '
|
|
173
|
-
f'{cls.
|
|
179
|
+
f'{cls.PROJECT_NAME}'
|
|
174
180
|
)
|
|
175
181
|
|
|
176
182
|
@classmethod
|
|
@@ -179,15 +185,15 @@ class IdentityTests(base.TestCase):
|
|
|
179
185
|
# delete dummy project
|
|
180
186
|
cls.openstack(
|
|
181
187
|
'--os-identity-api-version 3 '
|
|
182
|
-
f'project delete {cls.
|
|
188
|
+
f'project delete {cls.PROJECT_NAME}'
|
|
183
189
|
)
|
|
184
190
|
# disable and delete dummy domain
|
|
185
191
|
cls.openstack(
|
|
186
192
|
'--os-identity-api-version 3 '
|
|
187
|
-
f'domain set --disable {cls.
|
|
193
|
+
f'domain set --disable {cls.DOMAIN_NAME}'
|
|
188
194
|
)
|
|
189
195
|
cls.openstack(
|
|
190
|
-
f'--os-identity-api-version 3 domain delete {cls.
|
|
196
|
+
f'--os-identity-api-version 3 domain delete {cls.DOMAIN_NAME}'
|
|
191
197
|
)
|
|
192
198
|
finally:
|
|
193
199
|
super().tearDownClass()
|
|
@@ -213,9 +219,9 @@ class IdentityTests(base.TestCase):
|
|
|
213
219
|
description = data_utils.rand_name('description')
|
|
214
220
|
raw_output = self.openstack(
|
|
215
221
|
'user create '
|
|
216
|
-
f'--domain {self.
|
|
217
|
-
f'--project {self.
|
|
218
|
-
f'--project-domain {self.
|
|
222
|
+
f'--domain {self.DOMAIN_NAME} '
|
|
223
|
+
f'--project {self.PROJECT_NAME} '
|
|
224
|
+
f'--project-domain {self.DOMAIN_NAME} '
|
|
219
225
|
f'--password {password} '
|
|
220
226
|
f'--email {email} '
|
|
221
227
|
f'--description {description} '
|
|
@@ -262,14 +268,14 @@ class IdentityTests(base.TestCase):
|
|
|
262
268
|
description = data_utils.rand_name('description')
|
|
263
269
|
raw_output = self.openstack(
|
|
264
270
|
'group create '
|
|
265
|
-
f'--domain {self.
|
|
271
|
+
f'--domain {self.DOMAIN_NAME} '
|
|
266
272
|
f'--description {description} '
|
|
267
273
|
f'{group_name}'
|
|
268
274
|
)
|
|
269
275
|
if add_clean_up:
|
|
270
276
|
self.addCleanup(
|
|
271
277
|
self.openstack,
|
|
272
|
-
f'group delete --domain {self.
|
|
278
|
+
f'group delete --domain {self.DOMAIN_NAME} {group_name}',
|
|
273
279
|
)
|
|
274
280
|
items = self.parse_show(raw_output)
|
|
275
281
|
self.assert_show_fields(items, self.GROUP_FIELDS)
|
|
@@ -295,14 +301,14 @@ class IdentityTests(base.TestCase):
|
|
|
295
301
|
project_description = data_utils.rand_name('description')
|
|
296
302
|
self.openstack(
|
|
297
303
|
'project create '
|
|
298
|
-
f'--domain {self.
|
|
304
|
+
f'--domain {self.DOMAIN_NAME} '
|
|
299
305
|
f'--description {project_description} '
|
|
300
306
|
f'--enable {project_name}'
|
|
301
307
|
)
|
|
302
308
|
if add_clean_up:
|
|
303
309
|
self.addCleanup(
|
|
304
310
|
self.openstack,
|
|
305
|
-
f'project delete --domain {self.
|
|
311
|
+
f'project delete --domain {self.DOMAIN_NAME} {project_name}',
|
|
306
312
|
)
|
|
307
313
|
return project_name
|
|
308
314
|
|
|
@@ -28,7 +28,7 @@ class GroupTests(common.IdentityTests):
|
|
|
28
28
|
|
|
29
29
|
def test_group_list_with_domain(self):
|
|
30
30
|
group_name = self._create_dummy_group()
|
|
31
|
-
raw_output = self.openstack(f'group list --domain {self.
|
|
31
|
+
raw_output = self.openstack(f'group list --domain {self.DOMAIN_NAME}')
|
|
32
32
|
items = self.parse_listing(raw_output)
|
|
33
33
|
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
|
|
34
34
|
self.assertIn(group_name, raw_output)
|
|
@@ -36,14 +36,14 @@ class GroupTests(common.IdentityTests):
|
|
|
36
36
|
def test_group_delete(self):
|
|
37
37
|
group_name = self._create_dummy_group(add_clean_up=False)
|
|
38
38
|
raw_output = self.openstack(
|
|
39
|
-
f'group delete --domain {self.
|
|
39
|
+
f'group delete --domain {self.DOMAIN_NAME} {group_name}'
|
|
40
40
|
)
|
|
41
41
|
self.assertEqual(0, len(raw_output))
|
|
42
42
|
|
|
43
43
|
def test_group_show(self):
|
|
44
44
|
group_name = self._create_dummy_group()
|
|
45
45
|
raw_output = self.openstack(
|
|
46
|
-
f'group show --domain {self.
|
|
46
|
+
f'group show --domain {self.DOMAIN_NAME} {group_name}'
|
|
47
47
|
)
|
|
48
48
|
items = self.parse_show(raw_output)
|
|
49
49
|
self.assert_show_fields(items, self.GROUP_FIELDS)
|
|
@@ -53,20 +53,20 @@ class GroupTests(common.IdentityTests):
|
|
|
53
53
|
new_group_name = data_utils.rand_name('NewTestGroup')
|
|
54
54
|
raw_output = self.openstack(
|
|
55
55
|
'group set '
|
|
56
|
-
f'--domain {self.
|
|
56
|
+
f'--domain {self.DOMAIN_NAME} '
|
|
57
57
|
f'--name {new_group_name} '
|
|
58
58
|
f'{group_name}'
|
|
59
59
|
)
|
|
60
60
|
self.assertEqual(0, len(raw_output))
|
|
61
61
|
raw_output = self.openstack(
|
|
62
|
-
f'group show --domain {self.
|
|
62
|
+
f'group show --domain {self.DOMAIN_NAME} {new_group_name}'
|
|
63
63
|
)
|
|
64
64
|
group = self.parse_show_as_object(raw_output)
|
|
65
65
|
self.assertEqual(new_group_name, group['name'])
|
|
66
66
|
# reset group name to make sure it will be cleaned up
|
|
67
67
|
raw_output = self.openstack(
|
|
68
68
|
'group set '
|
|
69
|
-
f'--domain {self.
|
|
69
|
+
f'--domain {self.DOMAIN_NAME} '
|
|
70
70
|
f'--name {group_name} '
|
|
71
71
|
f'{new_group_name}'
|
|
72
72
|
)
|
|
@@ -77,15 +77,15 @@ class GroupTests(common.IdentityTests):
|
|
|
77
77
|
username = self._create_dummy_user()
|
|
78
78
|
raw_output = self.openstack(
|
|
79
79
|
'group add user '
|
|
80
|
-
f'--group-domain {self.
|
|
81
|
-
f'--user-domain {self.
|
|
80
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
81
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
82
82
|
f'{group_name} {username}'
|
|
83
83
|
)
|
|
84
84
|
self.addCleanup(
|
|
85
85
|
self.openstack,
|
|
86
86
|
'group remove user '
|
|
87
|
-
f'--group-domain {self.
|
|
88
|
-
f'--user-domain {self.
|
|
87
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
88
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
89
89
|
f'{group_name} {username}',
|
|
90
90
|
)
|
|
91
91
|
self.assertOutput('', raw_output)
|
|
@@ -95,22 +95,22 @@ class GroupTests(common.IdentityTests):
|
|
|
95
95
|
username = self._create_dummy_user()
|
|
96
96
|
raw_output = self.openstack(
|
|
97
97
|
'group add user '
|
|
98
|
-
f'--group-domain {self.
|
|
99
|
-
f'--user-domain {self.
|
|
98
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
99
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
100
100
|
f'{group_name} {username}'
|
|
101
101
|
)
|
|
102
102
|
self.addCleanup(
|
|
103
103
|
self.openstack,
|
|
104
104
|
'group remove user '
|
|
105
|
-
f'--group-domain {self.
|
|
106
|
-
f'--user-domain {self.
|
|
105
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
106
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
107
107
|
f'{group_name} {username}',
|
|
108
108
|
)
|
|
109
109
|
self.assertOutput('', raw_output)
|
|
110
110
|
raw_output = self.openstack(
|
|
111
111
|
'group contains user '
|
|
112
|
-
f'--group-domain {self.
|
|
113
|
-
f'--user-domain {self.
|
|
112
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
113
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
114
114
|
f'{group_name} {username}'
|
|
115
115
|
)
|
|
116
116
|
self.assertEqual(
|
|
@@ -123,14 +123,14 @@ class GroupTests(common.IdentityTests):
|
|
|
123
123
|
username = self._create_dummy_user()
|
|
124
124
|
add_raw_output = self.openstack(
|
|
125
125
|
'group add user '
|
|
126
|
-
f'--group-domain {self.
|
|
127
|
-
f'--user-domain {self.
|
|
126
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
127
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
128
128
|
f'{group_name} {username}'
|
|
129
129
|
)
|
|
130
130
|
remove_raw_output = self.openstack(
|
|
131
131
|
'group remove user '
|
|
132
|
-
f'--group-domain {self.
|
|
133
|
-
f'--user-domain {self.
|
|
132
|
+
f'--group-domain {self.DOMAIN_NAME} '
|
|
133
|
+
f'--user-domain {self.DOMAIN_NAME} '
|
|
134
134
|
f'{group_name} {username}'
|
|
135
135
|
)
|
|
136
136
|
self.assertOutput('', add_raw_output)
|
|
@@ -56,7 +56,9 @@ class IdentityProviderTests(common.IdentityTests):
|
|
|
56
56
|
raw_output = self.openstack(
|
|
57
57
|
f'identity provider set '
|
|
58
58
|
f'{identity_provider} '
|
|
59
|
-
f'--
|
|
59
|
+
f'--authorization-ttl 7 '
|
|
60
|
+
f'--remote-id {new_remoteid} '
|
|
61
|
+
f'--remote-id {new_remoteid + "2nd"}'
|
|
60
62
|
)
|
|
61
63
|
self.assertEqual(0, len(raw_output))
|
|
62
64
|
raw_output = self.openstack(
|