python-openstackclient 7.3.1__py3-none-any.whl → 8.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/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 +2 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +3 -4
- 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 +8 -10
- openstackclient/compute/v2/server.py +70 -112
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +7 -16
- 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 +16 -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/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +8 -9
- openstackclient/identity/v3/domain.py +1 -1
- 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 +3 -4
- 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 +6 -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 +9 -6
- openstackclient/image/client.py +2 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +30 -37
- 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 -10
- 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 +14 -21
- 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 +4 -5
- 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 +42 -31
- openstackclient/network/v2/router.py +55 -41
- openstackclient/network/v2/security_group.py +8 -15
- openstackclient/network/v2/security_group_rule.py +9 -10
- 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 +2 -2
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- 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 +4 -10
- 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 +16 -16
- openstackclient/tests/unit/compute/v2/test_flavor.py +71 -71
- 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 +24 -24
- openstackclient/tests/unit/compute/v2/test_server.py +524 -560
- openstackclient/tests/unit/compute/v2/test_server_backup.py +5 -7
- openstackclient/tests/unit/compute/v2/test_server_event.py +16 -18
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +6 -8
- openstackclient/tests/unit/compute/v2/test_server_migration.py +37 -37
- 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 +1 -1
- openstackclient/tests/unit/identity/v3/test_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +16 -0
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v2/test_image.py +39 -1
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +49 -35
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +33 -5
- openstackclient/tests/unit/network/v2/test_router.py +120 -7
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +14 -14
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- openstackclient/tests/unit/volume/v2/test_volume.py +1 -1
- 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_volume.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -3
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +1 -2
- 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/volume.py +8 -16
- openstackclient/volume/v2/volume_backup.py +6 -7
- openstackclient/volume/v2/volume_snapshot.py +8 -9
- 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_manage.py +1 -3
- openstackclient/volume/v3/volume.py +18 -19
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +7 -8
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +4 -3
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/AUTHORS +4 -0
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/METADATA +7 -13
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/RECORD +210 -233
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/entry_points.txt +0 -41
- python_openstackclient-8.0.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.3.1.dist-info/pbr.json +0 -1
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.3.1.dist-info → python_openstackclient-8.0.0.dist-info}/top_level.txt +0 -0
|
@@ -22,7 +22,7 @@ class UserTests(common.IdentityTests):
|
|
|
22
22
|
def test_user_delete(self):
|
|
23
23
|
username = self._create_dummy_user(add_clean_up=False)
|
|
24
24
|
raw_output = self.openstack(
|
|
25
|
-
'user delete
|
|
25
|
+
f'user delete --domain {self.domain_name} {username}'
|
|
26
26
|
)
|
|
27
27
|
self.assertEqual(0, len(raw_output))
|
|
28
28
|
|
|
@@ -34,19 +34,19 @@ class UserTests(common.IdentityTests):
|
|
|
34
34
|
def test_user_set(self):
|
|
35
35
|
username = self._create_dummy_user()
|
|
36
36
|
raw_output = self.openstack(
|
|
37
|
-
'user show
|
|
37
|
+
f'user show --domain {self.domain_name} {username}'
|
|
38
38
|
)
|
|
39
39
|
user = self.parse_show_as_object(raw_output)
|
|
40
40
|
new_username = data_utils.rand_name('NewTestUser')
|
|
41
41
|
new_email = data_utils.rand_name() + '@example.com'
|
|
42
42
|
raw_output = self.openstack(
|
|
43
|
-
'user set
|
|
43
|
+
'user set --email {email} --name {new_name} {id}'.format(
|
|
44
44
|
email=new_email, new_name=new_username, id=user['id']
|
|
45
45
|
)
|
|
46
46
|
)
|
|
47
47
|
self.assertEqual(0, len(raw_output))
|
|
48
48
|
raw_output = self.openstack(
|
|
49
|
-
'user show
|
|
49
|
+
f'user show --domain {self.domain_name} {new_username}'
|
|
50
50
|
)
|
|
51
51
|
updated_user = self.parse_show_as_object(raw_output)
|
|
52
52
|
self.assertEqual(user['id'], updated_user['id'])
|
|
@@ -57,7 +57,7 @@ class UserTests(common.IdentityTests):
|
|
|
57
57
|
project_name = self._create_dummy_project()
|
|
58
58
|
# get original user details
|
|
59
59
|
raw_output = self.openstack(
|
|
60
|
-
'user show
|
|
60
|
+
f'user show --domain {self.domain_name} {username}'
|
|
61
61
|
)
|
|
62
62
|
user = self.parse_show_as_object(raw_output)
|
|
63
63
|
# update user
|
|
@@ -74,12 +74,12 @@ class UserTests(common.IdentityTests):
|
|
|
74
74
|
self.assertEqual(0, len(raw_output))
|
|
75
75
|
# get updated user details
|
|
76
76
|
raw_output = self.openstack(
|
|
77
|
-
'user show
|
|
77
|
+
f'user show --domain {self.domain_name} {username}'
|
|
78
78
|
)
|
|
79
79
|
updated_user = self.parse_show_as_object(raw_output)
|
|
80
80
|
# get project details
|
|
81
81
|
raw_output = self.openstack(
|
|
82
|
-
'project show
|
|
82
|
+
f'project show --domain {self.domain_name} {project_name}'
|
|
83
83
|
)
|
|
84
84
|
project = self.parse_show_as_object(raw_output)
|
|
85
85
|
# check updated user details
|
|
@@ -89,7 +89,7 @@ class UserTests(common.IdentityTests):
|
|
|
89
89
|
def test_user_show(self):
|
|
90
90
|
username = self._create_dummy_user()
|
|
91
91
|
raw_output = self.openstack(
|
|
92
|
-
'user show
|
|
92
|
+
f'user show --domain {self.domain_name} {username}'
|
|
93
93
|
)
|
|
94
94
|
items = self.parse_show(raw_output)
|
|
95
95
|
self.assert_show_fields(items, self.USER_FIELDS)
|
|
@@ -33,7 +33,7 @@ class NetworkTests(base.TestCase):
|
|
|
33
33
|
class NetworkTagTests(NetworkTests):
|
|
34
34
|
"""Functional tests with tag operation"""
|
|
35
35
|
|
|
36
|
-
base_command
|
|
36
|
+
base_command: str
|
|
37
37
|
|
|
38
38
|
def test_tag_operation(self):
|
|
39
39
|
# Get project IDs
|
|
@@ -56,7 +56,7 @@ class NetworkTagTests(NetworkTests):
|
|
|
56
56
|
'set', name1, '--tag red --tag green', ['red', 'green']
|
|
57
57
|
)
|
|
58
58
|
|
|
59
|
-
list_expected = (
|
|
59
|
+
list_expected: tuple[tuple[str, list[str]], ...] = (
|
|
60
60
|
(name1, ['red', 'green']),
|
|
61
61
|
(name2, ['red', 'blue']),
|
|
62
62
|
(name3, []),
|
|
@@ -93,7 +93,11 @@ class NetworkTagTests(NetworkTests):
|
|
|
93
93
|
parse_output=True,
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
def _create_resource_and_tag_check(
|
|
96
|
+
def _create_resource_and_tag_check(
|
|
97
|
+
self,
|
|
98
|
+
args: str,
|
|
99
|
+
expected: list[str],
|
|
100
|
+
) -> str:
|
|
97
101
|
name = uuid.uuid4().hex
|
|
98
102
|
cmd_output = self._create_resource_for_tag_test(name, args)
|
|
99
103
|
self.addCleanup(self.openstack, f'{self.base_command} delete {name}')
|
|
@@ -75,6 +75,10 @@ class AddressGroupTests(common.NetworkTests):
|
|
|
75
75
|
self.assertNotEqual(admin_project_id, demo_project_id)
|
|
76
76
|
self.assertEqual(admin_project_id, auth_project_id)
|
|
77
77
|
|
|
78
|
+
# type narrow
|
|
79
|
+
assert admin_project_id is not None
|
|
80
|
+
assert demo_project_id is not None
|
|
81
|
+
|
|
78
82
|
name1 = uuid.uuid4().hex
|
|
79
83
|
cmd_output = self.openstack(
|
|
80
84
|
'address group create ' + name1,
|
|
@@ -69,8 +69,7 @@ class L3ConntrackHelperTests(common.NetworkTests):
|
|
|
69
69
|
ct_ids = " ".join([ct['id'] for ct in created_helpers])
|
|
70
70
|
|
|
71
71
|
raw_output = self.openstack(
|
|
72
|
-
f'--debug network l3 conntrack helper delete {router_id} '
|
|
73
|
-
f'{ct_ids}'
|
|
72
|
+
f'--debug network l3 conntrack helper delete {router_id} {ct_ids}'
|
|
74
73
|
)
|
|
75
74
|
self.assertOutput('', raw_output)
|
|
76
75
|
|
|
@@ -95,9 +94,14 @@ class L3ConntrackHelperTests(common.NetworkTests):
|
|
|
95
94
|
self.assertIn(ct, expected_helpers)
|
|
96
95
|
|
|
97
96
|
def test_l3_conntrack_helper_set_and_show(self):
|
|
98
|
-
helper =
|
|
97
|
+
helper = 'tftp'
|
|
98
|
+
proto = 'udp'
|
|
99
|
+
port = 69
|
|
99
100
|
router_id = self._create_router()
|
|
100
|
-
created_helper = self._create_helpers(
|
|
101
|
+
created_helper = self._create_helpers(
|
|
102
|
+
router_id,
|
|
103
|
+
[{'helper': helper, 'protocol': proto, 'port': port}],
|
|
104
|
+
)[0]
|
|
101
105
|
output = self.openstack(
|
|
102
106
|
'network l3 conntrack helper show {router_id} {ct_id} '
|
|
103
107
|
'-f json'.format(
|
|
@@ -106,16 +110,16 @@ class L3ConntrackHelperTests(common.NetworkTests):
|
|
|
106
110
|
),
|
|
107
111
|
parse_output=True,
|
|
108
112
|
)
|
|
109
|
-
self.assertEqual(
|
|
110
|
-
self.assertEqual(helper
|
|
111
|
-
self.assertEqual(
|
|
113
|
+
self.assertEqual(port, output['port'])
|
|
114
|
+
self.assertEqual(helper, output['helper'])
|
|
115
|
+
self.assertEqual(proto, output['protocol'])
|
|
112
116
|
|
|
113
117
|
raw_output = self.openstack(
|
|
114
118
|
'network l3 conntrack helper set {router_id} {ct_id} '
|
|
115
119
|
'--port {port} '.format(
|
|
116
120
|
router_id=router_id,
|
|
117
121
|
ct_id=created_helper['id'],
|
|
118
|
-
port=
|
|
122
|
+
port=port + 1,
|
|
119
123
|
)
|
|
120
124
|
)
|
|
121
125
|
self.assertOutput('', raw_output)
|
|
@@ -128,6 +132,6 @@ class L3ConntrackHelperTests(common.NetworkTests):
|
|
|
128
132
|
),
|
|
129
133
|
parse_output=True,
|
|
130
134
|
)
|
|
131
|
-
self.assertEqual(
|
|
132
|
-
self.assertEqual(helper
|
|
133
|
-
self.assertEqual(
|
|
135
|
+
self.assertEqual(port + 1, output['port'])
|
|
136
|
+
self.assertEqual(helper, output['helper'])
|
|
137
|
+
self.assertEqual(proto, output['protocol'])
|
|
@@ -77,6 +77,10 @@ class LocalIPTests(common.NetworkTests):
|
|
|
77
77
|
self.assertNotEqual(admin_project_id, demo_project_id)
|
|
78
78
|
self.assertEqual(admin_project_id, auth_project_id)
|
|
79
79
|
|
|
80
|
+
# type narrow
|
|
81
|
+
assert admin_project_id is not None
|
|
82
|
+
assert demo_project_id is not None
|
|
83
|
+
|
|
80
84
|
name1 = uuid.uuid4().hex
|
|
81
85
|
cmd_output = self.openstack(
|
|
82
86
|
'local ip create ' + name1,
|
|
@@ -22,8 +22,8 @@ from openstackclient.tests.functional.network.v2 import common
|
|
|
22
22
|
class TestMeterRule(common.NetworkTests):
|
|
23
23
|
"""Functional tests for meter rule"""
|
|
24
24
|
|
|
25
|
-
METER_ID
|
|
26
|
-
METER_RULE_ID
|
|
25
|
+
METER_ID: str
|
|
26
|
+
METER_RULE_ID: str
|
|
27
27
|
|
|
28
28
|
@classmethod
|
|
29
29
|
def setUpClass(cls):
|
|
@@ -31,7 +31,7 @@ class L3NDPProxyTests(common.NetworkTests):
|
|
|
31
31
|
self.created_ndp_proxies = []
|
|
32
32
|
|
|
33
33
|
json_output = self.openstack(
|
|
34
|
-
'address scope create --ip-version 6
|
|
34
|
+
f'address scope create --ip-version 6 {self.ADDR_SCOPE_NAME}',
|
|
35
35
|
parse_output=True,
|
|
36
36
|
)
|
|
37
37
|
self.assertIsNotNone(json_output['id'])
|
|
@@ -88,8 +88,7 @@ class L3NDPProxyTests(common.NetworkTests):
|
|
|
88
88
|
self.assertIsNotNone(json_output['id'])
|
|
89
89
|
self.INT_SUB_ID = json_output['id']
|
|
90
90
|
json_output = self.openstack(
|
|
91
|
-
f'port create --network {self.INT_NET_ID} '
|
|
92
|
-
f'{self.INT_PORT_NAME}',
|
|
91
|
+
f'port create --network {self.INT_NET_ID} {self.INT_PORT_NAME}',
|
|
93
92
|
parse_output=True,
|
|
94
93
|
)
|
|
95
94
|
self.assertIsNotNone(json_output['id'])
|
|
@@ -18,8 +18,8 @@ from openstackclient.tests.functional.network.v2 import common
|
|
|
18
18
|
class NetworkRBACTests(common.NetworkTests):
|
|
19
19
|
"""Functional tests for network rbac"""
|
|
20
20
|
|
|
21
|
-
OBJECT_ID
|
|
22
|
-
ID
|
|
21
|
+
OBJECT_ID: str
|
|
22
|
+
ID: str
|
|
23
23
|
HEADERS = ['ID']
|
|
24
24
|
FIELDS = ['id']
|
|
25
25
|
|
|
@@ -80,7 +80,7 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
80
80
|
self.addCleanup(self.openstack, 'network trunk delete ' + trunk_name)
|
|
81
81
|
self.assertEqual(trunk_name, json_output['name'])
|
|
82
82
|
|
|
83
|
-
self.openstack('network trunk set
|
|
83
|
+
self.openstack('network trunk set --enable ' + trunk_name)
|
|
84
84
|
|
|
85
85
|
json_output = json.loads(
|
|
86
86
|
self.openstack('network trunk show -f json ' + trunk_name)
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
import uuid
|
|
14
14
|
|
|
15
|
+
from tempest.lib import exceptions as tempest_exc
|
|
16
|
+
|
|
15
17
|
from openstackclient.tests.functional.network.v2 import common
|
|
16
18
|
|
|
17
19
|
|
|
@@ -162,8 +164,16 @@ class PortTests(common.NetworkTagTests):
|
|
|
162
164
|
id_list = [p['ID'] for p in json_output]
|
|
163
165
|
self.assertIn(id1, id_list)
|
|
164
166
|
self.assertIn(id2, id_list)
|
|
165
|
-
# Check an unknown field
|
|
166
|
-
self.
|
|
167
|
+
# Check an unknown field does not exist
|
|
168
|
+
self.assertNotIn('device_id', json_output[0])
|
|
169
|
+
|
|
170
|
+
# Test list with only unknown fields
|
|
171
|
+
exc = self.assertRaises(
|
|
172
|
+
tempest_exc.CommandFailed,
|
|
173
|
+
self.openstack,
|
|
174
|
+
'port list -c device_id',
|
|
175
|
+
)
|
|
176
|
+
self.assertIn("No recognized column names in ['device_id']", str(exc))
|
|
167
177
|
|
|
168
178
|
def test_port_set(self):
|
|
169
179
|
"""Test create, set, show, delete"""
|
|
@@ -209,7 +219,7 @@ class PortTests(common.NetworkTagTests):
|
|
|
209
219
|
def test_port_admin_set(self):
|
|
210
220
|
"""Test create, set (as admin), show, delete"""
|
|
211
221
|
json_output = self.openstack(
|
|
212
|
-
'port create
|
|
222
|
+
f'port create --network {self.NETWORK_NAME} {self.NAME}',
|
|
213
223
|
parse_output=True,
|
|
214
224
|
)
|
|
215
225
|
id_ = json_output.get('id')
|
|
@@ -257,7 +267,7 @@ class PortTests(common.NetworkTagTests):
|
|
|
257
267
|
self.assertEqual([sg_id1], json_output.get('security_group_ids'))
|
|
258
268
|
|
|
259
269
|
raw_output = self.openstack(
|
|
260
|
-
'port set
|
|
270
|
+
f'port set --security-group {sg_name2} {name}'
|
|
261
271
|
)
|
|
262
272
|
self.assertOutput('', raw_output)
|
|
263
273
|
|
|
@@ -296,17 +306,17 @@ class PortTests(common.NetworkTagTests):
|
|
|
296
306
|
sport2 = uuid.uuid4().hex
|
|
297
307
|
trunk = uuid.uuid4().hex
|
|
298
308
|
json_output = self.openstack(
|
|
299
|
-
'port create
|
|
309
|
+
f'port create --network {self.NETWORK_NAME} {pport}',
|
|
300
310
|
parse_output=True,
|
|
301
311
|
)
|
|
302
312
|
pport_id = json_output.get('id')
|
|
303
313
|
json_output = self.openstack(
|
|
304
|
-
'port create
|
|
314
|
+
f'port create --network {self.NETWORK_NAME} {sport1}',
|
|
305
315
|
parse_output=True,
|
|
306
316
|
)
|
|
307
317
|
sport1_id = json_output.get('id')
|
|
308
318
|
json_output = self.openstack(
|
|
309
|
-
'port create
|
|
319
|
+
f'port create --network {self.NETWORK_NAME} {sport2}',
|
|
310
320
|
parse_output=True,
|
|
311
321
|
)
|
|
312
322
|
sport2_id = json_output.get('id')
|
|
@@ -44,6 +44,44 @@ class RouterTests(common.NetworkTagTests):
|
|
|
44
44
|
del_output = self.openstack('router delete ' + name1 + ' ' + name2)
|
|
45
45
|
self.assertOutput('', del_output)
|
|
46
46
|
|
|
47
|
+
def test_router_create_with_external_gateway(self):
|
|
48
|
+
network_name = uuid.uuid4().hex
|
|
49
|
+
subnet_name = uuid.uuid4().hex
|
|
50
|
+
qos_policy = uuid.uuid4().hex
|
|
51
|
+
router_name = uuid.uuid4().hex
|
|
52
|
+
|
|
53
|
+
cmd_net = self.openstack(
|
|
54
|
+
f'network create --external {network_name}', parse_output=True
|
|
55
|
+
)
|
|
56
|
+
self.addCleanup(self.openstack, f'network delete {network_name}')
|
|
57
|
+
network_id = cmd_net['id']
|
|
58
|
+
|
|
59
|
+
self.openstack(
|
|
60
|
+
f'subnet create {subnet_name} '
|
|
61
|
+
f'--network {network_name} --subnet-range 10.0.0.0/24'
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
cmd_qos = self.openstack(
|
|
65
|
+
f'network qos policy create {qos_policy}', parse_output=True
|
|
66
|
+
)
|
|
67
|
+
self.addCleanup(
|
|
68
|
+
self.openstack, f'network qos policy delete {qos_policy}'
|
|
69
|
+
)
|
|
70
|
+
qos_id = cmd_qos['id']
|
|
71
|
+
|
|
72
|
+
self.openstack(
|
|
73
|
+
f'router create --external-gateway {network_name} '
|
|
74
|
+
f'--qos-policy {qos_policy} {router_name}'
|
|
75
|
+
)
|
|
76
|
+
self.addCleanup(self.openstack, f'router delete {router_name}')
|
|
77
|
+
|
|
78
|
+
cmd_output = self.openstack(
|
|
79
|
+
f'router show {router_name}', parse_output=True
|
|
80
|
+
)
|
|
81
|
+
gw_info = cmd_output['external_gateway_info']
|
|
82
|
+
self.assertEqual(network_id, gw_info['network_id'])
|
|
83
|
+
self.assertEqual(qos_id, gw_info['qos_policy_id'])
|
|
84
|
+
|
|
47
85
|
def test_router_list(self):
|
|
48
86
|
"""Test create, list filter"""
|
|
49
87
|
# Get project IDs
|
|
@@ -68,6 +106,10 @@ class RouterTests(common.NetworkTagTests):
|
|
|
68
106
|
self.assertNotEqual(admin_project_id, demo_project_id)
|
|
69
107
|
self.assertEqual(admin_project_id, auth_project_id)
|
|
70
108
|
|
|
109
|
+
# type narrow
|
|
110
|
+
assert admin_project_id is not None
|
|
111
|
+
assert demo_project_id is not None
|
|
112
|
+
|
|
71
113
|
name1 = uuid.uuid4().hex
|
|
72
114
|
name2 = uuid.uuid4().hex
|
|
73
115
|
cmd_output = self.openstack(
|
|
@@ -63,6 +63,10 @@ class SubnetPoolTests(common.NetworkTagTests):
|
|
|
63
63
|
self.assertNotEqual(admin_project_id, demo_project_id)
|
|
64
64
|
self.assertEqual(admin_project_id, auth_project_id)
|
|
65
65
|
|
|
66
|
+
# type narrow
|
|
67
|
+
assert admin_project_id is not None
|
|
68
|
+
assert demo_project_id is not None
|
|
69
|
+
|
|
66
70
|
name1 = uuid.uuid4().hex
|
|
67
71
|
name2 = uuid.uuid4().hex
|
|
68
72
|
|