python-openstackclient 7.1.3__py3-none-any.whl → 7.2.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/api/api.py +2 -1
- openstackclient/api/image_v2.py +1 -1
- openstackclient/api/object_store_v1.py +12 -20
- openstackclient/common/clientmanager.py +1 -1
- openstackclient/common/module.py +2 -2
- openstackclient/common/quota.py +4 -4
- openstackclient/compute/v2/flavor.py +1 -1
- openstackclient/compute/v2/server.py +122 -59
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +11 -2
- openstackclient/compute/v2/usage.py +3 -3
- openstackclient/identity/common.py +1 -1
- openstackclient/identity/v2_0/project.py +1 -1
- openstackclient/identity/v2_0/role_assignment.py +1 -1
- openstackclient/identity/v2_0/user.py +2 -2
- openstackclient/identity/v3/access_rule.py +26 -14
- openstackclient/identity/v3/identity_provider.py +1 -1
- openstackclient/identity/v3/project.py +1 -1
- openstackclient/image/v2/image.py +13 -13
- openstackclient/image/v2/metadef_objects.py +6 -4
- openstackclient/network/common.py +8 -7
- openstackclient/network/v2/floating_ip.py +6 -2
- openstackclient/network/v2/floating_ip_port_forwarding.py +2 -2
- openstackclient/network/v2/l3_conntrack_helper.py +1 -1
- openstackclient/network/v2/ndp_proxy.py +1 -0
- openstackclient/network/v2/network_agent.py +2 -6
- openstackclient/network/v2/network_qos_rule.py +2 -5
- openstackclient/network/v2/network_trunk.py +5 -4
- openstackclient/network/v2/port.py +18 -3
- openstackclient/network/v2/router.py +7 -4
- openstackclient/network/v2/subnet_pool.py +2 -2
- openstackclient/shell.py +3 -2
- openstackclient/tests/functional/common/test_help.py +3 -9
- openstackclient/tests/functional/common/test_module.py +1 -1
- openstackclient/tests/functional/common/test_quota.py +2 -4
- openstackclient/tests/functional/compute/v2/common.py +1 -3
- openstackclient/tests/functional/compute/v2/test_hypervisor.py +3 -3
- openstackclient/tests/functional/compute/v2/test_keypair.py +2 -2
- openstackclient/tests/functional/compute/v2/test_server.py +1 -1
- openstackclient/tests/functional/identity/v2/common.py +31 -48
- openstackclient/tests/functional/identity/v2/test_catalog.py +1 -1
- openstackclient/tests/functional/identity/v2/test_ec2_credentials.py +2 -2
- openstackclient/tests/functional/identity/v2/test_endpoint.py +2 -2
- openstackclient/tests/functional/identity/v2/test_project.py +8 -8
- openstackclient/tests/functional/identity/v2/test_role.py +14 -34
- openstackclient/tests/functional/identity/v2/test_service.py +2 -2
- openstackclient/tests/functional/identity/v2/test_token.py +1 -1
- openstackclient/tests/functional/identity/v2/test_user.py +7 -9
- openstackclient/tests/functional/identity/v3/common.py +69 -110
- openstackclient/tests/functional/identity/v3/test_access_rule.py +86 -0
- openstackclient/tests/functional/identity/v3/test_application_credential.py +18 -44
- openstackclient/tests/functional/identity/v3/test_catalog.py +1 -1
- openstackclient/tests/functional/identity/v3/test_domain.py +9 -11
- openstackclient/tests/functional/identity/v3/test_endpoint.py +15 -27
- openstackclient/tests/functional/identity/v3/test_group.py +32 -93
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -3
- openstackclient/tests/functional/identity/v3/test_limit.py +32 -32
- openstackclient/tests/functional/identity/v3/test_project.py +17 -26
- openstackclient/tests/functional/identity/v3/test_region.py +6 -7
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +27 -36
- openstackclient/tests/functional/identity/v3/test_role.py +30 -60
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +33 -80
- openstackclient/tests/functional/identity/v3/test_service.py +7 -13
- openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -3
- openstackclient/tests/functional/identity/v3/test_user.py +17 -34
- openstackclient/tests/functional/image/v2/test_image.py +1 -3
- openstackclient/tests/functional/network/v2/common.py +1 -3
- openstackclient/tests/functional/network/v2/test_default_security_group_rule.py +3 -8
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +27 -31
- openstackclient/tests/functional/network/v2/test_network.py +9 -12
- openstackclient/tests/functional/network/v2/test_network_agent.py +15 -20
- openstackclient/tests/functional/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +17 -39
- openstackclient/tests/functional/network/v2/test_network_qos_rule.py +48 -63
- openstackclient/tests/functional/network/v2/test_network_qos_rule_type.py +1 -1
- openstackclient/tests/functional/network/v2/test_network_segment_range.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_trunk.py +15 -25
- openstackclient/tests/functional/network/v2/test_port.py +28 -34
- openstackclient/tests/functional/network/v2/test_router.py +13 -19
- openstackclient/tests/functional/object/v1/test_object.py +4 -7
- openstackclient/tests/functional/volume/base.py +5 -17
- openstackclient/tests/functional/volume/v1/test_volume_type.py +11 -11
- openstackclient/tests/functional/volume/v2/test_volume_backup.py +1 -1
- openstackclient/tests/functional/volume/v2/test_volume_type.py +13 -15
- openstackclient/tests/functional/volume/v3/test_volume_type.py +13 -15
- openstackclient/tests/unit/api/test_compute_v2.py +0 -5
- openstackclient/tests/unit/api/test_object_store_v1.py +6 -4
- openstackclient/tests/unit/common/test_extension.py +24 -31
- openstackclient/tests/unit/compute/v2/test_host.py +0 -1
- openstackclient/tests/unit/compute/v2/test_server.py +123 -115
- openstackclient/tests/unit/identity/v3/test_access_rule.py +65 -64
- openstackclient/tests/unit/identity/v3/test_group.py +4 -10
- openstackclient/tests/unit/identity/v3/test_limit.py +2 -2
- openstackclient/tests/unit/image/v2/test_metadef_objects.py +1 -2
- openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +2 -6
- openstackclient/tests/unit/integ/base.py +1 -1
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +3 -3
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +4 -4
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +12 -13
- openstackclient/tests/unit/network/v2/test_network_trunk.py +31 -35
- openstackclient/tests/unit/network/v2/test_port.py +40 -17
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +1 -1
- openstackclient/tests/unit/object/v1/test_object.py +1 -1
- openstackclient/tests/unit/utils.py +2 -2
- openstackclient/volume/client.py +1 -1
- openstackclient/volume/v1/volume.py +2 -2
- openstackclient/volume/v1/volume_backup.py +2 -2
- openstackclient/volume/v1/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume.py +2 -2
- openstackclient/volume/v2/volume_backup.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume_type.py +4 -4
- openstackclient/volume/v3/service.py +0 -1
- openstackclient/volume/v3/volume.py +3 -3
- openstackclient/volume/v3/volume_backup.py +2 -2
- openstackclient/volume/v3/volume_group.py +3 -7
- openstackclient/volume/v3/volume_type.py +6 -6
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/AUTHORS +3 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/METADATA +2 -3
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/RECORD +127 -126
- python_openstackclient-7.2.0.dist-info/pbr.json +1 -0
- python_openstackclient-7.1.3.dist-info/pbr.json +0 -1
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/entry_points.txt +0 -0
- {python_openstackclient-7.1.3.dist-info → python_openstackclient-7.2.0.dist-info}/top_level.txt +0 -0
|
@@ -32,40 +32,39 @@ class NetworkQosRuleTestsMinimumBandwidth(NetworkQosTests):
|
|
|
32
32
|
def setUp(self):
|
|
33
33
|
super().setUp()
|
|
34
34
|
|
|
35
|
-
self.QOS_POLICY_NAME = 'qos_policy_
|
|
35
|
+
self.QOS_POLICY_NAME = f'qos_policy_{uuid.uuid4().hex}'
|
|
36
36
|
|
|
37
|
-
self.openstack('network qos policy create
|
|
37
|
+
self.openstack(f'network qos policy create {self.QOS_POLICY_NAME}')
|
|
38
38
|
self.addCleanup(
|
|
39
39
|
self.openstack,
|
|
40
|
-
'network qos policy delete
|
|
40
|
+
f'network qos policy delete {self.QOS_POLICY_NAME}',
|
|
41
41
|
)
|
|
42
42
|
cmd_output = self.openstack(
|
|
43
43
|
'network qos rule create '
|
|
44
44
|
'--type minimum-bandwidth '
|
|
45
45
|
'--min-kbps 2800 '
|
|
46
|
-
'--egress
|
|
46
|
+
f'--egress {self.QOS_POLICY_NAME}',
|
|
47
47
|
parse_output=True,
|
|
48
48
|
)
|
|
49
49
|
self.RULE_ID = cmd_output['id']
|
|
50
50
|
self.addCleanup(
|
|
51
51
|
self.openstack,
|
|
52
|
-
'network qos rule delete
|
|
53
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
52
|
+
f'network qos rule delete {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
54
53
|
)
|
|
55
54
|
self.assertTrue(self.RULE_ID)
|
|
56
55
|
|
|
57
56
|
def test_qos_rule_create_delete(self):
|
|
58
57
|
# This is to check the output of qos rule delete
|
|
59
58
|
policy_name = uuid.uuid4().hex
|
|
60
|
-
self.openstack('network qos policy create
|
|
59
|
+
self.openstack(f'network qos policy create {policy_name}')
|
|
61
60
|
self.addCleanup(
|
|
62
|
-
self.openstack, 'network qos policy delete
|
|
61
|
+
self.openstack, f'network qos policy delete {policy_name}'
|
|
63
62
|
)
|
|
64
63
|
rule = self.openstack(
|
|
65
64
|
'network qos rule create '
|
|
66
65
|
'--type minimum-bandwidth '
|
|
67
66
|
'--min-kbps 2800 '
|
|
68
|
-
'--egress
|
|
67
|
+
f'--egress {policy_name}',
|
|
69
68
|
parse_output=True,
|
|
70
69
|
)
|
|
71
70
|
raw_output = self.openstack(
|
|
@@ -75,27 +74,24 @@ class NetworkQosRuleTestsMinimumBandwidth(NetworkQosTests):
|
|
|
75
74
|
|
|
76
75
|
def test_qos_rule_list(self):
|
|
77
76
|
cmd_output = self.openstack(
|
|
78
|
-
'network qos rule list
|
|
77
|
+
f'network qos rule list {self.QOS_POLICY_NAME}',
|
|
79
78
|
parse_output=True,
|
|
80
79
|
)
|
|
81
80
|
self.assertIn(self.RULE_ID, [rule['ID'] for rule in cmd_output])
|
|
82
81
|
|
|
83
82
|
def test_qos_rule_show(self):
|
|
84
83
|
cmd_output = self.openstack(
|
|
85
|
-
'network qos rule show
|
|
86
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
84
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
87
85
|
parse_output=True,
|
|
88
86
|
)
|
|
89
87
|
self.assertEqual(self.RULE_ID, cmd_output['id'])
|
|
90
88
|
|
|
91
89
|
def test_qos_rule_set(self):
|
|
92
90
|
self.openstack(
|
|
93
|
-
'network qos rule set --min-kbps 7500
|
|
94
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID)
|
|
91
|
+
f'network qos rule set --min-kbps 7500 {self.QOS_POLICY_NAME} {self.RULE_ID}'
|
|
95
92
|
)
|
|
96
93
|
cmd_output = self.openstack(
|
|
97
|
-
'network qos rule show
|
|
98
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
94
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
99
95
|
parse_output=True,
|
|
100
96
|
)
|
|
101
97
|
self.assertEqual(7500, cmd_output['min_kbps'])
|
|
@@ -107,40 +103,39 @@ class NetworkQosRuleTestsMinimumPacketRate(NetworkQosTests):
|
|
|
107
103
|
def setUp(self):
|
|
108
104
|
super().setUp()
|
|
109
105
|
|
|
110
|
-
self.QOS_POLICY_NAME = 'qos_policy_
|
|
106
|
+
self.QOS_POLICY_NAME = f'qos_policy_{uuid.uuid4().hex}'
|
|
111
107
|
|
|
112
|
-
self.openstack('network qos policy create
|
|
108
|
+
self.openstack(f'network qos policy create {self.QOS_POLICY_NAME}')
|
|
113
109
|
self.addCleanup(
|
|
114
110
|
self.openstack,
|
|
115
|
-
'network qos policy delete
|
|
111
|
+
f'network qos policy delete {self.QOS_POLICY_NAME}',
|
|
116
112
|
)
|
|
117
113
|
cmd_output = self.openstack(
|
|
118
114
|
'network qos rule create '
|
|
119
115
|
'--type minimum-packet-rate '
|
|
120
116
|
'--min-kpps 2800 '
|
|
121
|
-
'--egress
|
|
117
|
+
f'--egress {self.QOS_POLICY_NAME}',
|
|
122
118
|
parse_output=True,
|
|
123
119
|
)
|
|
124
120
|
self.RULE_ID = cmd_output['id']
|
|
125
121
|
self.addCleanup(
|
|
126
122
|
self.openstack,
|
|
127
|
-
'network qos rule delete
|
|
128
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
123
|
+
f'network qos rule delete {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
129
124
|
)
|
|
130
125
|
self.assertTrue(self.RULE_ID)
|
|
131
126
|
|
|
132
127
|
def test_qos_rule_create_delete(self):
|
|
133
128
|
# This is to check the output of qos rule delete
|
|
134
129
|
policy_name = uuid.uuid4().hex
|
|
135
|
-
self.openstack('network qos policy create
|
|
130
|
+
self.openstack(f'network qos policy create {policy_name}')
|
|
136
131
|
self.addCleanup(
|
|
137
|
-
self.openstack, 'network qos policy delete
|
|
132
|
+
self.openstack, f'network qos policy delete {policy_name}'
|
|
138
133
|
)
|
|
139
134
|
rule = self.openstack(
|
|
140
135
|
'network qos rule create '
|
|
141
136
|
'--type minimum-packet-rate '
|
|
142
137
|
'--min-kpps 2800 '
|
|
143
|
-
'--egress
|
|
138
|
+
f'--egress {policy_name}',
|
|
144
139
|
parse_output=True,
|
|
145
140
|
)
|
|
146
141
|
raw_output = self.openstack(
|
|
@@ -150,27 +145,24 @@ class NetworkQosRuleTestsMinimumPacketRate(NetworkQosTests):
|
|
|
150
145
|
|
|
151
146
|
def test_qos_rule_list(self):
|
|
152
147
|
cmd_output = self.openstack(
|
|
153
|
-
'network qos rule list
|
|
148
|
+
f'network qos rule list {self.QOS_POLICY_NAME}',
|
|
154
149
|
parse_output=True,
|
|
155
150
|
)
|
|
156
151
|
self.assertIn(self.RULE_ID, [rule['ID'] for rule in cmd_output])
|
|
157
152
|
|
|
158
153
|
def test_qos_rule_show(self):
|
|
159
154
|
cmd_output = self.openstack(
|
|
160
|
-
'network qos rule show
|
|
161
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
155
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
162
156
|
parse_output=True,
|
|
163
157
|
)
|
|
164
158
|
self.assertEqual(self.RULE_ID, cmd_output['id'])
|
|
165
159
|
|
|
166
160
|
def test_qos_rule_set(self):
|
|
167
161
|
self.openstack(
|
|
168
|
-
'network qos rule set --min-kpps 7500 --any
|
|
169
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID)
|
|
162
|
+
f'network qos rule set --min-kpps 7500 --any {self.QOS_POLICY_NAME} {self.RULE_ID}'
|
|
170
163
|
)
|
|
171
164
|
cmd_output = self.openstack(
|
|
172
|
-
'network qos rule show
|
|
173
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
165
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
174
166
|
parse_output=True,
|
|
175
167
|
)
|
|
176
168
|
self.assertEqual(7500, cmd_output['min_kpps'])
|
|
@@ -183,37 +175,36 @@ class NetworkQosRuleTestsDSCPMarking(NetworkQosTests):
|
|
|
183
175
|
def setUp(self):
|
|
184
176
|
super().setUp()
|
|
185
177
|
|
|
186
|
-
self.QOS_POLICY_NAME = 'qos_policy_
|
|
187
|
-
self.openstack('network qos policy create
|
|
178
|
+
self.QOS_POLICY_NAME = f'qos_policy_{uuid.uuid4().hex}'
|
|
179
|
+
self.openstack(f'network qos policy create {self.QOS_POLICY_NAME}')
|
|
188
180
|
self.addCleanup(
|
|
189
181
|
self.openstack,
|
|
190
|
-
'network qos policy delete
|
|
182
|
+
f'network qos policy delete {self.QOS_POLICY_NAME}',
|
|
191
183
|
)
|
|
192
184
|
cmd_output = self.openstack(
|
|
193
185
|
'network qos rule create '
|
|
194
186
|
'--type dscp-marking '
|
|
195
|
-
'--dscp-mark 8
|
|
187
|
+
f'--dscp-mark 8 {self.QOS_POLICY_NAME}',
|
|
196
188
|
parse_output=True,
|
|
197
189
|
)
|
|
198
190
|
self.RULE_ID = cmd_output['id']
|
|
199
191
|
self.addCleanup(
|
|
200
192
|
self.openstack,
|
|
201
|
-
'network qos rule delete
|
|
202
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
193
|
+
f'network qos rule delete {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
203
194
|
)
|
|
204
195
|
self.assertTrue(self.RULE_ID)
|
|
205
196
|
|
|
206
197
|
def test_qos_rule_create_delete(self):
|
|
207
198
|
# This is to check the output of qos rule delete
|
|
208
199
|
policy_name = uuid.uuid4().hex
|
|
209
|
-
self.openstack('network qos policy create
|
|
200
|
+
self.openstack(f'network qos policy create {policy_name}')
|
|
210
201
|
self.addCleanup(
|
|
211
|
-
self.openstack, 'network qos policy delete
|
|
202
|
+
self.openstack, f'network qos policy delete {policy_name}'
|
|
212
203
|
)
|
|
213
204
|
rule = self.openstack(
|
|
214
205
|
'network qos rule create '
|
|
215
206
|
'--type dscp-marking '
|
|
216
|
-
'--dscp-mark 8
|
|
207
|
+
f'--dscp-mark 8 {policy_name}',
|
|
217
208
|
parse_output=True,
|
|
218
209
|
)
|
|
219
210
|
raw_output = self.openstack(
|
|
@@ -223,27 +214,24 @@ class NetworkQosRuleTestsDSCPMarking(NetworkQosTests):
|
|
|
223
214
|
|
|
224
215
|
def test_qos_rule_list(self):
|
|
225
216
|
cmd_output = self.openstack(
|
|
226
|
-
'network qos rule list
|
|
217
|
+
f'network qos rule list {self.QOS_POLICY_NAME}',
|
|
227
218
|
parse_output=True,
|
|
228
219
|
)
|
|
229
220
|
self.assertIn(self.RULE_ID, [rule['ID'] for rule in cmd_output])
|
|
230
221
|
|
|
231
222
|
def test_qos_rule_show(self):
|
|
232
223
|
cmd_output = self.openstack(
|
|
233
|
-
'network qos rule show
|
|
234
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
224
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
235
225
|
parse_output=True,
|
|
236
226
|
)
|
|
237
227
|
self.assertEqual(self.RULE_ID, cmd_output['id'])
|
|
238
228
|
|
|
239
229
|
def test_qos_rule_set(self):
|
|
240
230
|
self.openstack(
|
|
241
|
-
'network qos rule set --dscp-mark 32
|
|
242
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID)
|
|
231
|
+
f'network qos rule set --dscp-mark 32 {self.QOS_POLICY_NAME} {self.RULE_ID}'
|
|
243
232
|
)
|
|
244
233
|
cmd_output = self.openstack(
|
|
245
|
-
'network qos rule show
|
|
246
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
234
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
247
235
|
parse_output=True,
|
|
248
236
|
)
|
|
249
237
|
self.assertEqual(32, cmd_output['dscp_mark'])
|
|
@@ -255,40 +243,39 @@ class NetworkQosRuleTestsBandwidthLimit(NetworkQosTests):
|
|
|
255
243
|
def setUp(self):
|
|
256
244
|
super().setUp()
|
|
257
245
|
|
|
258
|
-
self.QOS_POLICY_NAME = 'qos_policy_
|
|
259
|
-
self.openstack('network qos policy create
|
|
246
|
+
self.QOS_POLICY_NAME = f'qos_policy_{uuid.uuid4().hex}'
|
|
247
|
+
self.openstack(f'network qos policy create {self.QOS_POLICY_NAME}')
|
|
260
248
|
self.addCleanup(
|
|
261
249
|
self.openstack,
|
|
262
|
-
'network qos policy delete
|
|
250
|
+
f'network qos policy delete {self.QOS_POLICY_NAME}',
|
|
263
251
|
)
|
|
264
252
|
cmd_output = self.openstack(
|
|
265
253
|
'network qos rule create '
|
|
266
254
|
'--type bandwidth-limit '
|
|
267
255
|
'--max-kbps 10000 '
|
|
268
|
-
'--egress
|
|
256
|
+
f'--egress {self.QOS_POLICY_NAME}',
|
|
269
257
|
parse_output=True,
|
|
270
258
|
)
|
|
271
259
|
self.RULE_ID = cmd_output['id']
|
|
272
260
|
self.addCleanup(
|
|
273
261
|
self.openstack,
|
|
274
|
-
'network qos rule delete
|
|
275
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
262
|
+
f'network qos rule delete {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
276
263
|
)
|
|
277
264
|
self.assertTrue(self.RULE_ID)
|
|
278
265
|
|
|
279
266
|
def test_qos_rule_create_delete(self):
|
|
280
267
|
# This is to check the output of qos rule delete
|
|
281
268
|
policy_name = uuid.uuid4().hex
|
|
282
|
-
self.openstack('network qos policy create
|
|
269
|
+
self.openstack(f'network qos policy create {policy_name}')
|
|
283
270
|
self.addCleanup(
|
|
284
|
-
self.openstack, 'network qos policy delete
|
|
271
|
+
self.openstack, f'network qos policy delete {policy_name}'
|
|
285
272
|
)
|
|
286
273
|
rule = self.openstack(
|
|
287
274
|
'network qos rule create '
|
|
288
275
|
'--type bandwidth-limit '
|
|
289
276
|
'--max-kbps 10000 '
|
|
290
277
|
'--max-burst-kbits 1400 '
|
|
291
|
-
'--egress
|
|
278
|
+
f'--egress {policy_name}',
|
|
292
279
|
parse_output=True,
|
|
293
280
|
)
|
|
294
281
|
raw_output = self.openstack(
|
|
@@ -298,15 +285,14 @@ class NetworkQosRuleTestsBandwidthLimit(NetworkQosTests):
|
|
|
298
285
|
|
|
299
286
|
def test_qos_rule_list(self):
|
|
300
287
|
cmd_output = self.openstack(
|
|
301
|
-
'network qos rule list
|
|
288
|
+
f'network qos rule list {self.QOS_POLICY_NAME}',
|
|
302
289
|
parse_output=True,
|
|
303
290
|
)
|
|
304
291
|
self.assertIn(self.RULE_ID, [rule['ID'] for rule in cmd_output])
|
|
305
292
|
|
|
306
293
|
def test_qos_rule_show(self):
|
|
307
294
|
cmd_output = self.openstack(
|
|
308
|
-
'network qos rule show
|
|
309
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
295
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
310
296
|
parse_output=True,
|
|
311
297
|
)
|
|
312
298
|
self.assertEqual(self.RULE_ID, cmd_output['id'])
|
|
@@ -315,11 +301,10 @@ class NetworkQosRuleTestsBandwidthLimit(NetworkQosTests):
|
|
|
315
301
|
self.openstack(
|
|
316
302
|
'network qos rule set --max-kbps 15000 '
|
|
317
303
|
'--max-burst-kbits 1800 '
|
|
318
|
-
'--ingress
|
|
304
|
+
f'--ingress {self.QOS_POLICY_NAME} {self.RULE_ID}'
|
|
319
305
|
)
|
|
320
306
|
cmd_output = self.openstack(
|
|
321
|
-
'network qos rule show
|
|
322
|
-
% (self.QOS_POLICY_NAME, self.RULE_ID),
|
|
307
|
+
f'network qos rule show {self.QOS_POLICY_NAME} {self.RULE_ID}',
|
|
323
308
|
parse_output=True,
|
|
324
309
|
)
|
|
325
310
|
self.assertEqual(15000, cmd_output['max_kbps'])
|
|
@@ -67,7 +67,7 @@ class NetworkQosRuleTypeTests(common.NetworkTests):
|
|
|
67
67
|
def test_qos_rule_type_details(self):
|
|
68
68
|
for rule_type in self.AVAILABLE_RULE_TYPES:
|
|
69
69
|
cmd_output = self.openstack(
|
|
70
|
-
'network qos rule type show
|
|
70
|
+
f'network qos rule type show {rule_type} -f json',
|
|
71
71
|
parse_output=True,
|
|
72
72
|
)
|
|
73
73
|
self.assertEqual(rule_type, cmd_output['rule_type_name'])
|
|
@@ -128,8 +128,8 @@ class NetworkSegmentRangeTests(common.NetworkTests):
|
|
|
128
128
|
new_minimum = 2020
|
|
129
129
|
new_maximum = 2029
|
|
130
130
|
cmd_output = self.openstack(
|
|
131
|
-
'network segment range set --minimum {
|
|
132
|
-
'{name}'
|
|
131
|
+
f'network segment range set --minimum {new_minimum} --maximum {new_maximum} '
|
|
132
|
+
f'{name}'
|
|
133
133
|
)
|
|
134
134
|
self.assertOutput('', cmd_output)
|
|
135
135
|
|
|
@@ -32,33 +32,27 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
32
32
|
self.parent_port_name = uuid.uuid4().hex
|
|
33
33
|
self.sub_port_name = uuid.uuid4().hex
|
|
34
34
|
|
|
35
|
-
self.openstack('network create
|
|
36
|
-
self.addCleanup(self.openstack, 'network delete
|
|
35
|
+
self.openstack(f'network create {network_name}')
|
|
36
|
+
self.addCleanup(self.openstack, f'network delete {network_name}')
|
|
37
37
|
|
|
38
38
|
self.openstack(
|
|
39
|
-
'subnet create
|
|
40
|
-
'--network
|
|
41
|
-
% (subnet_name, network_name)
|
|
39
|
+
f'subnet create {subnet_name} '
|
|
40
|
+
f'--network {network_name} --subnet-range 10.0.0.0/24'
|
|
42
41
|
)
|
|
43
42
|
self.openstack(
|
|
44
|
-
'port create
|
|
45
|
-
% (self.parent_port_name, network_name)
|
|
46
|
-
)
|
|
47
|
-
self.addCleanup(
|
|
48
|
-
self.openstack, 'port delete %s' % self.parent_port_name
|
|
43
|
+
f'port create {self.parent_port_name} --network {network_name}'
|
|
49
44
|
)
|
|
45
|
+
self.addCleanup(self.openstack, f'port delete {self.parent_port_name}')
|
|
50
46
|
json_out = self.openstack(
|
|
51
|
-
'port create
|
|
52
|
-
% (self.sub_port_name, network_name)
|
|
47
|
+
f'port create {self.sub_port_name} --network {network_name} -f json'
|
|
53
48
|
)
|
|
54
49
|
self.sub_port_id = json.loads(json_out)['id']
|
|
55
|
-
self.addCleanup(self.openstack, 'port delete
|
|
50
|
+
self.addCleanup(self.openstack, f'port delete {self.sub_port_name}')
|
|
56
51
|
|
|
57
52
|
def test_network_trunk_create_delete(self):
|
|
58
53
|
trunk_name = uuid.uuid4().hex
|
|
59
54
|
self.openstack(
|
|
60
|
-
'network trunk create
|
|
61
|
-
% (trunk_name, self.parent_port_name)
|
|
55
|
+
f'network trunk create {trunk_name} --parent-port {self.parent_port_name} -f json '
|
|
62
56
|
)
|
|
63
57
|
raw_output = self.openstack('network trunk delete ' + trunk_name)
|
|
64
58
|
self.assertEqual('', raw_output)
|
|
@@ -67,8 +61,7 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
67
61
|
trunk_name = uuid.uuid4().hex
|
|
68
62
|
json_output = json.loads(
|
|
69
63
|
self.openstack(
|
|
70
|
-
'network trunk create
|
|
71
|
-
% (trunk_name, self.parent_port_name)
|
|
64
|
+
f'network trunk create {trunk_name} --parent-port {self.parent_port_name} -f json '
|
|
72
65
|
)
|
|
73
66
|
)
|
|
74
67
|
self.addCleanup(self.openstack, 'network trunk delete ' + trunk_name)
|
|
@@ -81,8 +74,7 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
81
74
|
trunk_name = uuid.uuid4().hex
|
|
82
75
|
json_output = json.loads(
|
|
83
76
|
self.openstack(
|
|
84
|
-
'network trunk create
|
|
85
|
-
% (trunk_name, self.parent_port_name)
|
|
77
|
+
f'network trunk create {trunk_name} --parent-port {self.parent_port_name} -f json '
|
|
86
78
|
)
|
|
87
79
|
)
|
|
88
80
|
self.addCleanup(self.openstack, 'network trunk delete ' + trunk_name)
|
|
@@ -98,8 +90,7 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
98
90
|
# Add subport to trunk
|
|
99
91
|
self.openstack(
|
|
100
92
|
'network trunk set '
|
|
101
|
-
+ '--subport port
|
|
102
|
-
% (self.sub_port_name)
|
|
93
|
+
+ f'--subport port={self.sub_port_name},segmentation-type=vlan,segmentation-id=42 '
|
|
103
94
|
+ trunk_name
|
|
104
95
|
)
|
|
105
96
|
json_output = json.loads(
|
|
@@ -132,10 +123,9 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
132
123
|
trunk_name = uuid.uuid4().hex
|
|
133
124
|
json_output = json.loads(
|
|
134
125
|
self.openstack(
|
|
135
|
-
'network trunk create
|
|
136
|
-
'--subport port
|
|
126
|
+
f'network trunk create {trunk_name} --parent-port {self.parent_port_name} '
|
|
127
|
+
f'--subport port={self.sub_port_name},segmentation-type=vlan,segmentation-id=42 '
|
|
137
128
|
'-f json '
|
|
138
|
-
% (trunk_name, self.parent_port_name, self.sub_port_name)
|
|
139
129
|
)
|
|
140
130
|
)
|
|
141
131
|
self.addCleanup(self.openstack, 'network trunk delete ' + trunk_name)
|
|
@@ -143,7 +133,7 @@ class NetworkTrunkTests(common.NetworkTests):
|
|
|
143
133
|
|
|
144
134
|
json_output = json.loads(
|
|
145
135
|
self.openstack(
|
|
146
|
-
'network subport list --trunk
|
|
136
|
+
f'network subport list --trunk {trunk_name} -f json'
|
|
147
137
|
)
|
|
148
138
|
)
|
|
149
139
|
self.assertEqual(
|
|
@@ -31,14 +31,14 @@ class PortTests(common.NetworkTagTests):
|
|
|
31
31
|
cls.NETWORK_NAME = uuid.uuid4().hex
|
|
32
32
|
|
|
33
33
|
# Create a network for the port tests
|
|
34
|
-
cls.openstack('network create
|
|
34
|
+
cls.openstack(f'network create {cls.NETWORK_NAME}')
|
|
35
35
|
|
|
36
36
|
@classmethod
|
|
37
37
|
def tearDownClass(cls):
|
|
38
38
|
try:
|
|
39
39
|
if cls.haz_network:
|
|
40
40
|
raw_output = cls.openstack(
|
|
41
|
-
'network delete
|
|
41
|
+
f'network delete {cls.NETWORK_NAME}'
|
|
42
42
|
)
|
|
43
43
|
cls.assertOutput('', raw_output)
|
|
44
44
|
finally:
|
|
@@ -56,9 +56,7 @@ class PortTests(common.NetworkTagTests):
|
|
|
56
56
|
self.assertEqual(self.NAME, json_output.get('name'))
|
|
57
57
|
|
|
58
58
|
json_output = self.openstack(
|
|
59
|
-
'port create --network {} {}x'
|
|
60
|
-
self.NETWORK_NAME, self.NAME
|
|
61
|
-
),
|
|
59
|
+
f'port create --network {self.NETWORK_NAME} {self.NAME}x',
|
|
62
60
|
parse_output=True,
|
|
63
61
|
)
|
|
64
62
|
id2 = json_output.get('id')
|
|
@@ -80,20 +78,18 @@ class PortTests(common.NetworkTagTests):
|
|
|
80
78
|
self.assertIsNotNone(id1)
|
|
81
79
|
mac1 = json_output.get('mac_address')
|
|
82
80
|
self.assertIsNotNone(mac1)
|
|
83
|
-
self.addCleanup(self.openstack, 'port delete
|
|
81
|
+
self.addCleanup(self.openstack, f'port delete {id1}')
|
|
84
82
|
self.assertEqual(self.NAME, json_output.get('name'))
|
|
85
83
|
|
|
86
84
|
json_output = self.openstack(
|
|
87
|
-
'port create --network {} {}x'
|
|
88
|
-
self.NETWORK_NAME, self.NAME
|
|
89
|
-
),
|
|
85
|
+
f'port create --network {self.NETWORK_NAME} {self.NAME}x',
|
|
90
86
|
parse_output=True,
|
|
91
87
|
)
|
|
92
88
|
id2 = json_output.get('id')
|
|
93
89
|
self.assertIsNotNone(id2)
|
|
94
90
|
mac2 = json_output.get('mac_address')
|
|
95
91
|
self.assertIsNotNone(mac2)
|
|
96
|
-
self.addCleanup(self.openstack, 'port delete
|
|
92
|
+
self.addCleanup(self.openstack, f'port delete {id2}')
|
|
97
93
|
self.assertEqual(self.NAME + 'x', json_output.get('name'))
|
|
98
94
|
|
|
99
95
|
# Test list
|
|
@@ -120,7 +116,7 @@ class PortTests(common.NetworkTagTests):
|
|
|
120
116
|
|
|
121
117
|
# Test list --mac-address
|
|
122
118
|
json_output = self.openstack(
|
|
123
|
-
'port list --mac-address
|
|
119
|
+
f'port list --mac-address {mac2}',
|
|
124
120
|
parse_output=True,
|
|
125
121
|
)
|
|
126
122
|
item_map = {
|
|
@@ -147,22 +143,22 @@ class PortTests(common.NetworkTagTests):
|
|
|
147
143
|
name = uuid.uuid4().hex
|
|
148
144
|
json_output = self.openstack(
|
|
149
145
|
'port create '
|
|
150
|
-
'--network
|
|
146
|
+
f'--network {self.NETWORK_NAME} '
|
|
151
147
|
'--description xyzpdq '
|
|
152
|
-
'--disable
|
|
148
|
+
f'--disable {name}',
|
|
153
149
|
parse_output=True,
|
|
154
150
|
)
|
|
155
151
|
id1 = json_output.get('id')
|
|
156
|
-
self.addCleanup(self.openstack, 'port delete
|
|
152
|
+
self.addCleanup(self.openstack, f'port delete {id1}')
|
|
157
153
|
self.assertEqual(name, json_output.get('name'))
|
|
158
154
|
self.assertEqual('xyzpdq', json_output.get('description'))
|
|
159
155
|
self.assertEqual(False, json_output.get('admin_state_up'))
|
|
160
156
|
|
|
161
|
-
raw_output = self.openstack('port set --enable
|
|
157
|
+
raw_output = self.openstack(f'port set --enable {name}')
|
|
162
158
|
self.assertOutput('', raw_output)
|
|
163
159
|
|
|
164
160
|
json_output = self.openstack(
|
|
165
|
-
'port show
|
|
161
|
+
f'port show {name}',
|
|
166
162
|
parse_output=True,
|
|
167
163
|
)
|
|
168
164
|
sg_id = json_output.get('security_group_ids')[0]
|
|
@@ -178,7 +174,7 @@ class PortTests(common.NetworkTagTests):
|
|
|
178
174
|
self.assertOutput('', raw_output)
|
|
179
175
|
|
|
180
176
|
json_output = self.openstack(
|
|
181
|
-
'port show
|
|
177
|
+
f'port show {name}',
|
|
182
178
|
parse_output=True,
|
|
183
179
|
)
|
|
184
180
|
self.assertEqual([], json_output.get('security_group_ids'))
|
|
@@ -186,19 +182,19 @@ class PortTests(common.NetworkTagTests):
|
|
|
186
182
|
def test_port_admin_set(self):
|
|
187
183
|
"""Test create, set (as admin), show, delete"""
|
|
188
184
|
json_output = self.openstack(
|
|
189
|
-
'port create ' '--network
|
|
185
|
+
'port create ' f'--network {self.NETWORK_NAME} {self.NAME}',
|
|
190
186
|
parse_output=True,
|
|
191
187
|
)
|
|
192
188
|
id_ = json_output.get('id')
|
|
193
|
-
self.addCleanup(self.openstack, 'port delete
|
|
189
|
+
self.addCleanup(self.openstack, f'port delete {id_}')
|
|
194
190
|
|
|
195
191
|
raw_output = self.openstack(
|
|
196
192
|
'--os-username admin '
|
|
197
|
-
'port set --mac-address 11:22:33:44:55:66
|
|
193
|
+
f'port set --mac-address 11:22:33:44:55:66 {self.NAME}'
|
|
198
194
|
)
|
|
199
195
|
self.assertOutput('', raw_output)
|
|
200
196
|
json_output = self.openstack(
|
|
201
|
-
'port show
|
|
197
|
+
f'port show {self.NAME}',
|
|
202
198
|
parse_output=True,
|
|
203
199
|
)
|
|
204
200
|
self.assertEqual(json_output.get('mac_address'), '11:22:33:44:55:66')
|
|
@@ -207,39 +203,39 @@ class PortTests(common.NetworkTagTests):
|
|
|
207
203
|
"""Test create, set, show, delete"""
|
|
208
204
|
sg_name1 = uuid.uuid4().hex
|
|
209
205
|
json_output = self.openstack(
|
|
210
|
-
'security group create
|
|
206
|
+
f'security group create {sg_name1}',
|
|
211
207
|
parse_output=True,
|
|
212
208
|
)
|
|
213
209
|
sg_id1 = json_output.get('id')
|
|
214
|
-
self.addCleanup(self.openstack, 'security group delete
|
|
210
|
+
self.addCleanup(self.openstack, f'security group delete {sg_id1}')
|
|
215
211
|
|
|
216
212
|
sg_name2 = uuid.uuid4().hex
|
|
217
213
|
json_output = self.openstack(
|
|
218
|
-
'security group create
|
|
214
|
+
f'security group create {sg_name2}',
|
|
219
215
|
parse_output=True,
|
|
220
216
|
)
|
|
221
217
|
sg_id2 = json_output.get('id')
|
|
222
|
-
self.addCleanup(self.openstack, 'security group delete
|
|
218
|
+
self.addCleanup(self.openstack, f'security group delete {sg_id2}')
|
|
223
219
|
|
|
224
220
|
name = uuid.uuid4().hex
|
|
225
221
|
json_output = self.openstack(
|
|
226
222
|
'port create '
|
|
227
|
-
'--network
|
|
228
|
-
'--security-group
|
|
223
|
+
f'--network {self.NETWORK_NAME} '
|
|
224
|
+
f'--security-group {sg_name1} {name}',
|
|
229
225
|
parse_output=True,
|
|
230
226
|
)
|
|
231
227
|
id1 = json_output.get('id')
|
|
232
|
-
self.addCleanup(self.openstack, 'port delete
|
|
228
|
+
self.addCleanup(self.openstack, f'port delete {id1}')
|
|
233
229
|
self.assertEqual(name, json_output.get('name'))
|
|
234
230
|
self.assertEqual([sg_id1], json_output.get('security_group_ids'))
|
|
235
231
|
|
|
236
232
|
raw_output = self.openstack(
|
|
237
|
-
'port set ' '--security-group
|
|
233
|
+
'port set ' f'--security-group {sg_name2} {name}'
|
|
238
234
|
)
|
|
239
235
|
self.assertOutput('', raw_output)
|
|
240
236
|
|
|
241
237
|
json_output = self.openstack(
|
|
242
|
-
'port show
|
|
238
|
+
f'port show {name}',
|
|
243
239
|
parse_output=True,
|
|
244
240
|
)
|
|
245
241
|
self.assertEqual(name, json_output.get('name'))
|
|
@@ -256,15 +252,13 @@ class PortTests(common.NetworkTagTests):
|
|
|
256
252
|
self.assertOutput('', raw_output)
|
|
257
253
|
|
|
258
254
|
json_output = self.openstack(
|
|
259
|
-
'port show
|
|
255
|
+
f'port show {name}',
|
|
260
256
|
parse_output=True,
|
|
261
257
|
)
|
|
262
258
|
self.assertEqual([sg_id2], json_output.get('security_group_ids'))
|
|
263
259
|
|
|
264
260
|
def _create_resource_for_tag_test(self, name, args):
|
|
265
261
|
return self.openstack(
|
|
266
|
-
'{} create --network {} {} {}'
|
|
267
|
-
self.base_command, self.NETWORK_NAME, args, name
|
|
268
|
-
),
|
|
262
|
+
f'{self.base_command} create --network {self.NETWORK_NAME} {args} {name}',
|
|
269
263
|
parse_output=True,
|
|
270
264
|
)
|