Coverage for manila/tests/share/drivers/netapp/dataontap/fakes.py: 100%

290 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2026-02-18 22:19 +0000

1# Copyright (c) 2015 Clinton Knight All rights reserved. 

2# Copyright (c) 2015 Tom Barron All rights reserved. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); you may 

5# not use this file except in compliance with the License. You may obtain 

6# a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

13# License for the specific language governing permissions and limitations 

14# under the License. 

15 

16import copy 

17from oslo_serialization import jsonutils 

18 

19from manila.common import constants 

20import manila.tests.share.drivers.netapp.fakes as na_fakes 

21 

22CLUSTER_NAME = 'fake_cluster' 

23CLUSTER_NAME_2 = 'fake_cluster_2' 

24BACKEND_NAME = 'fake_backend_name' 

25BACKEND_NAME_2 = 'fake_backend_name_2' 

26DRIVER_NAME = 'fake_driver_name' 

27APP_VERSION = 'fake_app_vsersion' 

28HOST_NAME = 'fake_host' 

29POOL_NAME = 'fake_pool' 

30FLEXGROUP_STYLE_EXTENDED = 'flexgroup' 

31POOL_NAME_2 = 'fake_pool_2' 

32VSERVER1 = 'fake_vserver_1' 

33VSERVER2 = 'fake_vserver_2' 

34LICENSES = ('base', 'cifs', 'fcp', 'flexclone', 'iscsi', 'nfs', 'snapmirror', 

35 'snaprestore', 'snapvault') 

36VOLUME_NAME_TEMPLATE = 'share_%(share_id)s' 

37VSERVER_NAME_TEMPLATE = 'os_%s' 

38AGGREGATE_NAME_SEARCH_PATTERN = '(.*)' 

39SHARE_NAME = 'share_7cf7c200_d3af_4e05_b87e_9167c95dfcad' 

40SHARE_NAME2 = 'share_d24e7257_124e_4fb6_b05b_d384f660bc85' 

41SHARE_INSTANCE_NAME = 'share_d24e7257_124e_4fb6_b05b_d384f660bc85' 

42FLEXVOL_NAME = 'fake_volume' 

43FLEXVOL_NAME_1 = 'fake_volume_1' 

44JUNCTION_PATH = '/%s' % FLEXVOL_NAME 

45EXPORT_LOCATION = '%s:%s' % (HOST_NAME, JUNCTION_PATH) 

46SNAPSHOT_NAME = 'fake_snapshot' 

47SNAPSHOT_ACCESS_TIME = '1466455782' 

48CONSISTENCY_GROUP_NAME = 'fake_consistency_group' 

49SHARE_SIZE = 10 

50TENANT_ID = '24cb2448-13d8-4f41-afd9-eff5c4fd2a57' 

51SHARE_ID = '7cf7c200-d3af-4e05-b87e-9167c95dfcad' 

52SHARE_ID2 = 'b51c5a31-aa5b-4254-9ee8-7d39fa4c8c38' 

53SHARE_ID3 = '1379991d-037b-4897-bf3a-81b4aac72eff' 

54SHARE_ID4 = '1cb41aad-fd9b-4964-8059-646f69de925e' 

55SHARE_ID5 = '2cb41aad-fd9b-4964-8059-646f69de925f' 

56SHARE_INSTANCE_ID = 'd24e7257-124e-4fb6-b05b-d384f660bc85' 

57PARENT_SHARE_ID = '585c3935-2aa9-437c-8bad-5abae1076555' 

58SNAPSHOT_ID = 'de4c9050-e2f9-4ce1-ade4-5ed0c9f26451' 

59CONSISTENCY_GROUP_ID = '65bfa2c9-dc6c-4513-951a-b8d15b453ad8' 

60CONSISTENCY_GROUP_ID2 = '35f5c1ea-45fb-40c4-98ae-2a2a17554159' 

61CG_SNAPSHOT_ID = '6ddd8a6b-5df7-417b-a2ae-3f6e449f4eea' 

62CG_SNAPSHOT_MEMBER_ID1 = '629f79ef-b27e-4596-9737-30f084e5ba29' 

63CG_SNAPSHOT_MEMBER_ID2 = 'e876aa9c-a322-4391-bd88-9266178262be' 

64SERVER_ID = 'd5e90724-6f28-4944-858a-553138bdbd29' 

65FREE_CAPACITY = 10000000000 

66TOTAL_CAPACITY = 20000000000 

67AGGREGATE = 'manila_aggr_1' 

68AGGREGATES = ('manila_aggr_1', 'manila_aggr_2') 

69AGGR_POOL_NAME = 'manila_aggr_1' 

70FLEXGROUP_POOL_NAME = 'flexgroup_pool' 

71ROOT_AGGREGATES = ('root_aggr_1', 'root_aggr_2') 

72ROOT_VOLUME_AGGREGATE = 'manila1' 

73SECURITY_CERT_DEFAULT_EXPIRE_DAYS = 365 

74SECURITY_CERT_LARGE_EXPIRE_DAYS = 3652 

75DELETE_RETENTION_HOURS = 12 

76ROOT_VOLUME = 'root' 

77CLUSTER_NODE = 'cluster1_01' 

78CLUSTER_NODES = ('cluster1_01', 'cluster1_02') 

79NODE_DATA_PORT = 'e0c' 

80NODE_DATA_PORTS = ('e0c', 'e0d') 

81LIF_NAME_TEMPLATE = 'os_%(net_allocation_id)s' 

82SHARE_TYPE_ID = '26e89a5b-960b-46bb-a8cf-0778e653098f' 

83SHARE_TYPE_ID_2 = '2a06887e-25b5-486e-804a-d84c2d806feb' 

84SHARE_TYPE_NAME = 'fake_share_type' 

85IPSPACE = 'fake_ipspace' 

86IPSPACE_ID = '27d38c27-3e8b-4d7d-9d91-fcf295e3ac8f' 

87MTU = 1234 

88DEFAULT_MTU = 1500 

89MANILA_HOST_NAME = '%(host)s@%(backend)s#%(pool)s' % { 

90 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME} 

91MANILA_HOST_NAME_2 = '%(host)s@%(backend)s#%(pool)s' % { 

92 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME_2} 

93MANILA_HOST_NAME_3 = '%(host)s@%(backend)s#%(pool)s' % { 

94 'host': HOST_NAME, 'backend': BACKEND_NAME_2, 'pool': POOL_NAME_2} 

