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