|
23 | 23 | from openstackclient.tests.image.v2 import fakes as image_fakes |
24 | 24 | from openstackclient.tests import utils |
25 | 25 |
|
26 | | -volume_attachment_server = { |
27 | | - 'device': '/dev/ice', |
28 | | - 'server_id': '1233', |
29 | | -} |
30 | | - |
31 | | -volume_id = "ce26708d-a7f8-4b4b-9861-4a80256615a6" |
32 | | -volume_name = "fake_volume" |
33 | | -volume_description = "fake description" |
34 | | -volume_status = "available" |
35 | | -volume_size = 20 |
36 | | -volume_type = "fake_lvmdriver-1" |
37 | | -volume_metadata = { |
38 | | - 'Alpha': 'a', |
39 | | - 'Beta': 'b', |
40 | | - 'Gamma': 'g', |
41 | | -} |
42 | | -volume_metadata_str = "Alpha='a', Beta='b', Gamma='g'" |
43 | | -volume_snapshot_id = 1 |
44 | | -volume_availability_zone = "nova" |
45 | | -volume_attachments = [volume_attachment_server] |
46 | | - |
47 | | -VOLUME = { |
48 | | - "id": volume_id, |
49 | | - "name": volume_name, |
50 | | - "description": volume_description, |
51 | | - "status": volume_status, |
52 | | - "size": volume_size, |
53 | | - "volume_type": volume_type, |
54 | | - "metadata": volume_metadata, |
55 | | - "snapshot_id": volume_snapshot_id, |
56 | | - "availability_zone": volume_availability_zone, |
57 | | - "attachments": volume_attachments |
58 | | -} |
59 | | - |
60 | | -VOLUME_columns = ( |
61 | | - "attachments", |
62 | | - "availability_zone", |
63 | | - "description", |
64 | | - "id", |
65 | | - "name", |
66 | | - "properties", |
67 | | - "size", |
68 | | - "snapshot_id", |
69 | | - "status", |
70 | | - "type" |
71 | | -) |
72 | | - |
73 | | -VOLUME_data = ( |
74 | | - volume_attachments, |
75 | | - volume_availability_zone, |
76 | | - volume_description, |
77 | | - volume_id, |
78 | | - volume_name, |
79 | | - common_utils.format_dict(volume_metadata), |
80 | | - volume_size, |
81 | | - volume_snapshot_id, |
82 | | - volume_status, |
83 | | - volume_type |
84 | | -) |
85 | | - |
86 | | - |
87 | | -snapshot_id = "cb2d364e-4d1c-451a-8c68-b5bbcb340fb2" |
88 | | -snapshot_name = "fake_snapshot" |
89 | | -snapshot_description = "fake description" |
90 | | -snapshot_size = 10 |
91 | | -snapshot_metadata = { |
92 | | - "foo": "bar" |
93 | | -} |
94 | | -snapshot_volume_id = "bdbae8dc-e6ca-43c0-8076-951cc1b093a4" |
95 | | - |
96 | | -SNAPSHOT = { |
97 | | - "id": snapshot_id, |
98 | | - "name": snapshot_name, |
99 | | - "description": snapshot_description, |
100 | | - "size": snapshot_size, |
101 | | - "status": "available", |
102 | | - "metadata": snapshot_metadata, |
103 | | - "created_at": "2015-06-03T18:49:19.000000", |
104 | | - "volume_id": volume_name |
105 | | -} |
106 | | -EXPECTED_SNAPSHOT = copy.deepcopy(SNAPSHOT) |
107 | | -EXPECTED_SNAPSHOT.pop("metadata") |
108 | | -EXPECTED_SNAPSHOT['properties'] = "foo='bar'" |
109 | | -SNAPSHOT_columns = tuple(sorted(EXPECTED_SNAPSHOT)) |
110 | | -SNAPSHOT_data = tuple((EXPECTED_SNAPSHOT[x] |
111 | | - for x in sorted(EXPECTED_SNAPSHOT))) |
112 | | - |
113 | | - |
114 | | -type_id = "5520dc9e-6f9b-4378-a719-729911c0f407" |
115 | | -type_description = "fake description" |
116 | | -type_name = "fake-lvmdriver-1" |
117 | | -type_extra_specs = { |
118 | | - "foo": "bar" |
119 | | -} |
120 | | - |
121 | | -TYPE = { |
122 | | - 'id': type_id, |
123 | | - 'name': type_name, |
124 | | - 'description': type_description, |
125 | | - 'extra_specs': type_extra_specs |
126 | | -} |
127 | | - |
128 | | -TYPE_columns = tuple(sorted(TYPE)) |
129 | | -TYPE_data = tuple((TYPE[x] for x in sorted(TYPE))) |
130 | | - |
131 | | -formatted_type_properties = "foo='bar'" |
132 | | -TYPE_FORMATTED = { |
133 | | - 'id': type_id, |
134 | | - 'name': type_name, |
135 | | - 'description': type_description, |
136 | | - 'properties': formatted_type_properties |
137 | | -} |
138 | | -TYPE_FORMATTED_columns = tuple(sorted(TYPE_FORMATTED)) |
139 | | -TYPE_FORMATTED_data = tuple((TYPE_FORMATTED[x] for x in |
140 | | - sorted(TYPE_FORMATTED))) |
141 | | - |
142 | | -backup_id = "3c409fe6-4d03-4a06-aeab-18bdcdf3c8f4" |
143 | | -backup_volume_id = "bdbae8dc-e6ca-43c0-8076-951cc1b093a4" |
144 | | -backup_name = "fake_backup" |
145 | | -backup_description = "fake description" |
146 | | -backup_object_count = None |
147 | | -backup_container = None |
148 | | -backup_size = 10 |
149 | | -backup_status = "error" |
150 | | - |
151 | | -BACKUP = { |
152 | | - "id": backup_id, |
153 | | - "name": backup_name, |
154 | | - "volume_id": backup_volume_id, |
155 | | - "description": backup_description, |
156 | | - "object_count": backup_object_count, |
157 | | - "container": backup_container, |
158 | | - "size": backup_size, |
159 | | - "status": backup_status, |
160 | | - "availability_zone": volume_availability_zone, |
161 | | -} |
162 | | - |
163 | | -BACKUP_columns = tuple(sorted(BACKUP)) |
164 | | -BACKUP_data = tuple((BACKUP[x] for x in sorted(BACKUP))) |
165 | | - |
166 | | -qos_id = '6f2be1de-997b-4230-b76c-a3633b59e8fb' |
167 | | -qos_consumer = 'front-end' |
168 | | -qos_default_consumer = 'both' |
169 | | -qos_name = "fake-qos-specs" |
170 | | -qos_specs = { |
171 | | - 'foo': 'bar', |
172 | | - 'iops': '9001' |
173 | | -} |
174 | | -qos_association = { |
175 | | - 'association_type': 'volume_type', |
176 | | - 'name': type_name, |
177 | | - 'id': type_id |
178 | | -} |
179 | | - |
180 | | -QOS = { |
181 | | - 'id': qos_id, |
182 | | - 'consumer': qos_consumer, |
183 | | - 'name': qos_name |
184 | | -} |
185 | | - |
186 | | -QOS_DEFAULT_CONSUMER = { |
187 | | - 'id': qos_id, |
188 | | - 'consumer': qos_default_consumer, |
189 | | - 'name': qos_name |
190 | | -} |
191 | | - |
192 | | -QOS_WITH_SPECS = { |
193 | | - 'id': qos_id, |
194 | | - 'consumer': qos_consumer, |
195 | | - 'name': qos_name, |
196 | | - 'specs': qos_specs |
197 | | -} |
198 | | - |
199 | | -QOS_WITH_ASSOCIATIONS = { |
200 | | - 'id': qos_id, |
201 | | - 'consumer': qos_consumer, |
202 | | - 'name': qos_name, |
203 | | - 'specs': qos_specs, |
204 | | - 'associations': [qos_association] |
205 | | -} |
206 | | - |
207 | | -image_id = 'im1' |
208 | | -image_name = 'graven' |
209 | | -IMAGE = { |
210 | | - 'id': image_id, |
211 | | - 'name': image_name |
212 | | -} |
213 | | - |
214 | 26 |
|
215 | 27 | class FakeTransferClient(object): |
216 | 28 |
|
|
0 commit comments