95MANILA_HOST_NAME_AGGR = '%(host)s@%(backend)s#%(pool)s' % { 

96 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': AGGR_POOL_NAME} 

97MANILA_HOST_NAME_FLEXG_AGGR = '%(host)s@%(backend)s#%(pool)s' % { 

98 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': FLEXGROUP_POOL_NAME} 

99SERVER_HOST = '%(host)s@%(backend)s' % { 

100 'host': HOST_NAME, 'backend': BACKEND_NAME} 

101SERVER_HOST_2 = '%(host)s@%(backend)s' % { 

102 'host': HOST_NAME, 'backend': BACKEND_NAME_2} 

103QOS_MAX_EXTRA_SPEC = 'netapp:maxiops' 

104QOS_MIN_EXTRA_SPEC = 'netapp:miniops' 

105QOS_SIZE_DEPENDENT_EXTRA_SPEC = 'netapp:maxbpspergib' 

106QOS_NORMALIZED_SPEC = 'maxiops' 

107QOS_POLICY_GROUP_NAME = 'fake_qos_policy_group_name' 

108FPOLICY_POLICY_NAME = 'fake_fpolicy_name' 

109FPOLICY_EVENT_NAME = 'fake_fpolicy_event_name' 

110FPOLICY_PROTOCOL = 'cifs' 

111FPOLICY_FILE_OPERATIONS = 'create,write,rename' 

112FPOLICY_FILE_OPERATIONS_LIST = ['create', 'write', 'rename'] 

113FPOLICY_ENGINE = 'native' 

114FPOLICY_EXT_TO_INCLUDE = 'avi' 

115FPOLICY_EXT_TO_INCLUDE_LIST = ['avi'] 

116FPOLICY_EXT_TO_EXCLUDE = 'jpg,mp3' 

117FPOLICY_EXT_TO_EXCLUDE_LIST = ['jpg', 'mp3'] 

118BACKUP_TYPE = "fake_backup_type" 

119MOUNT_POINT_NAME = 'fake_mp' 

120VOLUME_EFFICIENCY_POLICY_NAME = 'fake_volume_efficiency_policy' 

121 

122JOB_ID = '123' 

123JOB_STATE = 'success' 

124 

125CLIENT_KWARGS = { 

126 'username': 'admin', 

127 'trace': False, 

128 'hostname': '127.0.0.1', 

129 'vserver': None, 

130 'transport_type': 'https', 

131 'ssl_cert_path': '/etc/ssl/certs/', 

132 'password': 'pass', 

133 'private_key_file': '/fake_private_key.pem', 

134 'certificate_file': '/fake_certificate.pem', 

135 'ca_certificate_file': '/fake_ca_certificate.crt', 

136 'certificate_host_validation': False, 

137 'port': '443', 

138 'api_trace_pattern': '(.*)', 

139} 

140 

141SHARE = { 

142 'id': SHARE_ID, 

143 'host': MANILA_HOST_NAME, 

144 'project_id': TENANT_ID, 

145 'name': SHARE_NAME, 

146 'mount_point_name': MOUNT_POINT_NAME, 

147 'size': SHARE_SIZE, 

148 'share_proto': 'fake', 

149 'share_type_id': 'fake_share_type_id', 

150 'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0', 

151 'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86', 

152 'network_info': { 

153 'network_allocations': [{'ip_address': 'ip'}] 

154 }, 

155 'replica_state': constants.REPLICA_STATE_ACTIVE, 

156 'status': constants.STATUS_AVAILABLE, 

157 'share_server': None, 

158 'encrypt': False, 

159 'share_id': SHARE_ID, 

160} 

161 

162SHARE_2 = { 

163 'id': SHARE_ID, 

164 'host': MANILA_HOST_NAME_AGGR, 

165 'project_id': TENANT_ID, 

166 'name': SHARE_NAME, 

167 'size': SHARE_SIZE, 

168 'share_proto': 'fake', 

169 'share_type_id': 'fake_share_type_id', 

170 'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0', 

171 'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86', 

172 'network_info': { 

173 'network_allocations': [{'ip_address': 'ip'}] 

174 }, 

175 'replica_state': constants.REPLICA_STATE_ACTIVE, 

176 'status': constants.STATUS_AVAILABLE, 

177 'share_server': None, 

178 'encrypt': False, 

179 'share_id': SHARE_ID, 

180} 

181 

182SHARE_FLEXGROUP = { 

183 'id': SHARE_ID, 

184 'host': MANILA_HOST_NAME_FLEXG_AGGR, 

185 'project_id': TENANT_ID, 

186 'name': SHARE_NAME, 

187 'size': SHARE_SIZE, 

188 'share_proto': 'fake', 

189 'share_type_id': 'fake_share_type_id', 

190 'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0', 

191 'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86', 

192 'network_info': { 

193 'network_allocations': [{'ip_address': 'ip'}] 

194 }, 

195 'replica_state': constants.REPLICA_STATE_ACTIVE, 

196 'status': constants.STATUS_AVAILABLE, 

197 'share_server': None, 

198 'encrypt': False, 

199 'share_id': SHARE_ID, 

200} 

201 

202SHARE_INSTANCE = { 

203 'id': SHARE_INSTANCE_ID, 

204 'share_id': SHARE_ID, 

205 'host': MANILA_HOST_NAME, 

206 'project_id': TENANT_ID, 

207 'mount_point_name': MOUNT_POINT_NAME, 

208 'name': SHARE_INSTANCE_NAME, 

209 'size': SHARE_SIZE, 

210 'share_proto': 'fake', 

211 'share_type_id': SHARE_TYPE_ID, 

212 'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0', 

213 'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86', 

214 'replica_state': constants.REPLICA_STATE_ACTIVE, 

215 'status': constants.STATUS_AVAILABLE 

216} 

217 

218SHARE_INSTANCE_WITH_ENCRYPTION = { 

219 'id': SHARE_INSTANCE_ID, 

220 'share_id': SHARE_ID, 

221 'host': MANILA_HOST_NAME, 

222 'project_id': TENANT_ID, 

223 'mount_point_name': MOUNT_POINT_NAME, 

224 'name': SHARE_INSTANCE_NAME, 

225 'size': SHARE_SIZE, 

226 'share_proto': 'fake', 

227 'share_type_id': SHARE_TYPE_ID, 

228 'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0', 

229 'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86', 

230 'replica_state': constants.REPLICA_STATE_ACTIVE, 

231 'status': constants.STATUS_AVAILABLE, 

232 'encryption_key_ref': 'fake_key_ref' 

233} 

234 

235FLEXVOL_TO_MANAGE = { 

236 'aggregate': POOL_NAME, 

237 'junction-path': '/%s' % FLEXVOL_NAME, 

238 'name': FLEXVOL_NAME, 

239 'type': 'rw', 

240 'style': 'flex', 

241 'size': '1610612736', # rounds up to 2 GB 

242 'style-extended': FLEXGROUP_STYLE_EXTENDED, 

243} 

244 

245FLEXVOL_WITHOUT_QOS = copy.deepcopy(FLEXVOL_TO_MANAGE) 

246FLEXVOL_WITHOUT_QOS.update({'qos-policy-group-name': None}) 

247FLEXVOL_WITH_QOS = copy.deepcopy(FLEXVOL_TO_MANAGE) 

248FLEXVOL_WITH_QOS.update({'qos-policy-group-name': QOS_POLICY_GROUP_NAME}) 

249 

250QOS_POLICY_GROUP = { 

251 'policy-group': QOS_POLICY_GROUP_NAME, 

252 'vserver': VSERVER1, 

253 'max-throughput': '3000iops', 

254 'min-throughput': '20iops', 

255 'num-workloads': 1, 

256} 

257 

258FLEXVOL = { 

259 'aggregate': POOL_NAME, 

260 'junction-path': '/%s' % FLEXVOL_NAME, 

261 'name': FLEXVOL_NAME, 

262 'type': 'rw', 

263 'style': 'flex', 

264 'size': '1610612736', # rounds down to 1 GB, 

265 'owning-vserver-name': VSERVER1, 

266} 

267 

268SHARE_TYPE_EXTRA_SPEC = { 

269 'snapshot_support': True, 

270 'create_share_from_snapshot_support': True, 

271 'revert_to_snapshot_support': True, 

272 'mount_snapshot_support': False, 

273 'driver_handles_share_servers': True, 

274 'availability_zones': [], 

275} 

276 

277EXTRA_SPEC = { 

278 'netapp:thin_provisioned': 'true', 

279 'netapp:snapshot_policy': 'default', 

280 'netapp:language': 'en-US', 

281 'netapp:dedup': 'True', 

282 'netapp:compression': 'false', 

283 'netapp:max_files': 5000, 

284 'netapp:split_clone_on_create': 'true', 

285 'netapp_disk_type': 'FCAL', 

286 'netapp_raid_type': 'raid4', 

287 'netapp_flexvol_encryption': 'true', 

288 'netapp:tcp_max_xfer_size': 100, 

289 'netapp:udp_max_xfer_size': 100, 

290 'netapp:adaptive_qos_policy_group': None, 

291 'netapp:snaplock_type': "compliance", 

292 'netapp:snaplock_autocommit_period': '4months', 

293 'netapp:snaplock_min_retention_period': '30minutes', 

294 'netapp:snaplock_max_retention_period': '2years', 

295 'netapp:snaplock_default_retention_period': '2months' 

296 

297} 

298 

299EXTRA_SPEC_WITH_REPLICATION = copy.copy(EXTRA_SPEC) 

300EXTRA_SPEC_WITH_REPLICATION.update({ 

301 'replication_type': 'dr' 

302}) 

303 

304EXTRA_SPEC_WITH_FPOLICY = copy.copy(EXTRA_SPEC) 

305EXTRA_SPEC_WITH_FPOLICY.update( 

306 {'fpolicy_extensions_to_include': FPOLICY_EXT_TO_INCLUDE, 

307 'fpolicy_extensions_to_exclude': FPOLICY_EXT_TO_EXCLUDE, 

308 'fpolicy_file_operations': FPOLICY_FILE_OPERATIONS}) 

309 

310NFS_CONFIG_DEFAULT = { 

311 'tcp-max-xfer-size': 65536, 

312 'udp-max-xfer-size': 32768, 

313} 

314 

315NFS_CONFIG_TCP_MAX_DDT = { 

316 'extra_specs': { 

317 'netapp:tcp_max_xfer_size': 100, 

318 }, 

319 'expected': { 

320 'tcp-max-xfer-size': 100, 

321 'udp-max-xfer-size': NFS_CONFIG_DEFAULT['udp-max-xfer-size'], 

322 } 

323} 

324 

325NFS_CONFIG_UDP_MAX_DDT = { 

326 'extra_specs': { 

327 'netapp:udp_max_xfer_size': 100, 

328 }, 

329 'expected': { 

330 'tcp-max-xfer-size': NFS_CONFIG_DEFAULT['tcp-max-xfer-size'], 

331 'udp-max-xfer-size': 100, 

332 } 

333} 

334 

335NFS_CONFIG_TCP_UDP_MAX = { 

336 'tcp-max-xfer-size': 100, 

337 'udp-max-xfer-size': 100, 

338} 

339 

340NFS_CONFIG_TCP_MAX = { 

341 'tcp-max-xfer-size': 100, 

342 'udp-max-xfer-size': NFS_CONFIG_DEFAULT['udp-max-xfer-size'], 

343} 

344 

345NFS_CONFIG_UDP_MAX = { 

346 'tcp-max-xfer-size': NFS_CONFIG_DEFAULT['tcp-max-xfer-size'], 

347 'udp-max-xfer-size': 100, 

348} 

349 

350NFS_CONFIG_TCP_UDP_MAX_DDT = { 

351 'extra_specs': { 

352 'netapp:tcp_max_xfer_size': 100, 

353 'netapp:udp_max_xfer_size': 100, 

354 }, 

355 'expected': NFS_CONFIG_TCP_UDP_MAX, 

356} 

357 

358SHARE_GROUP_REF = { 

359 'share_types': [ 

360 {'share_type_id': 'id1'}, 

361 {'share_type_id': 'id2'}, 

362 {'share_type_id': 'id3'}, 

363 ], 

364} 

365 

366EXTRA_SPEC_WITH_QOS = copy.deepcopy(EXTRA_SPEC) 

367EXTRA_SPEC_WITH_QOS.update({ 

368 'qos': True, 

369 QOS_MAX_EXTRA_SPEC: '3000', 

370 QOS_MIN_EXTRA_SPEC: '20', 

371}) 

372 

373EXTRA_SPEC_WITH_FPOLICY = copy.deepcopy(EXTRA_SPEC) 

374EXTRA_SPEC_WITH_FPOLICY.update( 

375 {'netapp:fpolicy_extensions_to_include': FPOLICY_EXT_TO_INCLUDE, 

376 'netapp:fpolicy_extensions_to_exclude': FPOLICY_EXT_TO_EXCLUDE, 

377 'netapp:fpolicy_file_operations': FPOLICY_FILE_OPERATIONS}) 

378 

379EXTRA_SPEC_WITH_SIZE_DEPENDENT_QOS = copy.deepcopy(EXTRA_SPEC) 

380EXTRA_SPEC_WITH_SIZE_DEPENDENT_QOS.update({ 

381 'qos': True, 

382 QOS_SIZE_DEPENDENT_EXTRA_SPEC: '1000', 

383}) 

384 

385PROVISIONING_OPTIONS = { 

386 'thin_provisioned': True, 

387 'snapshot_policy': 'default', 

388 'language': 'en-US', 

389 'dedup_enabled': True, 

390 'compression_enabled': False, 

391 'max_files': 5000, 

392 'split': True, 

393 'encrypt': False, 

394 'hide_snapdir': False, 

395 'adaptive_qos_policy_group': None, 

396} 

397 

398PROVISIONING_OPTIONS_WITH_QOS = copy.deepcopy(PROVISIONING_OPTIONS) 

399PROVISIONING_OPTIONS_WITH_QOS.update( 

400 {'qos_policy_group': QOS_POLICY_GROUP_NAME}) 

401 

402PROVISIONING_OPTS_WITH_ADAPT_QOS = copy.deepcopy(PROVISIONING_OPTIONS) 

403PROVISIONING_OPTS_WITH_ADAPT_QOS.update( 

404 {'adaptive_qos_policy_group': QOS_POLICY_GROUP_NAME}) 

405 

406PROVISIONING_OPTIONS_WITH_FPOLICY = copy.deepcopy(PROVISIONING_OPTIONS) 

407PROVISIONING_OPTIONS_WITH_FPOLICY.update( 

408 {'fpolicy_extensions_to_include': FPOLICY_EXT_TO_INCLUDE, 

409 'fpolicy_extensions_to_exclude': FPOLICY_EXT_TO_EXCLUDE, 

410 'fpolicy_file_operations': FPOLICY_FILE_OPERATIONS}) 

411 

412PROVISIONING_OPTIONS_INVALID_FPOLICY = copy.deepcopy(PROVISIONING_OPTIONS) 

413PROVISIONING_OPTIONS_INVALID_FPOLICY.update( 

414 {'fpolicy_file_operations': FPOLICY_FILE_OPERATIONS}) 

415 

416PROVISIONING_OPTIONS_BOOLEAN = { 

417 'thin_provisioned': True, 

418 'dedup_enabled': False, 

419 'compression_enabled': False, 

420 'split': False, 

421 'hide_snapdir': False, 

422} 

423 

424PROVISIONING_OPTIONS_BOOLEAN_THIN_PROVISIONED_TRUE = { 

425 'thin_provisioned': True, 

426 'snapshot_policy': None, 

427 'language': None, 

428 'dedup_enabled': False, 

429 'compression_enabled': False, 

430 'max_files': None, 

431 'split': False, 

432 'encrypt': False, 

433} 

434 

435PROVISIONING_OPTIONS_STRING = { 

436 'snapshot_policy': 'default', 

437 'language': 'en-US', 

438 'max_files': 5000, 

439 'max_files_multiplier': 4.2, 

440 'adaptive_qos_policy_group': None, 

441 'fpolicy_extensions_to_exclude': None, 

442 'fpolicy_extensions_to_include': None, 

443 'fpolicy_file_operations': None, 

444 'efficiency_policy': None, 

445 'snaplock_type': None, 

446 'snaplock_autocommit_period': None, 

447 'snaplock_min_retention_period': None, 

448 'snaplock_max_retention_period': None, 

449 'snaplock_default_retention_period': None, 

450} 

451 

452PROVISIONING_OPTIONS_STRING_MISSING_SPECS = { 

453 'snapshot_policy': 'default', 

454 'language': 'en-US', 

455 'max_files': None, 

456 'max_files_multiplier': None, 

457 'adaptive_qos_policy_group': None, 

458 'fpolicy_extensions_to_exclude': None, 

459 'fpolicy_extensions_to_include': None, 

460 'fpolicy_file_operations': None, 

461 'efficiency_policy': None, 

462 'snaplock_type': None, 

463 'snaplock_autocommit_period': None, 

464 'snaplock_min_retention_period': None, 

465 'snaplock_max_retention_period': None, 

466 'snaplock_default_retention_period': None, 

467} 

468 

469PROVISIONING_OPTIONS_STRING_DEFAULT = { 

470 'snapshot_policy': None, 

471 'language': None, 

472 'max_files': None, 

473 'max_files_multiplier': None, 

474 'adaptive_qos_policy_group': None, 

475 'fpolicy_extensions_to_exclude': None, 

476 'fpolicy_extensions_to_include': None, 

477 'fpolicy_file_operations': None, 

478 'efficiency_policy': None, 

479 'snaplock_type': None, 

480 'snaplock_autocommit_period': None, 

481 'snaplock_min_retention_period': None, 

482 'snaplock_max_retention_period': None, 

483 'snaplock_default_retention_period': None, 

484} 

485 

486SHORT_BOOLEAN_EXTRA_SPEC = { 

487 'netapp:thin_provisioned': 'true', 

488} 

489 

490STRING_EXTRA_SPEC = { 

491 'netapp:snapshot_policy': 'default', 

492 'netapp:language': 'en-US', 

493 'netapp:max_files': 5000, 

494 'netapp:max_files_multiplier': 4.2, 

495 'netapp:adaptive_qos_policy_group': None, 

496 'netapp:efficiency_policy': None, 

497} 

498 

499SHORT_STRING_EXTRA_SPEC = { 

500 'netapp:snapshot_policy': 'default', 

501 'netapp:language': 'en-US', 

502 'netapp:adaptive_qos_policy_group': None, 

503} 

504 

505INVALID_EXTRA_SPEC = { 

506 'netapp:thin_provisioned': 'ture', 

507 'netapp:snapshot_policy': 'wrong_default', 

508 'netapp:language': 'abc', 

509} 

510 

511INVALID_EXTRA_SPEC_COMBO = { 

512 'netapp:dedup': 'false', 

513 'netapp:compression': 'true' 

514} 

515 

516INVALID_MAX_FILE_EXTRA_SPEC = { 

517 'netapp:max_files': -1, 

518} 

519 

520INVALID_TCP_MAX_XFER_SIZE_EXTRA_SPEC = { 

521 'netapp:tcp_max_xfer_size': -1, 

522} 

523 

524INVALID_UDP_MAX_XFER_SIZE_EXTRA_SPEC = { 

525 'netapp:udp_max_xfer_size': -1, 

526} 

527 

528EMPTY_EXTRA_SPEC = {} 

529 

530SHARE_TYPE = { 

531 'id': SHARE_TYPE_ID, 

532 'name': SHARE_TYPE_NAME, 

533 'extra_specs': EXTRA_SPEC 

534} 

535 

536OVERLAPPING_EXTRA_SPEC = { 

537 'compression': '<is> True', 

538 'netapp:compression': 'true', 

539 'dedupe': '<is> True', 

540 'netapp:dedup': 'false', 

541 'thin_provisioning': '<is> False', 

542 'netapp:thin_provisioned': 'true', 

543} 

544 

545REMAPPED_OVERLAPPING_EXTRA_SPEC = { 

546 'netapp:compression': 'true', 

547 'netapp:dedup': 'true', 

548 'netapp:thin_provisioned': 'false', 

549} 

550 

551VOLUME_AUTOSIZE_ATTRS = { 

552 'mode': 'off', 

553 'grow-threshold-percent': '85', 

554 'shrink-threshold-percent': '50', 

555 'maximum-size': '1258288', 

556 'minimum-size': '1048576', 

557} 

558 

559USER_NETWORK_ALLOCATIONS = [ 

560 { 

561 'id': '132dbb10-9a36-46f2-8d89-3d909830c356', 

562 'ip_address': '10.10.10.10', 

563 'cidr': '10.10.10.0/24', 

564 'segmentation_id': '1000', 

565 'network_type': 'vlan', 

566 'label': 'user', 

567 'mtu': MTU, 

568 'gateway': '10.10.10.1', 

569 }, 

570 { 

571 'id': '7eabdeed-bad2-46ea-bd0f-a33884c869e0', 

572 'ip_address': '10.10.10.20', 

573 'cidr': '10.10.10.0/24', 

574 'segmentation_id': '1000', 

575 'network_type': 'vlan', 

576 'label': 'user', 

577 'mtu': MTU, 

578 'gateway': '10.10.10.1', 

579 } 

580] 

581 

582USER_NETWORK_ALLOCATIONS_IPV6 = [ 

583 { 

584 'id': '234dbb10-9a36-46f2-8d89-3d909830c356', 

585 'ip_address': 'fd68:1a09:66ab:8d51:0:10:0:1', 

586 'cidr': 'fd68:1a09:66ab:8d51::/64', 

587 'segmentation_id': '2000', 

588 'network_type': 'vlan', 

589 'label': 'user', 

590 'mtu': MTU, 

591 'gateway': 'fd68:1a09:66ab:8d51:0:0:0:1', 

592 }, 

593 { 

594 'id': '6677deed-bad2-46ea-bd0f-a33884c869e0', 

595 'ip_address': 'fd68:1a09:66ab:8d51:0:10:0:2', 

596 'cidr': 'fd68:1a09:66ab:8d51::/64', 

597 'segmentation_id': '2000', 

598 'network_type': 'vlan', 

599 'label': 'user', 

600 'mtu': MTU, 

601 'gateway': 'fd68:1a09:66ab:8d51:0:0:0:1', 

602 } 

603] 

604 

605ADMIN_NETWORK_ALLOCATIONS = [ 

606 { 

607 'id': '132dbb10-9a36-46f2-8d89-3d909830c356', 

608 'ip_address': '10.10.20.10', 

609 'cidr': '10.10.20.0/24', 

610 'segmentation_id': None, 

611 'network_type': 'flat', 

612 'label': 'admin', 

613 'mtu': MTU, 

614 'gateway': '10.10.20.1' 

615 }, 

616] 

617 

618NETWORK_INFO = { 

619 'server_id': '56aafd02-4d44-43d7-b784-57fc88167224', 

620 'security_services': ['fake_ldap', 'fake_kerberos', 'fake_ad', ], 

621 'network_allocations': USER_NETWORK_ALLOCATIONS, 

622 'admin_network_allocations': ADMIN_NETWORK_ALLOCATIONS, 

623 'neutron_net_id': '4eff22ca-5ad2-454d-a000-aadfd7b40b39', 

624 'neutron_subnet_id': '62bf1c2c-18eb-421b-8983-48a6d39aafe0', 

625 'segmentation_id': '1000', 

626 'network_type': 'vlan' 

627} 

628NETWORK_INFO_LIST = [NETWORK_INFO] 

629NETWORK_INFO_NETMASK = '255.255.255.0' 

630 

631SHARE_SERVER = { 

632 'id': 'fake_id', 

633 'share_network_id': 'c5b3a865-56d0-4d88-abe5-879965e099c9', 

634 'identifier': 'fake_id', 

635 'backend_details': { 

636 'vserver_name': VSERVER1 

637 }, 

638 'network_allocations': (USER_NETWORK_ALLOCATIONS + 

639 ADMIN_NETWORK_ALLOCATIONS), 

640 'host': SERVER_HOST, 

641 'share_network_subnets': [{ 

642 'neutron_net_id': 'fake_neutron_net_id', 

643 'neutron_subnet_id': 'fake_neutron_subnet_id' 

644 }] 

645} 

646 

647SHARE_SERVER_2 = { 

648 'id': 'fake_id_2', 

649 'source_share_server_id': 'fake_src_share_server_id_2', 

650 'share_network_id': 'c5b3a865-56d0-4d88-abe5-879965e099c9', 

651 'backend_details': { 

652 'vserver_name': VSERVER2 

653 }, 

654 'network_allocations': (USER_NETWORK_ALLOCATIONS + 

655 ADMIN_NETWORK_ALLOCATIONS), 

656 'host': SERVER_HOST_2, 

657 'share_network_subnets': [{ 

658 'neutron_net_id': 'fake_neutron_net_id_2', 

659 'neutron_subnet_id': 'fake_neutron_subnet_id_2' 

660 }] 

661} 

662 

663VSERVER_INFO = { 

664 'name': 'fake_vserver_name', 

665 'subtype': 'default', 

666 'operational_state': 'running', 

667 'state': 'running', 

668} 

669 

670SHARE_SERVER_NFS_TCP = { 

671 'id': 'fake_nfs_id_tcp', 

672 'backend_details': { 

673 'vserver_name': VSERVER2, 

674 'nfs_config': jsonutils.dumps(NFS_CONFIG_TCP_MAX), 

675 }, 

676 'host': 'fake_host@fake_backend', 

677} 

678 

679SHARE_SERVER_NFS_UDP = { 

680 'id': 'fake_nfs_id_udp', 

681 'backend_details': { 

682 'vserver_name': VSERVER2, 

683 'nfs_config': jsonutils.dumps(NFS_CONFIG_UDP_MAX), 

684 }, 

685 'host': 'fake_host@fake_backend', 

686} 

687 

688SHARE_SERVER_NFS_TCP_UDP = { 

689 'id': 'fake_nfs_id_tcp_udp', 

690 'backend_details': { 

691 'vserver_name': VSERVER2, 

692 'nfs_config': jsonutils.dumps(NFS_CONFIG_TCP_UDP_MAX), 

693 }, 

694 'host': 'fake_host@fake_backend', 

695} 

696 

697SHARE_SERVER_NO_NFS_NONE = { 

698 'id': 'fake_no_nfs_id_none', 

699 'backend_details': { 

700 'vserver_name': VSERVER2, 

701 }, 

702 'host': 'fake_host@fake_backend', 

703} 

704 

705SHARE_SERVER_NO_DETAILS = { 

706 'id': 'id_no_datails', 

707 'host': 'fake_host@fake_backend', 

708} 

709 

710SHARE_SERVER_NFS_DEFAULT = { 

711 'id': 'fake_id_nfs_default', 

712 'backend_details': { 

713 'vserver_name': VSERVER2, 

714 'nfs_config': jsonutils.dumps(NFS_CONFIG_DEFAULT), 

715 }, 

716 'host': 'fake_host@fake_backend', 

717} 

718 

719SHARE_SERVERS = [ 

720 SHARE_SERVER_NFS_TCP, 

721 SHARE_SERVER_NFS_UDP, 

722 SHARE_SERVER_NFS_TCP_UDP, 

723 SHARE_SERVER_NFS_DEFAULT, 

724 SHARE_SERVER_NO_NFS_NONE, 

725 SHARE_SERVER_NO_DETAILS, 

726] 

727 

728VSERVER_PEER = [{ 

729 'vserver': VSERVER1, 

730 'peer-vserver': VSERVER2, 

731 'peer-state': 'peered', 

732 'peer-cluster': 'fake_cluster' 

733}] 

734 

735SNAPSHOT = { 

736 'id': SNAPSHOT_ID, 

737 'project_id': TENANT_ID, 

738 'share_id': PARENT_SHARE_ID, 

739 'status': constants.STATUS_CREATING, 

740 'provider_location': None, 

741} 

742 

743SNAPSHOT_TO_MANAGE = { 

744 'id': SNAPSHOT_ID, 

745 'project_id': TENANT_ID, 

746 'share_id': PARENT_SHARE_ID, 

747 'status': constants.STATUS_CREATING, 

748 'provider_location': SNAPSHOT_NAME, 

749} 

750 

751CDOT_SNAPSHOT = { 

752 'name': SNAPSHOT_NAME, 

753 'volume': SHARE_NAME, 

754 'busy': False, 

755 'owners': set(), 

756 'access-time': SNAPSHOT_ACCESS_TIME, 

757 'locked_by_clone': False, 

758} 

759 

760CDOT_SNAPSHOT_BUSY_VOLUME_CLONE = { 

761 'name': SNAPSHOT_NAME, 

762 'volume': SHARE_NAME, 

763 'busy': True, 

764 'owners': {'volume clone'}, 

765 'access-time': SNAPSHOT_ACCESS_TIME, 

766 'locked_by_clone': True, 

767} 

768 

769CDOT_SNAPSHOT_BUSY_SNAPMIRROR = { 

770 'name': SNAPSHOT_NAME, 

771 'volume': SHARE_NAME, 

772 'busy': True, 

773 'owners': {'snapmirror'}, 

774 'access-time': SNAPSHOT_ACCESS_TIME, 

775 'locked_by_clone': False, 

776} 

777 

778CDOT_CLONE_CHILD_1 = 'fake_child_1' 

779CDOT_CLONE_CHILD_2 = 'fake_child_2' 

780CDOT_CLONE_CHILDREN = [ 

781 {'name': CDOT_CLONE_CHILD_1}, 

782 {'name': CDOT_CLONE_CHILD_2}, 

783] 

784 

785SHARE_FOR_CG1 = { 

786 'id': SHARE_ID, 

787 'host': '%(host)s@%(backend)s#%(pool)s' % { 

788 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME}, 

789 'name': 'share_1', 

790 'share_proto': 'NFS', 

791 'source_share_group_snapshot_member_id': None, 

792} 

793 

794SHARE_FOR_CG2 = { 

795 'id': SHARE_ID2, 

796 'host': '%(host)s@%(backend)s#%(pool)s' % { 

797 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME}, 

798 'name': 'share_2', 

799 'share_proto': 'NFS', 

800 'source_share_group_snapshot_member_id': None, 

801} 

802 

803# Clone dest of SHARE_FOR_CG1 

804SHARE_FOR_CG3 = { 

805 'id': SHARE_ID3, 

806 'host': '%(host)s@%(backend)s#%(pool)s' % { 

807 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME}, 

808 'name': 'share3', 

809 'share_proto': 'NFS', 

810 'source_share_group_snapshot_member_id': CG_SNAPSHOT_MEMBER_ID1, 

811} 

812 

813# Clone dest of SHARE_FOR_CG2 

814SHARE_FOR_CG4 = { 

815 'id': SHARE_ID4, 

816 'host': '%(host)s@%(backend)s#%(pool)s' % { 

817 'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME}, 

818 'name': 'share4', 

819 'share_proto': 'NFS', 

820 'source_share_group_snapshot_member_id': CG_SNAPSHOT_MEMBER_ID2, 

821} 

822 

823EMPTY_CONSISTENCY_GROUP = { 

824 'cgsnapshots': [], 

825 'description': 'fake description', 

826 'host': '%(host)s@%(backend)s' % { 

827 'host': HOST_NAME, 'backend': BACKEND_NAME}, 

828 'id': CONSISTENCY_GROUP_ID, 

829 'name': CONSISTENCY_GROUP_NAME, 

830 'shares': [], 

831} 

832 

833CONSISTENCY_GROUP = { 

834 'cgsnapshots': [], 

835 'description': 'fake description', 

836 'host': '%(host)s@%(backend)s' % { 

837 'host': HOST_NAME, 'backend': BACKEND_NAME}, 

838 'id': CONSISTENCY_GROUP_ID, 

839 'name': CONSISTENCY_GROUP_NAME, 

840 'shares': [SHARE_FOR_CG1, SHARE_FOR_CG2], 

841} 

842 

843CONSISTENCY_GROUP_DEST = { 

844 'cgsnapshots': [], 

845 'description': 'fake description', 

846 'host': '%(host)s@%(backend)s' % { 

847 'host': HOST_NAME, 'backend': BACKEND_NAME}, 

848 'id': CONSISTENCY_GROUP_ID, 

849 'name': CONSISTENCY_GROUP_NAME, 

850 'shares': [SHARE_FOR_CG3, SHARE_FOR_CG4], 

851} 

852 

853CG_SNAPSHOT_MEMBER_1 = { 

854 'cgsnapshot_id': CG_SNAPSHOT_ID, 

855 'id': CG_SNAPSHOT_MEMBER_ID1, 

856 'share_id': SHARE_ID, 

857 'share_proto': 'NFS', 

858 'size': SHARE_SIZE, 

859} 

860 

861CG_SNAPSHOT_MEMBER_2 = { 

862 'cgsnapshot_id': CG_SNAPSHOT_ID, 

863 'id': CG_SNAPSHOT_MEMBER_ID2, 

864 'share_id': SHARE_ID2, 

865 'share_proto': 'NFS', 

866 'size': SHARE_SIZE, 

867} 

868 

869CG_SNAPSHOT = { 

870 'share_group_snapshot_members': [CG_SNAPSHOT_MEMBER_1, 

871 CG_SNAPSHOT_MEMBER_2], 

872 'share_group': CONSISTENCY_GROUP, 

873 'share_group_id': CONSISTENCY_GROUP_ID, 

874 'id': CG_SNAPSHOT_ID, 

875 'project_id': TENANT_ID, 

876} 

877 

878COLLATED_CGSNAPSHOT_INFO = [ 

879 { 

880 'share': SHARE_FOR_CG3, 

881 'snapshot': { 

882 'share_id': SHARE_ID, 

883 'id': CG_SNAPSHOT_ID, 

884 'size': SHARE_SIZE, 

885 } 

886 }, 

887 { 

888 'share': SHARE_FOR_CG4, 

889 'snapshot': { 

890 'share_id': SHARE_ID2, 

891 'id': CG_SNAPSHOT_ID, 

892 'size': SHARE_SIZE, 

893 } 

894 }, 

895] 

896 

897IDENTIFIER = 'c5b3a865-56d0-4d88-dke5-853465e099c9' 

898 

899LIF_NAMES = [] 

900LIF_ADDRESSES = ['10.10.10.10', '10.10.10.20'] 

901LIFS = ( 

902 {'address': LIF_ADDRESSES[0], 

903 'administrative-status': 'up', 

904 'home-node': CLUSTER_NODES[0], 

905 'home-port': 'e0c', 

906 'interface-name': 'os_132dbb10-9a36-46f2-8d89-3d909830c356', 

907 'netmask': NETWORK_INFO_NETMASK, 

908 'role': 'data', 

909 'vserver': VSERVER1 

910 }, 

911 {'address': LIF_ADDRESSES[1], 

912 'administrative-status': 'up', 

913 'home-node': CLUSTER_NODES[1], 

914 'home-port': 'e0c', 

915 'interface-name': 'os_7eabdeed-bad2-46ea-bd0f-a33884c869e0', 

916 'netmask': NETWORK_INFO_NETMASK, 

917 'role': 'data', 

918 'vserver': VSERVER1 

919 }, 

920) 

921 

922INTERFACE_ADDRESSES_WITH_METADATA = { 

923 LIF_ADDRESSES[0]: { 

924 'is_admin_only': False, 

925 'preferred': True, 

926 }, 

927 LIF_ADDRESSES[1]: { 

928 'is_admin_only': True, 

929 'preferred': False, 

930 }, 

931} 

932 

933NFS_EXPORTS = [ 

934 { 

935 'path': ':'.join([LIF_ADDRESSES[0], 'fake_export_path']), 

936 'is_admin_only': False, 

937 'metadata': { 

938 'preferred': True, 

939 }, 

940 }, 

941 { 

942 'path': ':'.join([LIF_ADDRESSES[1], 'fake_export_path']), 

943 'is_admin_only': True, 

944 'metadata': { 

945 'preferred': False, 

946 }, 

947 }, 

948] 

949 

950SHARE_ACCESS = { 

951 'access_type': 'user', 

952 'access_to': [LIF_ADDRESSES[0]] 

953} 

954 

955EMS_MESSAGE_0 = { 

956 'computer-name': HOST_NAME, 

957 'event-id': '0', 

958 'event-source': 'Manila driver %s' % DRIVER_NAME, 

959 'app-version': APP_VERSION, 

960 'category': 'provisioning', 

961 'event-description': 'OpenStack Manila connected to cluster node', 

962 'log-level': '5', 

963 'auto-support': 'false' 

964} 

965 

966EMS_MESSAGE_1 = { 

967 'computer-name': HOST_NAME, 

968 'event-id': '1', 

969 'event-source': 'Manila driver %s' % DRIVER_NAME, 

970 'app-version': APP_VERSION, 

971 'category': 'provisioning', 

972 'event-description': '', 

973 'log-level': '5', 

974 'auto-support': 'false' 

975} 

976 

977AGGREGATE_CAPACITIES = { 

978 AGGREGATES[0]: { 

979 'available': 1181116007, # 1.1 GB 

980 'total': 3543348020, # 3.3 GB 

981 'used': 2362232013, # 2.2 GB 

982 }, 

983 AGGREGATES[1]: { 

984 'available': 2147483648, # 2.0 GB 

985 'total': 6442450944, # 6.0 GB 

986 'used': 4294967296, # 4.0 GB 

987 } 

988} 

989 

990FLEXGROUP_POOL_AGGR = [AGGREGATES[0], AGGREGATES[1]] 

991 

992FLEXGROUP_POOL_OPT = { 

993 FLEXGROUP_POOL_NAME: FLEXGROUP_POOL_AGGR, 

994} 

995 

996FLEXGROUP_POOL_OPT_RAW = { 

997 FLEXGROUP_POOL_NAME: '%s %s' % (AGGREGATES[0], AGGREGATES[1]), 

998} 

999 

1000FLEXGROUP_POOL = { 

1001 'pool_name': FLEXGROUP_POOL_NAME, 

1002 'netapp_aggregate': '%s %s' % (AGGREGATES[0], AGGREGATES[1]), 

1003 'total_capacity_gb': 6.6, 

1004 'free_capacity_gb': 2.2, 

1005 'allocated_capacity_gb': 4.39, 

1006 'reserved_percentage': 5, 

1007 'max_over_subscription_ratio': 2.0, 

1008 'dedupe': [True, False], 

1009 'compression': [True, False], 

1010 'thin_provisioning': [True, False], 

1011 'netapp_flexvol_encryption': True, 

1012 'netapp_raid_type': 'raid4 raid_dp', 

1013 'netapp_disk_type': ['FCAL', 'SATA', 'SSD'], 

1014 'netapp_hybrid_aggregate': 'false true', 

1015 'utilization': 50.0, 

1016 'filter_function': FLEXGROUP_POOL_NAME, 

1017 'goodness_function': 'goodness', 

1018 'snapshot_support': True, 

1019 'create_share_from_snapshot_support': True, 

1020 'revert_to_snapshot_support': True, 

1021 'qos': True, 

1022 'security_service_update_support': True, 

1023 'netapp_flexgroup': True, 

1024 'netapp_cluster_name': 'fake_cluster_name', 

1025 'netapp_snaplock_type': ['compliance', 'enterprise'], 

1026} 

1027 

1028FLEXGROUP_AGGR_SET = set(FLEXGROUP_POOL_OPT[FLEXGROUP_POOL_NAME]) 

1029 

1030AGGREGATE_CAPACITIES_VSERVER_CREDS = { 

1031 AGGREGATES[0]: { 

1032 'available': 1181116007, # 1.1 GB 

1033 }, 

1034 AGGREGATES[1]: { 

1035 'available': 2147483648, # 2.0 GB 

1036 } 

1037} 

1038 

1039SSC_INFO = { 

1040 AGGREGATES[0]: { 

1041 'netapp_raid_type': 'raid4', 

1042 'netapp_disk_type': 'FCAL', 

1043 'netapp_hybrid_aggregate': 'false', 

1044 'netapp_aggregate': AGGREGATES[0], 

1045 'netapp_flexgroup': False, 

1046 'netapp_snaplock_type': 'compliance', 

1047 }, 

1048 AGGREGATES[1]: { 

1049 'netapp_raid_type': 'raid_dp', 

1050 'netapp_disk_type': ['SATA', 'SSD'], 

1051 'netapp_hybrid_aggregate': 'true', 

1052 'netapp_aggregate': AGGREGATES[1], 

1053 'netapp_flexgroup': False, 

1054 'netapp_snaplock_type': 'enterprise', 

1055 } 

1056} 

1057 

1058SSC_INFO_MAP = { 

1059 AGGREGATES[0]: { 

1060 'netapp_raid_type': 'raid4', 

1061 'netapp_disk_type': ['FCAL'], 

1062 'netapp_hybrid_aggregate': 'false', 

1063 'netapp_snaplock_type': 'compliance', 

1064 }, 

1065 AGGREGATES[1]: { 

1066 'netapp_raid_type': 'raid_dp', 

1067 'netapp_disk_type': ['SATA', 'SSD'], 

1068 'netapp_hybrid_aggregate': 'true', 

1069 'netapp_snaplock_type': 'enterprise', 

1070 } 

1071} 

1072 

1073SSC_INFO_VSERVER_CREDS = { 

1074 AGGREGATES[0]: { 

1075 'netapp_aggregate': AGGREGATES[0], 

1076 'netapp_flexgroup': False, 

1077 }, 

1078 AGGREGATES[1]: { 

1079 'netapp_aggregate': AGGREGATES[1], 

1080 'netapp_flexgroup': False, 

1081 } 

1082} 

1083 

1084POOLS = [ 

1085 { 

1086 'pool_name': AGGREGATES[0], 

1087 'netapp_aggregate': AGGREGATES[0], 

1088 'total_capacity_gb': 3.3, 

1089 'free_capacity_gb': 1.1, 

1090 'allocated_capacity_gb': 2.2, 

1091 'reserved_percentage': 5, 

1092 'reserved_snapshot_percentage': 2, 

1093 'reserved_share_extend_percentage': 2, 

1094 'max_over_subscription_ratio': 2.0, 

1095 'dedupe': [True, False], 

1096 'compression': [True, False], 

1097 'thin_provisioning': [True, False], 

1098 'netapp_flexvol_encryption': True, 

1099 'netapp_raid_type': 'raid4', 

1100 'netapp_disk_type': 'FCAL', 

1101 'netapp_hybrid_aggregate': 'false', 

1102 'utilization': 30.0, 

1103 'filter_function': 'filter', 

1104 'goodness_function': 'goodness', 

1105 'mount_point_name_support': True, 

1106 'snapshot_support': True, 

1107 'create_share_from_snapshot_support': True, 

1108 'revert_to_snapshot_support': True, 

1109 'qos': True, 

1110 'security_service_update_support': True, 

1111 'share_server_multiple_subnet_support': True, 

1112 'netapp_flexgroup': False, 

1113 'netapp_cluster_name': 'fake_cluster_name', 

1114 'netapp_snaplock_type': 'compliance', 

1115 'share_replicas_migration_support': True, 

1116 'encryption_support': ['share_server'], 

1117 }, 

1118 { 

1119 'pool_name': AGGREGATES[1], 

1120 'netapp_aggregate': AGGREGATES[1], 

1121 'total_capacity_gb': 6.0, 

1122 'free_capacity_gb': 2.0, 

1123 'allocated_capacity_gb': 4.0, 

1124 'reserved_percentage': 5, 

1125 'reserved_snapshot_percentage': 2, 

1126 'reserved_share_extend_percentage': 2, 

1127 'max_over_subscription_ratio': 2.0, 

1128 'dedupe': [True, False], 

1129 'compression': [True, False], 

1130 'thin_provisioning': [True, False], 

1131 'netapp_flexvol_encryption': True, 

1132 'netapp_raid_type': 'raid_dp', 

1133 'netapp_disk_type': ['SATA', 'SSD'], 

1134 'netapp_hybrid_aggregate': 'true', 

1135 'utilization': 42.0, 

1136 'filter_function': 'filter', 

1137 'goodness_function': 'goodness', 

1138 'snapshot_support': True, 

1139 'create_share_from_snapshot_support': True, 

1140 'revert_to_snapshot_support': True, 

1141 'qos': True, 

1142 'security_service_update_support': True, 

1143 'share_server_multiple_subnet_support': True, 

1144 'netapp_flexgroup': False, 

1145 'netapp_cluster_name': 'fake_cluster_name', 

1146 'netapp_snaplock_type': 'compliance', 

1147 'share_replicas_migration_support': True, 

1148 'encryption_support': ['share_server'], 

1149 }, 

1150] 

1151 

1152POOLS_VSERVER_CREDS = [ 

1153 { 

1154 'pool_name': AGGREGATES[0], 

1155 'filter_function': None, 

1156 'goodness_function': None, 

1157 'mount_point_name_support': True, 

1158 'netapp_cluster_name': '', 

1159 'netapp_aggregate': AGGREGATES[0], 

1160 'total_capacity_gb': 'unknown', 

1161 'free_capacity_gb': 1.1, 

1162 'allocated_capacity_gb': 0.0, 

1163 'reserved_percentage': 5, 

1164 'reserved_snapshot_percentage': 2, 

1165 'reserved_share_extend_percentage': 2, 

1166 'max_over_subscription_ratio': 2.0, 

1167 'dedupe': [True, False], 

1168 'compression': [True, False], 

1169 'thin_provisioning': [True, False], 

1170 'netapp_flexvol_encryption': True, 

1171 'utilization': 50.0, 

1172 'snapshot_support': True, 

1173 'create_share_from_snapshot_support': True, 

1174 'revert_to_snapshot_support': True, 

1175 'qos': False, 

1176 'security_service_update_support': True, 

1177 'share_server_multiple_subnet_support': True, 

1178 'netapp_flexgroup': False, 

1179 'share_replicas_migration_support': True, 

1180 'encryption_support': ['share_server'], 

1181 }, 

1182 { 

1183 'pool_name': AGGREGATES[1], 

1184 'netapp_aggregate': AGGREGATES[1], 

1185 'total_capacity_gb': 'unknown', 

1186 'free_capacity_gb': 2.0, 

1187 'allocated_capacity_gb': 0.0, 

1188 'reserved_percentage': 5, 

1189 'reserved_snapshot_percentage': 2, 

1190 'reserved_share_extend_percentage': 2, 

1191 'max_over_subscription_ratio': 2.0, 

1192 'dedupe': [True, False], 

1193 'compression': [True, False], 

1194 'thin_provisioning': [True, False], 

1195 'netapp_flexvol_encryption': True, 

1196 'utilization': 50.0, 

1197 'snapshot_support': True, 

1198 'create_share_from_snapshot_support': True, 

1199 'revert_to_snapshot_support': True, 

1200 'qos': False, 

1201 'security_service_update_support': True, 

1202 'share_server_multiple_subnet_support': True, 

1203 'netapp_flexgroup': False, 

1204 'share_replicas_migration_support': True, 

1205 'encryption_support': ['share_server'], 

1206 }, 

1207] 

1208 

1209SSC_AGGREGATES = [ 

1210 { 

1211 'name': AGGREGATES[0], 

1212 'raid-type': 'raid4', 

1213 'is-hybrid': False, 

1214 'is-home': False, 

1215 'snaplock-type': 'compliance', 

1216 }, 

1217 { 

1218 'name': AGGREGATES[1], 

1219 'raid-type': 'raid_dp', 

1220 'is-hybrid': True, 

1221 'is-home': True, 

1222 'snaplock-type': 'enterprise', 

1223 }, 

1224] 

1225 

1226CLUSTER_INFO = { 

1227 'nodes': CLUSTER_NODES, 

1228 'nve_support': True, 

1229} 

1230 

1231SSC_DISK_TYPES = ['FCAL', ['SATA', 'SSD']] 

1232 

1233NODE = 'cluster1-01' 

1234 

1235COUNTERS_T1 = [ 

1236 { 

1237 'node-name': 'cluster1-01', 

1238 'instance-uuid': 'cluster1-01:kernel:system', 

1239 'avg_processor_busy': '29078861388', 

1240 'instance-name': 'system', 

1241 'timestamp': '1453573776', 

1242 }, { 

1243 'node-name': 'cluster1-01', 

1244 'instance-uuid': 'cluster1-01:kernel:system', 

1245 'cpu_elapsed_time': '1063283283681', 

1246 'instance-name': 'system', 

1247 'timestamp': '1453573776', 

1248 }, { 

1249 'node-name': 'cluster1-01', 

1250 'instance-uuid': 'cluster1-01:kernel:system', 

1251 'cpu_elapsed_time1': '1063283283681', 

1252 'instance-name': 'system', 

1253 'timestamp': '1453573776', 

1254 }, { 

1255 'cp_phase_times:p2a_snap': '714', 

1256 'cp_phase_times:p4_finish': '14897', 

1257 'cp_phase_times:setup': '581', 

1258 'cp_phase_times:p2a_dlog1': '6019', 

1259 'cp_phase_times:p2a_dlog2': '2328', 

1260 'cp_phase_times:p2v_cont': '2479', 

1261 'cp_phase_times:p2v_volinfo': '1138', 

1262 'cp_phase_times:p2v_bm': '3484', 

1263 'cp_phase_times:p2v_fsinfo': '2031', 

1264 'cp_phase_times:p2a_inofile': '356', 

1265 'cp_phase_times': '581,5007,1840,9832,498,0,839,799,1336,2031,0,377,' 

1266 '427,1058,354,3484,5135,1460,1138,2479,356,1373' 

1267 ',6019,9,2328,2257,229,493,1275,0,6059,714,530215,' 

1268 '21603833,0,0,3286,11075940,22001,14897,36', 

1269 'cp_phase_times:p2v_dlog2': '377', 

1270 'instance-name': 'wafl', 

1271 'cp_phase_times:p3_wait': '0', 

1272 'cp_phase_times:p2a_bm': '6059', 

1273 'cp_phase_times:p1_quota': '498', 

1274 'cp_phase_times:p2v_inofile': '839', 

1275 'cp_phase_times:p2a_refcount': '493', 

1276 'cp_phase_times:p2a_fsinfo': '2257', 

1277 'cp_phase_times:p2a_hyabc': '0', 

1278 'cp_phase_times:p2a_volinfo': '530215', 

1279 'cp_phase_times:pre_p0': '5007', 

1280 'cp_phase_times:p2a_hya': '9', 

1281 'cp_phase_times:p0_snap_del': '1840', 

1282 'cp_phase_times:p2a_ino': '1373', 

1283 'cp_phase_times:p2v_df_scores_sub': '354', 

1284 'cp_phase_times:p2v_ino_pub': '799', 

1285 'cp_phase_times:p2a_ipu_bitmap_grow': '229', 

1286 'cp_phase_times:p2v_refcount': '427', 

1287 'timestamp': '1453573776', 

1288 'cp_phase_times:p2v_dlog1': '0', 

1289 'cp_phase_times:p2_finish': '0', 

1290 'cp_phase_times:p1_clean': '9832', 

1291 'node-name': 'cluster1-01', 

1292 'instance-uuid': 'cluster1-01:kernel:wafl', 

1293 'cp_phase_times:p3a_volinfo': '11075940', 

1294 'cp_phase_times:p2a_topaa': '1275', 

1295 'cp_phase_times:p2_flush': '21603833', 

1296 'cp_phase_times:p2v_df_scores': '1460', 

1297 'cp_phase_times:ipu_disk_add': '0', 

1298 'cp_phase_times:p2v_snap': '5135', 

1299 'cp_phase_times:p5_finish': '36', 

1300 'cp_phase_times:p2v_ino_pri': '1336', 

1301 'cp_phase_times:p3v_volinfo': '3286', 

1302 'cp_phase_times:p2v_topaa': '1058', 

1303 'cp_phase_times:p3_finish': '22001', 

1304 }, { 

1305 'node-name': 'cluster1-01', 

1306 'instance-uuid': 'cluster1-01:kernel:wafl', 

1307 'total_cp_msecs': '33309624', 

1308 'instance-name': 'wafl', 

1309 'timestamp': '1453573776', 

1310 }, { 

1311 'domain_busy:kahuna': '2712467226', 

1312 'timestamp': '1453573777', 

1313 'domain_busy:cifs': '434036', 

1314 'domain_busy:raid_exempt': '28', 

1315 'node-name': 'cluster1-01', 

1316 'instance-uuid': 'cluster1-01:kernel:processor0', 

1317 'domain_busy:target': '6460782', 

1318 'domain_busy:nwk_exempt': '20', 

1319 'domain_busy:raid': '722094140', 

1320 'domain_busy:storage': '2253156562', 

1321 'instance-name': 'processor0', 

1322 'domain_busy:cluster': '34', 

1323 'domain_busy:wafl_xcleaner': '51275254', 

1324 'domain_busy:wafl_exempt': '1243553699', 

1325 'domain_busy:protocol': '54', 

1326 'domain_busy': '1028851855595,2712467226,2253156562,5688808118,' 

1327 '722094140,28,6460782,59,434036,1243553699,51275254,' 

1328 '61237441,34,54,11,20,5254181873,13656398235,452215', 

1329 'domain_busy:nwk_legacy': '5254181873', 

1330 'domain_busy:dnscache': '59', 

1331 'domain_busy:exempt': '5688808118', 

1332 'domain_busy:hostos': '13656398235', 

1333 'domain_busy:sm_exempt': '61237441', 

1334 'domain_busy:nwk_exclusive': '11', 

1335 'domain_busy:idle': '1028851855595', 

1336 'domain_busy:ssan_exempt': '452215', 

1337 }, { 

1338 'node-name': 'cluster1-01', 

1339 'instance-uuid': 'cluster1-01:kernel:processor0', 

1340 'processor_elapsed_time': '1063283843318', 

1341 'instance-name': 'processor0', 

1342 'timestamp': '1453573777', 

1343 }, { 

1344 'domain_busy:kahuna': '1978024846', 

1345 'timestamp': '1453573777', 

1346 'domain_busy:cifs': '318584', 

1347 'domain_busy:raid_exempt': '0', 

1348 'node-name': 'cluster1-01', 

1349 'instance-uuid': 'cluster1-01:kernel:processor1', 

1350 'domain_busy:target': '3330956', 

1351 'domain_busy:nwk_exempt': '0', 

1352 'domain_busy:raid': '722235930', 

1353 'domain_busy:storage': '1498890708', 

1354 'instance-name': 'processor1', 

1355 'domain_busy:cluster': '0', 

1356 'domain_busy:wafl_xcleaner': '50122685', 

1357 'domain_busy:wafl_exempt': '1265921369', 

1358 'domain_busy:protocol': '0', 

1359 'domain_busy': '1039557880852,1978024846,1498890708,3734060289,' 

1360 '722235930,0,3330956,0,318584,1265921369,50122685,' 

1361 '36417362,0,0,0,0,2815252976,10274810484,393451', 

1362 'domain_busy:nwk_legacy': '2815252976', 

1363 'domain_busy:dnscache': '0', 

1364 'domain_busy:exempt': '3734060289', 

1365 'domain_busy:hostos': '10274810484', 

1366 'domain_busy:sm_exempt': '36417362', 

1367 'domain_busy:nwk_exclusive': '0', 

1368 'domain_busy:idle': '1039557880852', 

1369 'domain_busy:ssan_exempt': '393451', 

1370 }, { 

1371 'node-name': 'cluster1-01', 

1372 'instance-uuid': 'cluster1-01:kernel:processor1', 

1373 'processor_elapsed_time': '1063283843321', 

1374 'instance-name': 'processor1', 

1375 'timestamp': '1453573777', 

1376 } 

1377] 

1378 

1379COUNTERS_T2 = [ 

1380 { 

1381 'node-name': 'cluster1-01', 

1382 'instance-uuid': 'cluster1-01:kernel:system', 

1383 'avg_processor_busy': '29081228905', 

1384 'instance-name': 'system', 

1385 'timestamp': '1453573834', 

1386 }, { 

1387 'node-name': 'cluster1-01', 

1388 'instance-uuid': 'cluster1-01:kernel:system', 

1389 'cpu_elapsed_time': '1063340792148', 

1390 'instance-name': 'system', 

1391 'timestamp': '1453573834', 

1392 }, { 

1393 'node-name': 'cluster1-01', 

1394 'instance-uuid': 'cluster1-01:kernel:system', 

1395 'cpu_elapsed_time1': '1063340792148', 

1396 'instance-name': 'system', 

1397 'timestamp': '1453573834', 

1398 }, { 

1399 'cp_phase_times:p2a_snap': '714', 

1400 'cp_phase_times:p4_finish': '14897', 

1401 'cp_phase_times:setup': '581', 

1402 'cp_phase_times:p2a_dlog1': '6019', 

1403 'cp_phase_times:p2a_dlog2': '2328', 

1404 'cp_phase_times:p2v_cont': '2479', 

1405 'cp_phase_times:p2v_volinfo': '1138', 

1406 'cp_phase_times:p2v_bm': '3484', 

1407 'cp_phase_times:p2v_fsinfo': '2031', 

1408 'cp_phase_times:p2a_inofile': '356', 

1409 'cp_phase_times': '581,5007,1840,9832,498,0,839,799,1336,2031,0,377,' 

1410 '427,1058,354,3484,5135,1460,1138,2479,356,1373,' 

1411 '6019,9,2328,2257,229,493,1275,0,6059,714,530215,' 

1412 '21604863,0,0,3286,11076392,22001,14897,36', 

1413 'cp_phase_times:p2v_dlog2': '377', 

1414 'instance-name': 'wafl', 

1415 'cp_phase_times:p3_wait': '0', 

1416 'cp_phase_times:p2a_bm': '6059', 

1417 'cp_phase_times:p1_quota': '498', 

1418 'cp_phase_times:p2v_inofile': '839', 

1419 'cp_phase_times:p2a_refcount': '493', 

1420 'cp_phase_times:p2a_fsinfo': '2257', 

1421 'cp_phase_times:p2a_hyabc': '0', 

1422 'cp_phase_times:p2a_volinfo': '530215', 

1423 'cp_phase_times:pre_p0': '5007', 

1424 'cp_phase_times:p2a_hya': '9', 

1425 'cp_phase_times:p0_snap_del': '1840', 

1426 'cp_phase_times:p2a_ino': '1373', 

1427 'cp_phase_times:p2v_df_scores_sub': '354', 

1428 'cp_phase_times:p2v_ino_pub': '799', 

1429 'cp_phase_times:p2a_ipu_bitmap_grow': '229', 

1430 'cp_phase_times:p2v_refcount': '427', 

1431 'timestamp': '1453573834', 

1432 'cp_phase_times:p2v_dlog1': '0', 

1433 'cp_phase_times:p2_finish': '0', 

1434 'cp_phase_times:p1_clean': '9832', 

1435 'node-name': 'cluster1-01', 

1436 'instance-uuid': 'cluster1-01:kernel:wafl', 

1437 'cp_phase_times:p3a_volinfo': '11076392', 

1438 'cp_phase_times:p2a_topaa': '1275', 

1439 'cp_phase_times:p2_flush': '21604863', 

1440 'cp_phase_times:p2v_df_scores': '1460', 

1441 'cp_phase_times:ipu_disk_add': '0', 

1442 'cp_phase_times:p2v_snap': '5135', 

1443 'cp_phase_times:p5_finish': '36', 

1444 'cp_phase_times:p2v_ino_pri': '1336', 

1445 'cp_phase_times:p3v_volinfo': '3286', 

1446 'cp_phase_times:p2v_topaa': '1058', 

1447 'cp_phase_times:p3_finish': '22001', 

1448 }, { 

1449 'node-name': 'cluster1-01', 

1450 'instance-uuid': 'cluster1-01:kernel:wafl', 

1451 'total_cp_msecs': '33311106', 

1452 'instance-name': 'wafl', 

1453 'timestamp': '1453573834', 

1454 }, { 

1455 'domain_busy:kahuna': '2712629374', 

1456 'timestamp': '1453573834', 

1457 'domain_busy:cifs': '434036', 

1458 'domain_busy:raid_exempt': '28', 

1459 'node-name': 'cluster1-01', 

1460 'instance-uuid': 'cluster1-01:kernel:processor0', 

1461 'domain_busy:target': '6461082', 

1462 'domain_busy:nwk_exempt': '20', 

1463 'domain_busy:raid': '722136824', 

1464 'domain_busy:storage': '2253260824', 

1465 'instance-name': 'processor0', 

1466 'domain_busy:cluster': '34', 

1467 'domain_busy:wafl_xcleaner': '51277506', 

1468 'domain_busy:wafl_exempt': '1243637154', 

1469 'domain_busy:protocol': '54', 

1470 'domain_busy': '1028906640232,2712629374,2253260824,5689093500,' 

1471 '722136824,28,6461082,59,434036,1243637154,51277506,' 

1472 '61240335,34,54,11,20,5254491236,13657992139,452215', 

1473 'domain_busy:nwk_legacy': '5254491236', 

1474 'domain_busy:dnscache': '59', 

1475 'domain_busy:exempt': '5689093500', 

1476 'domain_busy:hostos': '13657992139', 

1477 'domain_busy:sm_exempt': '61240335', 

1478 'domain_busy:nwk_exclusive': '11', 

1479 'domain_busy:idle': '1028906640232', 

1480 'domain_busy:ssan_exempt': '452215', 

1481 }, { 

1482 'node-name': 'cluster1-01', 

1483 'instance-uuid': 'cluster1-01:kernel:processor0', 

1484 'processor_elapsed_time': '1063341351916', 

1485 'instance-name': 'processor0', 

1486 'timestamp': '1453573834', 

1487 }, { 

1488 'domain_busy:kahuna': '1978217049', 

1489 'timestamp': '1453573834', 

1490 'domain_busy:cifs': '318584', 

1491 'domain_busy:raid_exempt': '0', 

1492 'node-name': 'cluster1-01', 

1493 'instance-uuid': 'cluster1-01:kernel:processor1', 

1494 'domain_busy:target': '3331147', 

1495 'domain_busy:nwk_exempt': '0', 

1496 'domain_busy:raid': '722276805', 

1497 'domain_busy:storage': '1498984059', 

1498 'instance-name': 'processor1', 

1499 'domain_busy:cluster': '0', 

1500 'domain_busy:wafl_xcleaner': '50126176', 

1501 'domain_busy:wafl_exempt': '1266039846', 

1502 'domain_busy:protocol': '0', 

1503 'domain_busy': '1039613222253,1978217049,1498984059,3734279672,' 

1504 '722276805,0,3331147,0,318584,1266039846,50126176,' 

1505 '36419297,0,0,0,0,2815435865,10276068104,393451', 

1506 'domain_busy:nwk_legacy': '2815435865', 

1507 'domain_busy:dnscache': '0', 

1508 'domain_busy:exempt': '3734279672', 

1509 'domain_busy:hostos': '10276068104', 

1510 'domain_busy:sm_exempt': '36419297', 

1511 'domain_busy:nwk_exclusive': '0', 

1512 'domain_busy:idle': '1039613222253', 

1513 'domain_busy:ssan_exempt': '393451', 

1514 }, { 

1515 'node-name': 'cluster1-01', 

1516 'instance-uuid': 'cluster1-01:kernel:processor1', 

1517 'processor_elapsed_time': '1063341351919', 

1518 'instance-name': 'processor1', 

1519 'timestamp': '1453573834', 

1520 }, 

1521] 

1522 

1523SYSTEM_INSTANCE_UUIDS = ['cluster1-01:kernel:system'] 

1524SYSTEM_INSTANCE_NAMES = ['system'] 

1525 

1526SYSTEM_COUNTERS = [ 

1527 { 

1528 'node-name': 'cluster1-01', 

1529 'instance-uuid': 'cluster1-01:kernel:system', 

1530 'avg_processor_busy': '27877641199', 

1531 'instance-name': 'system', 

1532 'timestamp': '1453524928', 

1533 }, { 

1534 'node-name': 'cluster1-01', 

1535 'instance-uuid': 'cluster1-01:kernel:system', 

1536 'cpu_elapsed_time': '1014438541279', 

1537 'instance-name': 'system', 

1538 'timestamp': '1453524928', 

1539 }, { 

1540 'node-name': 'cluster1-01', 

1541 'instance-uuid': 'cluster1-01:kernel:system', 

1542 'cpu_elapsed_time1': '1014438541279', 

1543 'instance-name': 'system', 

1544 'timestamp': '1453524928', 

1545 }, 

1546] 

1547 

1548 

1549WAFL_INSTANCE_UUIDS = ['cluster1-01:kernel:wafl'] 

1550WAFL_INSTANCE_NAMES = ['wafl'] 

1551 

1552WAFL_COUNTERS = [ 

1553 { 

1554 'cp_phase_times': '563,4844,1731,9676,469,0,821,763,1282,1937,0,359,' 

1555 '418,1048,344,3344,4867,1397,1101,2380,356,1318,' 

1556 '5954,9,2236,2190,228,476,1221,0,5838,696,515588,' 

1557 '20542954,0,0,3122,10567367,20696,13982,36', 

1558 'node-name': 'cluster1-01', 

1559 'instance-uuid': 'cluster1-01:kernel:wafl', 

1560 'instance-name': 'wafl', 

1561 'timestamp': '1453523339', 

1562 }, { 

1563 'node-name': 'cluster1-01', 

1564 'instance-uuid': 'cluster1-01:kernel:wafl', 

1565 'total_cp_msecs': '31721222', 

1566 'instance-name': 'wafl', 

1567 'timestamp': '1453523339', 

1568 }, 

1569] 

1570 

1571WAFL_CP_PHASE_TIMES_COUNTER_INFO = { 

1572 'labels': [ 

1573 'SETUP', 'PRE_P0', 'P0_SNAP_DEL', 'P1_CLEAN', 'P1_QUOTA', 

1574 'IPU_DISK_ADD', 'P2V_INOFILE', 'P2V_INO_PUB', 'P2V_INO_PRI', 

1575 'P2V_FSINFO', 'P2V_DLOG1', 'P2V_DLOG2', 'P2V_REFCOUNT', 

1576 'P2V_TOPAA', 'P2V_DF_SCORES_SUB', 'P2V_BM', 'P2V_SNAP', 

1577 'P2V_DF_SCORES', 'P2V_VOLINFO', 'P2V_CONT', 'P2A_INOFILE', 

1578 'P2A_INO', 'P2A_DLOG1', 'P2A_HYA', 'P2A_DLOG2', 'P2A_FSINFO', 

1579 'P2A_IPU_BITMAP_GROW', 'P2A_REFCOUNT', 'P2A_TOPAA', 

1580 'P2A_HYABC', 'P2A_BM', 'P2A_SNAP', 'P2A_VOLINFO', 'P2_FLUSH', 

1581 'P2_FINISH', 'P3_WAIT', 'P3V_VOLINFO', 'P3A_VOLINFO', 

1582 'P3_FINISH', 'P4_FINISH', 'P5_FINISH', 

1583 ], 

1584 'name': 'cp_phase_times', 

1585} 

1586 

1587EXPANDED_WAFL_COUNTERS = [ 

1588 { 

1589 'cp_phase_times:p2a_snap': '696', 

1590 'cp_phase_times:p4_finish': '13982', 

1591 'cp_phase_times:setup': '563', 

1592 'cp_phase_times:p2a_dlog1': '5954', 

1593 'cp_phase_times:p2a_dlog2': '2236', 

1594 'cp_phase_times:p2v_cont': '2380', 

1595 'cp_phase_times:p2v_volinfo': '1101', 

1596 'cp_phase_times:p2v_bm': '3344', 

1597 'cp_phase_times:p2v_fsinfo': '1937', 

1598 'cp_phase_times:p2a_inofile': '356', 

1599 'cp_phase_times': '563,4844,1731,9676,469,0,821,763,1282,1937,0,359,' 

1600 '418,1048,344,3344,4867,1397,1101,2380,356,1318,' 

1601 '5954,9,2236,2190,228,476,1221,0,5838,696,515588,' 

1602 '20542954,0,0,3122,10567367,20696,13982,36', 

1603 'cp_phase_times:p2v_dlog2': '359', 

1604 'instance-name': 'wafl', 

1605 'cp_phase_times:p3_wait': '0', 

1606 'cp_phase_times:p2a_bm': '5838', 

1607 'cp_phase_times:p1_quota': '469', 

1608 'cp_phase_times:p2v_inofile': '821', 

1609 'cp_phase_times:p2a_refcount': '476', 

1610 'cp_phase_times:p2a_fsinfo': '2190', 

1611 'cp_phase_times:p2a_hyabc': '0', 

1612 'cp_phase_times:p2a_volinfo': '515588', 

1613 'cp_phase_times:pre_p0': '4844', 

1614 'cp_phase_times:p2a_hya': '9', 

1615 'cp_phase_times:p0_snap_del': '1731', 

1616 'cp_phase_times:p2a_ino': '1318', 

1617 'cp_phase_times:p2v_df_scores_sub': '344', 

1618 'cp_phase_times:p2v_ino_pub': '763', 

1619 'cp_phase_times:p2a_ipu_bitmap_grow': '228', 

1620 'cp_phase_times:p2v_refcount': '418', 

1621 'timestamp': '1453523339', 

1622 'cp_phase_times:p2v_dlog1': '0', 

1623 'cp_phase_times:p2_finish': '0', 

1624 'cp_phase_times:p1_clean': '9676', 

1625 'node-name': 'cluster1-01', 

1626 'instance-uuid': 'cluster1-01:kernel:wafl', 

1627 'cp_phase_times:p3a_volinfo': '10567367', 

1628 'cp_phase_times:p2a_topaa': '1221', 

1629 'cp_phase_times:p2_flush': '20542954', 

1630 'cp_phase_times:p2v_df_scores': '1397', 

1631 'cp_phase_times:ipu_disk_add': '0', 

1632 'cp_phase_times:p2v_snap': '4867', 

1633 'cp_phase_times:p5_finish': '36', 

1634 'cp_phase_times:p2v_ino_pri': '1282', 

1635 'cp_phase_times:p3v_volinfo': '3122', 

1636 'cp_phase_times:p2v_topaa': '1048', 

1637 'cp_phase_times:p3_finish': '20696', 

1638 }, { 

1639 'node-name': 'cluster1-01', 

1640 'instance-uuid': 'cluster1-01:kernel:wafl', 

1641 'total_cp_msecs': '31721222', 

1642 'instance-name': 'wafl', 

1643 'timestamp': '1453523339', 

1644 }, 

1645] 

1646 

1647PROCESSOR_INSTANCE_UUIDS = [ 

1648 'cluster1-01:kernel:processor0', 

1649 'cluster1-01:kernel:processor1', 

1650] 

1651PROCESSOR_INSTANCE_NAMES = ['processor0', 'processor1'] 

1652 

1653SERVER_METADATA = { 

1654 'share_type_id': 'fake_id', 

1655 'host': 'fake_host', 

1656} 

1657 

1658SERVER_METADATA_WITH_ENCRYPTION = { 

1659 'share_type_id': 'fake_id', 

1660 'host': 'fake_host', 

1661 'encryption_key_ref': 'fake_key', 

1662 'keystone_url': 'fake_keystone_url', 

1663 'application_credential_id': 'fake_app_cred_id', 

1664 'application_credential_secret': 'fake_app_cred_secret', 

1665 'request_host': 'fake_host@pool' 

1666} 

1667 

1668PROCESSOR_COUNTERS = [ 

1669 { 

1670 'node-name': 'cluster1-01', 

1671 'instance-uuid': 'cluster1-01:kernel:processor0', 

1672 'domain_busy': '980648687811,2597164534,2155400686,5443901498,' 

1673 '690280568,28,6180773,59,413895,1190100947,48989575,' 

1674 '58549809,34,54,11,20,5024141791,13136260754,452215', 

1675 'instance-name': 'processor0', 

1676 'timestamp': '1453524150', 

1677 }, { 

1678 'node-name': 'cluster1-01', 

1679 'instance-uuid': 'cluster1-01:kernel:processor0', 

1680 'processor_elapsed_time': '1013660714257', 

1681 'instance-name': 'processor0', 

1682 'timestamp': '1453524150', 

1683 }, { 

1684 'node-name': 'cluster1-01', 

1685 'instance-uuid': 'cluster1-01:kernel:processor1', 

1686 'domain_busy': '990957980543,1891766637,1433411516,3572427934,' 

1687 '691372324,0,3188648,0,305947,1211235777,47954620,' 

1688 '34832715,0,0,0,0,2692084482,9834648927,393451', 

1689 'instance-name': 'processor1', 

1690 'timestamp': '1453524150', 

1691 }, { 

1692 'node-name': 'cluster1-01', 

1693 'instance-uuid': 'cluster1-01:kernel:processor1', 

1694 'processor_elapsed_time': '1013660714261', 

1695 'instance-name': 'processor1', 

1696 'timestamp': '1453524150', 

1697 }, 

1698] 

1699 

1700PROCESSOR_DOMAIN_BUSY_COUNTER_INFO = { 

1701 'labels': [ 

1702 'idle', 'kahuna', 'storage', 'exempt', 'raid', 'raid_exempt', 

1703 'target', 'dnscache', 'cifs', 'wafl_exempt', 'wafl_xcleaner', 

1704 'sm_exempt', 'cluster', 'protocol', 'nwk_exclusive', 'nwk_exempt', 

1705 'nwk_legacy', 'hostOS', 'ssan_exempt', 

1706 ], 

1707 'name': 'domain_busy', 

1708} 

1709 

1710EXPANDED_PROCESSOR_COUNTERS = [ 

1711 { 

1712 'domain_busy:kahuna': '2597164534', 

1713 'timestamp': '1453524150', 

1714 'domain_busy:cifs': '413895', 

1715 'domain_busy:raid_exempt': '28', 

1716 'node-name': 'cluster1-01', 

1717 'instance-uuid': 'cluster1-01:kernel:processor0', 

1718 'domain_busy:target': '6180773', 

1719 'domain_busy:nwk_exempt': '20', 

1720 'domain_busy:raid': '690280568', 

1721 'domain_busy:storage': '2155400686', 

1722 'instance-name': 'processor0', 

1723 'domain_busy:cluster': '34', 

1724 'domain_busy:wafl_xcleaner': '48989575', 

1725 'domain_busy:wafl_exempt': '1190100947', 

1726 'domain_busy:protocol': '54', 

1727 'domain_busy': '980648687811,2597164534,2155400686,5443901498,' 

1728 '690280568,28,6180773,59,413895,1190100947,48989575,' 

1729 '58549809,34,54,11,20,5024141791,13136260754,452215', 

1730 'domain_busy:nwk_legacy': '5024141791', 

1731 'domain_busy:dnscache': '59', 

1732 'domain_busy:exempt': '5443901498', 

1733 'domain_busy:hostos': '13136260754', 

1734 'domain_busy:sm_exempt': '58549809', 

1735 'domain_busy:nwk_exclusive': '11', 

1736 'domain_busy:idle': '980648687811', 

1737 'domain_busy:ssan_exempt': '452215', 

1738 }, { 

1739 'node-name': 'cluster1-01', 

1740 'instance-uuid': 'cluster1-01:kernel:processor0', 

1741 'processor_elapsed_time': '1013660714257', 

1742 'instance-name': 'processor0', 

1743 'timestamp': '1453524150', 

1744 }, { 

1745 'domain_busy:kahuna': '1891766637', 

1746 'timestamp': '1453524150', 

1747 'domain_busy:cifs': '305947', 

1748 'domain_busy:raid_exempt': '0', 

1749 'node-name': 'cluster1-01', 

1750 'instance-uuid': 'cluster1-01:kernel:processor1', 

1751 'domain_busy:target': '3188648', 

1752 'domain_busy:nwk_exempt': '0', 

1753 'domain_busy:raid': '691372324', 

1754 'domain_busy:storage': '1433411516', 

1755 'instance-name': 'processor1', 

1756 'domain_busy:cluster': '0', 

1757 'domain_busy:wafl_xcleaner': '47954620', 

1758 'domain_busy:wafl_exempt': '1211235777', 

1759 'domain_busy:protocol': '0', 

1760 'domain_busy': '990957980543,1891766637,1433411516,3572427934,' 

1761 '691372324,0,3188648,0,305947,1211235777,47954620,' 

1762 '34832715,0,0,0,0,2692084482,9834648927,393451', 

1763 'domain_busy:nwk_legacy': '2692084482', 

1764 'domain_busy:dnscache': '0', 

1765 'domain_busy:exempt': '3572427934', 

1766 'domain_busy:hostos': '9834648927', 

1767 'domain_busy:sm_exempt': '34832715', 

1768 'domain_busy:nwk_exclusive': '0', 

1769 'domain_busy:idle': '990957980543', 

1770 'domain_busy:ssan_exempt': '393451', 

1771 }, { 

1772 'node-name': 'cluster1-01', 

1773 'instance-uuid': 'cluster1-01:kernel:processor1', 

1774 'processor_elapsed_time': '1013660714261', 

1775 'instance-name': 'processor1', 

1776 'timestamp': '1453524150', 

1777 }, 

1778] 

1779 

1780SERVER_MIGRATION_CHECK_NOT_COMPATIBLE = { 

1781 'compatible': False, 

1782 'writable': None, 

1783 'nondisruptive': None, 

1784 'preserve_snapshots': None, 

1785 'migration_cancel': None, 

1786 'migration_get_progress': None, 

1787 'share_network_id': None, 

1788} 

1789 

1790CIFS_SECURITY_SERVICE = { 

1791 'id': 'fake_id', 

1792 'type': 'active_directory', 

1793 'password': 'fake_password', 

1794 'user': 'fake_user', 

1795 'ou': 'fake_ou', 

1796 'domain': 'fake_domain', 

1797 'dns_ip': 'fake_dns_ip', 

1798 'server': 'fake_server', 

1799 'default_ad_site': None, 

1800} 

1801 

1802CIFS_SECURITY_SERVICE_2 = { 

1803 'id': 'fake_id_2', 

1804 'type': 'active_directory', 

1805 'password': 'fake_password_2', 

1806 'user': 'fake_user_2', 

1807 'ou': 'fake_ou_2', 

1808 'domain': 'fake_domain_2', 

1809 'dns_ip': 'fake_dns_ip_2', 

1810 'server': 'fake_server_2', 

1811 'default_ad_site': None, 

1812} 

1813 

1814CIFS_SECURITY_SERVICE_3 = { 

1815 'id': 'fake_id_3', 

1816 'type': 'active_directory', 

1817 'password': 'fake_password_3', 

1818 'user': 'fake_user_3', 

1819 'ou': 'fake_ou_3', 

1820 'domain': 'fake_domain_3', 

1821 'dns_ip': 'fake_dns_ip_3', 

1822 'default_ad_site': 'fake_default_ad_site', 

1823 'server': None 

1824} 

1825 

1826LDAP_LINUX_SECURITY_SERVICE = { 

1827 'id': 'fake_id', 

1828 'type': 'ldap', 

1829 'user': 'fake_user', 

1830 'password': 'fake_password', 

1831 'server': 'fake_server', 

1832 'ou': 'fake_ou', 

1833 'dns_ip': None, 

1834 'domain': None 

1835} 

1836 

1837 

1838LDAP_AD_SECURITY_SERVICE = { 

1839 'id': 'fake_id', 

1840 'type': 'ldap', 

1841 'user': 'fake_user', 

1842 'password': 'fake_password', 

1843 'domain': 'fake_domain', 

1844 'ou': 'fake_ou', 

1845 'dns_ip': 'fake_dns_ip', 

1846 'server': None, 

1847} 

1848 

1849KERBEROS_SECURITY_SERVICE = { 

1850 'id': 'fake_id_3', 

1851 'type': 'kerberos', 

1852 'password': 'fake_password_3', 

1853 'user': 'fake_user_3', 

1854 'domain': 'fake_realm', 

1855 'dns_ip': 'fake_dns_ip_3', 

1856 'server': 'fake_server_3', 

1857} 

1858 

1859KERBEROS_SECURITY_SERVICE_2 = { 

1860 'id': 'fake_id_4', 

1861 'type': 'kerberos', 

1862 'password': 'fake_password_4', 

1863 'user': 'fake_user_4', 

1864 'domain': 'fake_realm_2', 

1865 'dns_ip': 'fake_dns_ip_4', 

1866 'server': 'fake_server_4', 

1867} 

1868 

1869SHARE_NETWORK_SUBNET = { 

1870 'id': 'fake_share_net_subnet_d', 

1871 'neutron_subnet_id': '34950f50-a142-4328-8026-418ad4410b09', 

1872 'neutron_net_id': 'fa202676-531a-4446-bc0c-bcec15a72e82', 

1873 'network_type': 'fake_network_type', 

1874 'segmentation_id': 1234, 

1875 'ip_version': 4, 

1876 'cidr': 'fake_cidr', 

1877 'gateway': 'fake_gateway', 

1878 'mtu': 1509, 

1879} 

1880 

1881SHARE_NETWORK = { 

1882 'id': 'fake_share_net_id', 

1883 'project_id': 'fake_project_id', 

1884 'status': 'fake_status', 

1885 'name': 'fake_name', 

1886 'description': 'fake_description', 

1887 'security_services': [CIFS_SECURITY_SERVICE], 

1888 'share_network_subnets': [SHARE_NETWORK_SUBNET], 

1889} 

1890 

1891SHARE_TYPE_2 = copy.deepcopy(SHARE_TYPE) 

1892SHARE_TYPE_2['id'] = SHARE_TYPE_ID_2 

1893SHARE_TYPE_2['extra_specs'].update(SHARE_TYPE_EXTRA_SPEC) 

1894 

1895SHARE_REQ_SPEC = { 

1896 'share_properties': { 

1897 'size': SHARE['size'], 

1898 'project_id': SHARE['project_id'], 

1899 'snapshot_support': SHARE_TYPE_EXTRA_SPEC['snapshot_support'], 

1900 'create_share_from_snapshot_support': 

1901 SHARE_TYPE_EXTRA_SPEC['create_share_from_snapshot_support'], 

1902 'revert_to_snapshot_support': 

1903 SHARE_TYPE_EXTRA_SPEC['revert_to_snapshot_support'], 

1904 'mount_snapshot_support': 

1905 SHARE_TYPE_EXTRA_SPEC['mount_snapshot_support'], 

1906 'share_proto': SHARE['share_proto'], 

1907 'share_type_id': SHARE_TYPE_2['id'], 

1908 'is_public': True, 

1909 'share_group_id': None, 

1910 'source_share_group_snapshot_member_id': None, 

1911 'snapshot_id': None, 

1912 }, 

1913 'share_instance_properties': { 

1914 'availability_zone_id': 'fake_az_1', 

1915 'share_network_id': SHARE_NETWORK['id'], 

1916 'share_server_id': SHARE_SERVER['id'], 

1917 'share_id': SHARE_ID, 

1918 'host': SHARE_INSTANCE['host'], 

1919 'status': SHARE_INSTANCE['status'], 

1920 }, 

1921 'share_type': SHARE_TYPE_2, 

1922 'share_id': SHARE_ID, 

1923} 

1924 

1925SERVER_MIGRATION_REQUEST_SPEC = { 

1926 'shares_size': 10, 

1927 'snapshots_size': 10, 

1928 'shares_req_spec': [SHARE_REQ_SPEC], 

1929} 

1930 

1931CLIENT_GET_VOLUME_RESPONSE = { 

1932 'aggregate': AGGREGATE, 

1933 'junction-path': '/%s' % SHARE_NAME, 

1934 'name': SHARE_NAME, 

1935 'type': 'rw', 

1936 'style': 'flex', 

1937 'size': SHARE_SIZE, 

1938 'owning-vserver-name': VSERVER1, 

1939 'qos-policy-group-name': QOS_POLICY_GROUP_NAME, 

1940} 

1941 

1942SHARE_INSTANCE_LIST = [SHARE_INSTANCE] 

1943 

1944CURRENT_NETWORK_ALLOCATIONS = { 

1945 'admin_network_allocations': ADMIN_NETWORK_ALLOCATIONS, 

1946 'subnets': [ 

1947 { 

1948 'share_network_subnet_id': '0bdeaa8c6db3-3bc10d67', 

1949 'neutron_net_id': '2598-4122-bb62-0bdeaa8c6db3', 

1950 'neutron_subnet_id': '3bc10d67-2598-4122-bb62', 

1951 'network_allocations': USER_NETWORK_ALLOCATIONS 

1952 } 

1953 ] 

1954} 

1955 

1956NEW_NETWORK_ALLOCATIONS = { 

1957 'share_network_subnet_id': '0bdeaa8c6db3-3bc10d67', 

1958 'neutron_net_id': '2598-4122-bb62-0bdeaa8c6db3', 

1959 'neutron_subnet_id': '3bc10d67-2598-4122-bb62', 

1960 'network_allocations': USER_NETWORK_ALLOCATIONS 

1961} 

1962 

1963SHARE_BACKUP = { 

1964 'id': '242ff47e-518d-4b07-b3c3-0a51e6744149', 

1965 'share_id': 'd0a424c3-fee9-4781-9d4a-2c48a63386aa', 

1966 'size': SHARE_SIZE, 

1967 'host': MANILA_HOST_NAME, 

1968 'display_name': 'fake_backup', 

1969 'backup_options': {'backend': BACKEND_NAME, 'backup_type': BACKUP_TYPE}, 

1970 } 

1971 

1972SNAP_MIRROR_INFO = {'source-vserver': VSERVER1, 

1973 'source-volume': FLEXVOL_NAME, 

1974 'destination-vserver': VSERVER2, 

1975 'destination-volume': FLEXVOL_NAME_1, 

1976 'relationship-status': "idle", 

1977 'last-transfer-type': "update", 

1978 } 

1979 

1980 

1981SERVER_MODEL_UPDATE = { 

1982 'server_details': { 

1983 'ports': '{"%s": "%s", "%s": "%s"}' % ( 

1984 USER_NETWORK_ALLOCATIONS[0]['id'], 

1985 USER_NETWORK_ALLOCATIONS[0]['ip_address'], 

1986 USER_NETWORK_ALLOCATIONS[1]['id'], 

1987 USER_NETWORK_ALLOCATIONS[1]['ip_address']) 

1988 }, 

1989 'share_updates': {SHARE_INSTANCE['id']: NFS_EXPORTS[0]}, 

1990} 

1991 

1992 

1993def get_config_cmode(): 

1994 config = na_fakes.create_configuration_cmode() 

1995 config.local_conf.set_override('share_backend_name', BACKEND_NAME) 

1996 config.reserved_share_percentage = 5 

1997 config.reserved_share_from_snapshot_percentage = 2 

1998 config.reserved_share_extend_percentage = 2 

1999 config.max_over_subscription_ratio = 2.0 

2000 config.netapp_login = CLIENT_KWARGS['username'] 

2001 config.netapp_password = CLIENT_KWARGS['password'] 

2002 config.netapp_server_hostname = CLIENT_KWARGS['hostname'] 

2003 config.netapp_transport_type = CLIENT_KWARGS['transport_type'] 

2004 config.netapp_ssl_cert_path = CLIENT_KWARGS['ssl_cert_path'] 

2005 config.netapp_server_port = CLIENT_KWARGS['port'] 

2006 config.netapp_private_key_file = CLIENT_KWARGS['private_key_file'] 

2007 config.netapp_certificate_file = CLIENT_KWARGS['certificate_file'] 

2008 config.netapp_ca_certificate_file = CLIENT_KWARGS['ca_certificate_file'] 

2009 config.netapp_certificate_host_validation = \ 

2010 CLIENT_KWARGS['certificate_host_validation'] 

2011 config.netapp_volume_name_template = VOLUME_NAME_TEMPLATE 

2012 config.netapp_aggregate_name_search_pattern = AGGREGATE_NAME_SEARCH_PATTERN 

2013 config.netapp_vserver_name_template = VSERVER_NAME_TEMPLATE 

2014 config.netapp_root_volume_aggregate = ROOT_VOLUME_AGGREGATE 

2015 config.netapp_root_volume = ROOT_VOLUME 

2016 config.netapp_lif_name_template = LIF_NAME_TEMPLATE 

2017 config.netapp_volume_snapshot_reserve_percent = 8 

2018 config.netapp_vserver = VSERVER1 

2019 return config 

2020 

2021 

2022def get_network_info(user_network_allocation, admin_network_allocation): 

2023 net_info = copy.deepcopy(NETWORK_INFO) 

2024 net_info['network_allocations'] = user_network_allocation 

2025 net_info['admin_network_allocations'] = admin_network_allocation 

2026 

2027 return net_info 

2028 

2029 

2030def fake_get_filter_function(pool=None): 

2031 return pool if pool else 'filter'