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

410 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# 

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

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

5# a copy of the License at 

6# 

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

8# 

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

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

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

12# License for the specific language governing permissions and limitations 

13# under the License. 

14 

15from unittest import mock 

16 

17from lxml import etree 

18import requests 

19 

20from manila.share.drivers.netapp.dataontap.client import api 

21 

22 

23CONNECTION_INFO = { 

24 'hostname': 'hostname', 

25 'transport_type': 'https', 

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

27 'port': 443, 

28 'username': 'admin', 

29 'password': 'passw0rd', 

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

31 'client_api': 'rest', 

32 'async_rest_timeout': 60, 

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

34 'certificate_file': '/fake_cert.pem', 

35 'ca_certificate_file': '/fake_ca_cert.crt', 

36 'certificate_host_validation': False 

37} 

38 

39NO_SNAPRESTORE_LICENSE = '"SnapRestore" is not licensed in the cluster.' 

40FAKE_UUID = 'b32bab78-82be-11ec-a8a3-0242ac120002' 

41CLUSTER_NAME = 'fake_cluster' 

42REMOTE_CLUSTER_NAME = 'fake_cluster_2' 

43CLUSTER_ADDRESS_1 = 'fake_cluster_address' 

44CLUSTER_ADDRESS_2 = 'fake_cluster_address_2' 

45VERSION = 'NetApp Release 8.2.1 Cluster-Mode: Fri Mar 21 14:25:07 PDT 2014' 

46VERSION_NO_DARE = 'NetApp Release 9.1.0: Tue May 10 19:30:23 2016 <1no-DARE>' 

47VERSION_TUPLE = (9, 1, 0) 

48NODE_NAME = 'fake_node1' 

49NODE_NAME2 = 'fake_node2' 

50NODE_NAMES = (NODE_NAME, NODE_NAME2) 

51VSERVER_NAME = 'fake_vserver' 

52VSERVER_NAME_2 = 'fake_vserver_2' 

53VSERVER_PEER_NAME = 'fake_vserver_peer' 

54VSERVER_PEER_STATE = 'peered' 

55FAKE_CONFIG_NAME = "fake_config_name" 

56FAKE_CONFIG_UUID = "fake_config_uuid" 

57FAKE_KEY_ID = "fake_key_id" 

58FAKE_KEYSTONE_URL = "fake_keystone_url" 

59FAKE_APPLICATION_CRED_ID = "fake_application_cred_id" 

60FAKE_APPLICATION_CRED_SECRET = "fake_application_cred_secret" 

61ADMIN_VSERVER_NAME = 'fake_admin_vserver' 

62NODE_VSERVER_NAME = 'fake_node_vserver' 

63NFS_VERSIONS = ['nfs3', 'nfs4.0'] 

64SECURITY_CERT_DEFAULT_EXPIRE_DAYS = 365 

65SECURITY_CERT_LARGE_EXPIRE_DAYS = 3652 

66DELETE_RETENTION_HOURS = 12 

67ROOT_AGGREGATE_NAMES = ('root_aggr1', 'root_aggr2') 

68ROOT_VOLUME_AGGREGATE_NAME = 'fake_root_aggr' 

69ROOT_VOLUME_NAME = 'fake_root_volume' 

70VOLUME_NAMES = ('volume1', 'volume2') 

71SHARE_AGGREGATE_NAME = 'fake_aggr1' 

72SHARE_AGGREGATE_NAMES = ('fake_aggr1', 'fake_aggr2') 

73SHARE_AGGREGATE_NAMES_LIST = ['fake_aggr1', 'fake_aggr2'] 

74SHARE_AGGREGATE_RAID_TYPES = ('raid4', 'raid_dp') 

75SHARE_AGGREGATE_DISK_TYPE = 'FCAL' 

76SHARE_AGGREGATE_DISK_TYPES = ['SATA', 'SSD'] 

77EFFECTIVE_TYPE = 'fake_effective_type1' 

78SHARE_NAME = 'fake_share' 

79SHARE_SIZE = '1000000000' 

80SHARE_USED_SIZE = '3456796' 

81SHARE_NAME_2 = 'fake_share_2' 

82FLEXGROUP_STYLE_EXTENDED = 'flexgroup' 

83FLEXVOL_STYLE_EXTENDED = 'flexvol' 

84SNAPSHOT_NAME = 'fake_snapshot' 

85CG_SNAPSHOT_ID = 'fake_cg_id' 

86PARENT_SHARE_NAME = 'fake_parent_share' 

87PARENT_SNAPSHOT_NAME = 'fake_parent_snapshot' 

88MAX_FILES = 5000 

89LANGUAGE = 'fake_language' 

90SNAPSHOT_POLICY_NAME = 'fake_snapshot_policy' 

91EXPORT_POLICY_NAME = 'fake_export_policy' 

92VOLUME_EFFICIENCY_POLICY_NAME = 'fake_volume_efficiency_policy' 

93SHARE_MOUNT_POINT = 'fake_mount_point' 

94 

95DELETED_EXPORT_POLICIES = { 

96 VSERVER_NAME: [ 

97 'deleted_manila_fake_policy_1', 

98 'deleted_manila_fake_policy_2', 

99 ], 

100 VSERVER_NAME_2: [ 

101 'deleted_manila_fake_policy_3', 

102 ], 

103} 

104QOS_POLICY_GROUP_NAME = 'fake_qos_policy_group_name' 

105QOS_MAX_THROUGHPUT = '5000B/s' 

106QOS_MIN_THROUGHPUT = '1000B/s' 

107QOS_MAX_THROUGHPUT_IOPS = '5000iops' 

108QOS_MIN_THROUGHPUT_IOPS = '1000iops' 

109QOS_MAX_THROUGHPUT_NO_UNIT = 5000 

110QOS_MIN_THROUGHPUT_NO_UNIT = 1000 

111QOS_MAX_THROUGHPUT_IOPS_NO_UNIT = 5000 

112QOS_MIN_THROUGHPUT_IOPS_NO_UNIT = 1000 

113ADAPTIVE_QOS_POLICY_GROUP_NAME = 'fake_adaptive_qos_policy_group_name' 

114VSERVER_TYPE_DEFAULT = 'default' 

115VSERVER_TYPE_DP_DEST = 'dp_destination' 

116VSERVER_OP_STATE_RUNNING = 'running' 

117VSERVER_STATE = 'running' 

118VSERVER_INFO = { 

119 'name': VSERVER_NAME, 

120 'subtype': VSERVER_TYPE_DEFAULT, 

121 'operational_state': VSERVER_OP_STATE_RUNNING, 

122 'state': VSERVER_STATE, 

123} 

124SNAPMIRROR_POLICY_NAME = 'fake_snapmirror_policy' 

125SNAPMIRROR_POLICY_TYPE = 'async_mirror' 

126 

127USER_NAME = 'fake_user' 

128 

129PORT = 'e0a' 

130VLAN = '1001' 

131VLAN_PORT = PORT + '-' + VLAN 

132IP_ADDRESS = '10.10.10.10' 

133NETMASK = '255.255.255.0' 

134GATEWAY = '10.10.10.1' 

135SUBNET = '10.10.10.0/24' 

136NET_ALLOCATION_ID = 'fake_allocation_id' 

137LIF_NAME_TEMPLATE = 'os_%(net_allocation_id)s' 

138LIF_NAME = LIF_NAME_TEMPLATE % {'net_allocation_id': NET_ALLOCATION_ID} 

139IPSPACE_NAME = 'ipspace_fake' 

140BROADCAST_DOMAIN = 'domain_fake' 

141MTU = 9000 

142SM_SOURCE_VSERVER = 'fake_source_vserver' 

143SM_SOURCE_VOLUME = 'fake_source_volume' 

144SM_DEST_VSERVER = 'fake_destination_vserver' 

145SM_DEST_VOLUME = 'fake_destination_volume' 

146SM_SOURCE_PATH = SM_SOURCE_VSERVER + ':' + SM_SOURCE_VOLUME 

147SM_DEST_PATH = SM_DEST_VSERVER + ':' + SM_DEST_VOLUME 

148 

149 

150FPOLICY_POLICY_NAME = 'fake_fpolicy_name' 

151FPOLICY_EVENT_NAME = 'fake_fpolicy_event_name' 

152FPOLICY_PROTOCOL = 'cifs' 

153FPOLICY_FILE_OPERATIONS = 'create,write,rename' 

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

155FPOLICY_ENGINE = 'native' 

156FPOLICY_EXT_TO_INCLUDE = 'avi' 

157FPOLICY_EXT_TO_INCLUDE_LIST = ['avi'] 

158FPOLICY_EXT_TO_EXCLUDE = 'jpg,mp3' 

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

160 

161JOB_ID = 123 

162JOB_STATE = 'success' 

163 

164CDOT_CLONE_CHILD_1 = 'fake_child_1' 

165CDOT_CLONE_CHILD_2 = 'fake_child_2' 

166CDOT_CLONE_CHILDREN = [ 

167 {'name': CDOT_CLONE_CHILD_1}, 

168 {'name': CDOT_CLONE_CHILD_2}, 

169] 

170 

171NETWORK_INTERFACES = [{ 

172 'interface-name': 'fake_interface', 

173 'administrative-status': 'up', 

174 'address': IP_ADDRESS, 

175 'vserver': VSERVER_NAME, 

176 'netmask': NETMASK, 

177 'role': 'data', 

178 'home-node': NODE_NAME, 

179 'home-port': VLAN_PORT 

180}] 

181 

182NETWORK_INTERFACES_MULTIPLE = [ 

183 { 

184 'interface-name': 'fake_interface', 

185 'administrative-status': 'up', 

186 'address': IP_ADDRESS, 

187 'vserver': VSERVER_NAME, 

188 'netmask': NETMASK, 

189 'role': 'data', 

190 'home-node': NODE_NAME, 

191 'home-port': VLAN_PORT, 

192 }, 

193 { 

194 'interface-name': 'fake_interface_2', 

195 'administrative-status': 'up', 

196 'address': '10.10.12.10', 

197 'vserver': VSERVER_NAME, 

198 'netmask': NETMASK, 

199 'role': 'data', 

200 'home-node': NODE_NAME2, 

201 'home-port': VLAN_PORT, 

202 } 

203] 

204 

205NETWORK_QUALIFIED_PORTS = [NODE_NAME + ':' + VLAN_PORT] 

206NETWORK_QUALIFIED_PORTS2 = [NODE_NAME2 + ':' + VLAN_PORT] 

207NETWORK_QUALIFIED_PORTS_ALL = (NETWORK_QUALIFIED_PORTS 

208 + NETWORK_QUALIFIED_PORTS2) 

209 

210IPSPACES = [{ 

211 'uuid': 'fake_uuid', 

212 'ipspace': IPSPACE_NAME, 

213 'id': 'fake_id', 

214 'broadcast-domains': [BROADCAST_DOMAIN], 

215 'ports': NETWORK_QUALIFIED_PORTS2, 

216 'vservers': [ 

217 IPSPACE_NAME, 

218 VSERVER_NAME, 

219 ] 

220}] 

221 

222EMS_MESSAGE = { 

223 'computer-name': 'fake_host', 

224 'event-id': '0', 

225 'event-source': 'fake driver', 

226 'app-version': 'fake app version', 

227 'category': 'fake category', 

228 'event-description': 'fake description', 

229 'log-level': '6', 

230 'auto-support': 'false', 

231} 

232 

233QOS_POLICY_GROUP = { 

234 'policy-group': QOS_POLICY_GROUP_NAME, 

235 'vserver': VSERVER_NAME, 

236 'max-throughput': QOS_MAX_THROUGHPUT, 

237 'min-throughput': QOS_MIN_THROUGHPUT, 

238 'num-workloads': 1, 

239} 

240 

241VOLUME_AUTOSIZE_ATTRS = { 

242 'mode': 'off', 

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

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

245 'maximum-size': '1258288', 

246 'minimum-size': '1048576', 

247} 

248 

249 

250NO_RECORDS_RESPONSE = etree.XML(""" 

251 <results status="passed"> 

252 <num-records>0</num-records> 

253 </results> 

254""") 

255 

256PASSED_RESPONSE = etree.XML(""" 

257 <results status="passed" /> 

258""") 

259 

260PASSED_FAILED_ITER_RESPONSE = etree.XML(""" 

261 <results status="passed"> 

262 <num-failed>0</num-failed> 

263 <num-succeeded>1</num-succeeded> 

264 </results> 

265""") 

266 

267INVALID_GET_ITER_RESPONSE_NO_ATTRIBUTES = etree.XML(""" 

268 <results status="passed"> 

269 <num-records>1</num-records> 

270 <next-tag>fake_tag</next-tag> 

271 </results> 

272""") 

273 

274INVALID_GET_ITER_RESPONSE_NO_RECORDS = etree.XML(""" 

275 <results status="passed"> 

276 <attributes-list/> 

277 <next-tag>fake_tag</next-tag> 

278 </results> 

279""") 

280 

281VSERVER_GET_ITER_RESPONSE = etree.XML(""" 

282 <results status="passed"> 

283 <attributes-list> 

284 <vserver-info> 

285 <vserver-name>%(fake_vserver)s</vserver-name> 

286 </vserver-info> 

287 </attributes-list> 

288 <num-records>1</num-records> 

289 </results> 

290""" % {'fake_vserver': VSERVER_NAME}) 

291 

292VSERVER_GET_ITER_RESPONSE_INFO = etree.XML(""" 

293 <results status="passed"> 

294 <attributes-list> 

295 <vserver-info> 

296 <operational-state>%(operational_state)s</operational-state> 

297 <state>%(state)s</state> 

298 <vserver-name>%(name)s</vserver-name> 

299 <vserver-subtype>%(subtype)s</vserver-subtype> 

300 </vserver-info> 

301 </attributes-list> 

302 <num-records>1</num-records> 

303 </results> 

304""" % VSERVER_INFO) 

305 

306VSERVER_GET_ROOT_VOLUME_NAME_RESPONSE = etree.XML(""" 

307 <results status="passed"> 

308 <attributes-list> 

309 <vserver-info> 

310 <root-volume>%(root_volume)s</root-volume> 

311 <vserver-name>%(fake_vserver)s</vserver-name> 

312 </vserver-info> 

313 </attributes-list> 

314 <num-records>1</num-records> 

315 </results> 

316""" % {'root_volume': ROOT_VOLUME_NAME, 'fake_vserver': VSERVER_NAME}) 

317 

318VSERVER_GET_IPSPACE_NAME_RESPONSE = etree.XML(""" 

319 <results status="passed"> 

320 <attributes-list> 

321 <vserver-info> 

322 <ipspace>%(ipspace)s</ipspace> 

323 <vserver-name>%(fake_vserver)s</vserver-name> 

324 </vserver-info> 

325 </attributes-list> 

326 <num-records>1</num-records> 

327 </results> 

328""" % {'ipspace': IPSPACE_NAME, 'fake_vserver': VSERVER_NAME}) 

329 

330VSERVER_GET_RESPONSE = etree.XML(""" 

331 <results status="passed"> 

332 <attributes> 

333 <vserver-info> 

334 <aggr-list> 

335 <aggr-name>%(aggr1)s</aggr-name> 

336 <aggr-name>%(aggr2)s</aggr-name> 

337 </aggr-list> 

338 <vserver-aggr-info-list> 

339 <vserver-aggr-info> 

340 <aggr-availsize>45678592</aggr-availsize> 

341 <aggr-name>%(aggr1)s</aggr-name> 

342 </vserver-aggr-info> 

343 <vserver-aggr-info> 

344 <aggr-availsize>6448431104</aggr-availsize> 

345 <aggr-name>%(aggr2)s</aggr-name> 

346 </vserver-aggr-info> 

347 </vserver-aggr-info-list> 

348 <vserver-name>%(vserver)s</vserver-name> 

349 </vserver-info> 

350 </attributes> 

351 </results> 

352""" % { 

353 'vserver': VSERVER_NAME, 

354 'aggr1': SHARE_AGGREGATE_NAMES[0], 

355 'aggr2': SHARE_AGGREGATE_NAMES[1], 

356}) 

357 

358VSERVER_SHOW_AGGR_GET_RESPONSE = etree.XML(""" 

359<results status='passed'> 

360 <attributes-list> 

361 <show-aggregates> 

362 <aggregate-name>fake_aggr</aggregate-name> 

363 <aggregate-type>ssd</aggregate-type> 

364 <available-size>3393178406912</available-size> 

365 <is-nve-capable>false</is-nve-capable> 

366 <snaplock-type>compliance</snaplock-type> 

367 <vserver-name>os_vs</vserver-name> 

368 </show-aggregates> 

369 </attributes-list> 

370 <num-records>1</num-records> 

371</results> 

372""") 

373 

374SECURITY_CERT_GET_RESPONSE = etree.XML(""" 

375 <results status="passed"> 

376 <attributes-list> 

377 <certificate-info> 

378 <vserver>%(vserver)s</vserver> 

379 <serial-number>12345</serial-number> 

380 </certificate-info> 

381 </attributes-list> 

382 <num-records>1</num-records> 

383 </results> 

384""" % {'vserver': VSERVER_NAME}) 

385 

386VSERVER_DATA_LIST_RESPONSE = etree.XML(""" 

387 <results status="passed"> 

388 <attributes-list> 

389 <vserver-info> 

390 <vserver-name>%(vserver)s</vserver-name> 

391 <vserver-type>data</vserver-type> 

392 </vserver-info> 

393 </attributes-list> 

394 <num-records>1</num-records> 

395 </results> 

396""" % {'vserver': VSERVER_NAME}) 

397 

398VSERVER_AGGREGATES = { 

399 SHARE_AGGREGATE_NAMES[0]: { 

400 'available': 45678592, 

401 }, 

402 SHARE_AGGREGATE_NAMES[1]: { 

403 'available': 6448431104, 

404 }, 

405} 

406 

407VSERVER_GET_RESPONSE_NO_AGGREGATES = etree.XML(""" 

408 <results status="passed"> 

409 <attributes> 

410 <vserver-info> 

411 <vserver-name>%(vserver)s</vserver-name> 

412 </vserver-info> 

413 </attributes> 

414 </results> 

415""" % {'vserver': VSERVER_NAME}) 

416 

417ONTAPI_VERSION_RESPONSE = etree.XML(""" 

418 <results status="passed"> 

419 <major-version>1</major-version> 

420 <minor-version>19</minor-version> 

421 </results> 

422""") 

423 

424SYSTEM_GET_VERSION_RESPONSE = etree.XML(""" 

425 <results status="passed"> 

426 <build-timestamp>1395426307</build-timestamp> 

427 <is-clustered>true</is-clustered> 

428 <version>%(version)s</version> 

429 <version-tuple> 

430 <system-version-tuple> 

431 <generation>8</generation> 

432 <major>2</major> 

433 <minor>1</minor> 

434 </system-version-tuple> 

435 </version-tuple> 

436 </results> 

437""" % {'version': VERSION}) 

438 

439LICENSE_V2_LIST_INFO_RESPONSE = etree.XML(""" 

440 <results status="passed"> 

441 <licenses> 

442 <license-v2-info> 

443 <customer-id>none</customer-id> 

444 <description>Cluster Base License</description> 

445 <legacy>false</legacy> 

446 <owner>cluster3</owner> 

447 <package>base</package> 

448 <serial-number>1-80-000008</serial-number> 

449 <type>license</type> 

450 </license-v2-info> 

451 <license-v2-info> 

452 <customer-id>none</customer-id> 

453 <description>NFS License</description> 

454 <legacy>false</legacy> 

455 <owner>cluster3-01</owner> 

456 <package>nfs</package> 

457 <serial-number>1-81-0000000000000004082368507</serial-number> 

458 <type>license</type> 

459 </license-v2-info> 

460 <license-v2-info> 

461 <customer-id>none</customer-id> 

462 <description>CIFS License</description> 

463 <legacy>false</legacy> 

464 <owner>cluster3-01</owner> 

465 <package>cifs</package> 

466 <serial-number>1-81-0000000000000004082368507</serial-number> 

467 <type>license</type> 

468 </license-v2-info> 

469 <license-v2-info> 

470 <customer-id>none</customer-id> 

471 <description>iSCSI License</description> 

472 <legacy>false</legacy> 

473 <owner>cluster3-01</owner> 

474 <package>iscsi</package> 

475 <serial-number>1-81-0000000000000004082368507</serial-number> 

476 <type>license</type> 

477 </license-v2-info> 

478 <license-v2-info> 

479 <customer-id>none</customer-id> 

480 <description>FCP License</description> 

481 <legacy>false</legacy> 

482 <owner>cluster3-01</owner> 

483 <package>fcp</package> 

484 <serial-number>1-81-0000000000000004082368507</serial-number> 

485 <type>license</type> 

486 </license-v2-info> 

487 <license-v2-info> 

488 <customer-id>none</customer-id> 

489 <description>SnapRestore License</description> 

490 <legacy>false</legacy> 

491 <owner>cluster3-01</owner> 

492 <package>snaprestore</package> 

493 <serial-number>1-81-0000000000000004082368507</serial-number> 

494 <type>license</type> 

495 </license-v2-info> 

496 <license-v2-info> 

497 <customer-id>none</customer-id> 

498 <description>SnapMirror License</description> 

499 <legacy>false</legacy> 

500 <owner>cluster3-01</owner> 

501 <package>snapmirror</package> 

502 <serial-number>1-81-0000000000000004082368507</serial-number> 

503 <type>license</type> 

504 </license-v2-info> 

505 <license-v2-info> 

506 <customer-id>none</customer-id> 

507 <description>FlexClone License</description> 

508 <legacy>false</legacy> 

509 <owner>cluster3-01</owner> 

510 <package>flexclone</package> 

511 <serial-number>1-81-0000000000000004082368507</serial-number> 

512 <type>license</type> 

513 </license-v2-info> 

514 <license-v2-info> 

515 <customer-id>none</customer-id> 

516 <description>SnapVault License</description> 

517 <legacy>false</legacy> 

518 <owner>cluster3-01</owner> 

519 <package>snapvault</package> 

520 <serial-number>1-81-0000000000000004082368507</serial-number> 

521 <type>license</type> 

522 </license-v2-info> 

523 </licenses> 

524 </results> 

525""") 

526 

527LICENSES = ( 

528 'base', 'cifs', 'fcp', 'flexclone', 'iscsi', 'nfs', 'snapmirror', 

529 'snaprestore', 'snapvault' 

530) 

531 

532VOLUME_COUNT_RESPONSE = etree.XML(""" 

533 <results status="passed"> 

534 <attributes-list> 

535 <volume-attributes> 

536 <volume-id-attributes> 

537 <name>vol0</name> 

538 <owning-vserver-name>cluster3-01</owning-vserver-name> 

539 </volume-id-attributes> 

540 </volume-attributes> 

541 <volume-attributes> 

542 <volume-id-attributes> 

543 <name>%(root_volume)s</name> 

544 <owning-vserver-name>%(fake_vserver)s</owning-vserver-name> 

545 </volume-id-attributes> 

546 </volume-attributes> 

547 </attributes-list> 

548 <num-records>2</num-records> 

549 </results> 

550""" % {'root_volume': ROOT_VOLUME_NAME, 'fake_vserver': VSERVER_NAME}) 

551 

552CIFS_SECURITY_SERVICE = { 

553 'type': 'active_directory', 

554 'password': 'fake_password', 

555 'user': 'fake_user', 

556 'ou': 'fake_ou', 

557 'domain': 'fake_domain', 

558 'dns_ip': 'fake_dns_ip', 

559 'server': 'fake_server', 

560 'default_ad_site': None, 

561} 

562 

563CIFS_SECURITY_SERVICE_2 = { 

564 'type': 'active_directory', 

565 'password': 'fake_password_2', 

566 'user': 'fake_user_2', 

567 'ou': 'fake_ou_2', 

568 'domain': 'fake_domain_2', 

569 'dns_ip': 'fake_dns_ip_2', 

570 'server': 'fake_server_2', 

571 'default_ad_site': None, 

572} 

573 

574CIFS_SECURITY_SERVICE_3 = { 

575 'type': 'active_directory', 

576 'password': 'fake_password_3', 

577 'user': 'fake_user_3', 

578 'ou': 'fake_ou_3', 

579 'domain': 'fake_domain_3', 

580 'dns_ip': 'fake_dns_ip_3', 

581 'default_ad_site': 'fake_default_ad_site_3', 

582 'server': None, 

583} 

584 

585CIFS_SECURITY_SERVICE_4 = { 

586 'type': 'active_directory', 

587 'password': 'fake_password_4', 

588 'user': 'fake_user_4', 

589 'ou': 'fake_ou_4', 

590 'domain': 'fake_domain_4', 

591 'dns_ip': 'fake_dns_ip_4', 

592 'default_ad_site': 'fake_default_ad_site_4', 

593 'server': None, 

594} 

595 

596LDAP_LINUX_SECURITY_SERVICE = { 

597 'id': 'fake_id', 

598 'type': 'ldap', 

599 'user': 'fake_user', 

600 'password': 'fake_password', 

601 'server': 'fake_server', 

602 'ou': 'fake_ou', 

603 'dns_ip': None, 

604 'domain': None 

605} 

606 

607LDAP_AD_SECURITY_SERVICE = { 

608 'id': 'fake_id', 

609 'type': 'ldap', 

610 'user': 'fake_user', 

611 'password': 'fake_password', 

612 'domain': 'fake_domain', 

613 'ou': 'fake_ou', 

614 'dns_ip': 'fake_dns_ip', 

615 'server': None, 

616} 

617 

618LDAP_AD_SECURITY_SERVICE_WITH_SERVER = { 

619 'id': 'fake_id', 

620 'type': 'ldap', 

621 'user': 'fake_user', 

622 'password': 'fake_password', 

623 'domain': None, 

624 'ou': 'fake_ou', 

625 'dns_ip': 'fake_dns_ip', 

626 'server': '10.10.10.1', 

627} 

628 

629KERBEROS_SECURITY_SERVICE = { 

630 'type': 'kerberos', 

631 'password': 'fake_password', 

632 'user': 'fake_user', 

633 'server': 'fake_server', 

634 'id': 'fake_id', 

635 'domain': 'fake_domain', 

636 'dns_ip': 'fake_dns_ip', 

637} 

638 

639KERBEROS_SERVICE_PRINCIPAL_NAME = 'nfs/fake-vserver.fake_domain@FAKE_DOMAIN' 

640 

641INVALID_SECURITY_SERVICE = { 

642 'type': 'fake', 

643} 

644 

645SYSTEM_NODE_GET_ITER_RESPONSE = etree.XML(""" 

646 <results status="passed"> 

647 <attributes-list> 

648 <node-details-info> 

649 <node>%s</node> 

650 </node-details-info> 

651 </attributes-list> 

652 <num-records>1</num-records> 

653 </results> 

654""" % NODE_NAME) 

655 

656SECUTITY_KEY_MANAGER_NVE_SUPPORT_RESPONSE_TRUE = etree.XML(""" 

657 <results status="passed"> 

658 <vol-encryption-supported>true</vol-encryption-supported> 

659 </results> 

660""") 

661 

662SECUTITY_KEY_MANAGER_NVE_SUPPORT_RESPONSE_FALSE = etree.XML(""" 

663 <results status="passed"> 

664 <vol-encryption-supported>false</vol-encryption-supported> 

665 </results> 

666""") 

667 

668NET_PORT_GET_RESPONSE_NO_VLAN = etree.XML(""" 

669 <results status="passed"> 

670 <attributes> 

671 <net-port-info> 

672 <administrative-duplex>auto</administrative-duplex> 

673 <administrative-flowcontrol>full</administrative-flowcontrol> 

674 <administrative-speed>auto</administrative-speed>f 

675 <broadcast-domain>%(domain)s</broadcast-domain> 

676 <health-status>healthy</health-status> 

677 <ignore-health-status>false</ignore-health-status> 

678 <ipspace>%(ipspace)s</ipspace> 

679 <is-administrative-auto-negotiate>true</is-administrative-auto-negotiate> 

680 <is-administrative-up>true</is-administrative-up> 

681 <is-operational-auto-negotiate>true</is-operational-auto-negotiate> 

682 <link-status>up</link-status> 

683 <mac-address>00:0c:29:fc:04:f7</mac-address> 

684 <mtu>1500</mtu> 

685 <mtu-admin>1500</mtu-admin> 

686 <node>%(node_name)s</node> 

687 <operational-duplex>full</operational-duplex> 

688 <operational-flowcontrol>receive</operational-flowcontrol> 

689 <operational-speed>1000</operational-speed> 

690 <port>%(port)s</port> 

691 <port-type>physical</port-type> 

692 <role>data</role> 

693 </net-port-info> 

694 </attributes> 

695 </results> 

696""" % {'domain': BROADCAST_DOMAIN, 

697 'ipspace': IPSPACE_NAME, 

698 'node_name': NODE_NAME, 

699 'port': PORT}) 

700 

701NET_PORT_GET_RESPONSE = etree.XML(""" 

702 <results status="passed"> 

703 <attributes> 

704 <net-port-info> 

705 <administrative-duplex>auto</administrative-duplex> 

706 <administrative-flowcontrol>full</administrative-flowcontrol> 

707 <administrative-speed>auto</administrative-speed> 

708 <health-status>healthy</health-status> 

709 <ignore-health-status>false</ignore-health-status> 

710 <ipspace>%(ipspace)s</ipspace> 

711 <is-administrative-auto-negotiate>true</is-administrative-auto-negotiate> 

712 <is-administrative-up>true</is-administrative-up> 

713 <is-operational-auto-negotiate>true</is-operational-auto-negotiate> 

714 <link-status>up</link-status> 

715 <mac-address>00:0c:29:fc:04:f7</mac-address> 

716 <mtu>1500</mtu> 

717 <mtu-admin>1500</mtu-admin> 

718 <node>%(node_name)s</node> 

719 <operational-duplex>full</operational-duplex> 

720 <operational-flowcontrol>receive</operational-flowcontrol> 

721 <operational-speed>1000</operational-speed> 

722 <port>%(port)s-%(vlan)s</port> 

723 <port-type>vlan</port-type> 

724 <role>data</role> 

725 <vlan-id>%(vlan)s</vlan-id> 

726 <vlan-node>%(node_name)s</vlan-node> 

727 <vlan-port>%(port)s</vlan-port> 

728 </net-port-info> 

729 </attributes> 

730 </results> 

731""" % {'ipspace': IPSPACE_NAME, 

732 'node_name': NODE_NAME, 

733 'port': PORT, 

734 'vlan': VLAN}) 

735 

736NET_PORT_GET_ITER_RESPONSE = etree.XML(""" 

737 <results status="passed"> 

738 <attributes-list> 

739 <net-port-info> 

740 <administrative-duplex>full</administrative-duplex> 

741 <administrative-flowcontrol>full</administrative-flowcontrol> 

742 <administrative-speed>auto</administrative-speed> 

743 <is-administrative-auto-negotiate>true</is-administrative-auto-negotiate> 

744 <is-administrative-up>true</is-administrative-up> 

745 <is-operational-auto-negotiate>true</is-operational-auto-negotiate> 

746 <link-status>up</link-status> 

747 <mac-address>00:0c:29:fc:04:d9</mac-address> 

748 <mtu>1500</mtu> 

749 <node>%(node_name)s</node> 

750 <operational-duplex>full</operational-duplex> 

751 <operational-flowcontrol>none</operational-flowcontrol> 

752 <operational-speed>10</operational-speed> 

753 <port>e0a</port> 

754 <port-type>physical</port-type> 

755 <role>data</role> 

756 </net-port-info> 

757 <net-port-info> 

758 <administrative-duplex>full</administrative-duplex> 

759 <administrative-flowcontrol>full</administrative-flowcontrol> 

760 <administrative-speed>auto</administrative-speed> 

761 <is-administrative-auto-negotiate>true</is-administrative-auto-negotiate> 

762 <is-administrative-up>true</is-administrative-up> 

763 <is-operational-auto-negotiate>true</is-operational-auto-negotiate> 

764 <link-status>up</link-status> 

765 <mac-address>00:0c:29:fc:04:e3</mac-address> 

766 <mtu>1500</mtu> 

767 <node>%(node_name)s</node> 

768 <operational-duplex>full</operational-duplex> 

769 <operational-flowcontrol>none</operational-flowcontrol> 

770 <operational-speed>100</operational-speed> 

771 <port>e0b</port> 

772 <port-type>physical</port-type> 

773 <role>data</role> 

774 </net-port-info> 

775 <net-port-info> 

776 <administrative-duplex>full</administrative-duplex> 

777 <administrative-flowcontrol>full</administrative-flowcontrol> 

778 <administrative-speed>auto</administrative-speed> 

779 <is-administrative-auto-negotiate>true</is-administrative-auto-negotiate> 

780 <is-administrative-up>true</is-administrative-up> 

781 <is-operational-auto-negotiate>true</is-operational-auto-negotiate> 

782 <link-status>up</link-status> 

783 <mac-address>00:0c:29:fc:04:ed</mac-address> 

784 <mtu>1500</mtu> 

785 <node>%(node_name)s</node> 

786 <operational-duplex>full</operational-duplex> 

787 <operational-flowcontrol>none</operational-flowcontrol> 

788 <operational-speed>1000</operational-speed> 

789 <port>e0c</port> 

790 <port-type>physical</port-type> 

791 <role>data</role> 

792 </net-port-info> 

793 <net-port-info> 

794 <administrative-duplex>full</administrative-duplex> 

795 <administrative-flowcontrol>full</administrative-flowcontrol> 

796 <administrative-speed>auto</administrative-speed> 

797 <is-administrative-auto-negotiate>true</is-administrative-auto-negotiate> 

798 <is-administrative-up>true</is-administrative-up> 

799 <is-operational-auto-negotiate>true</is-operational-auto-negotiate> 

800 <link-status>up</link-status> 

801 <mac-address>00:0c:29:fc:04:f7</mac-address> 

802 <mtu>1500</mtu> 

803 <node>%(node_name)s</node> 

804 <operational-duplex>full</operational-duplex> 

805 <operational-flowcontrol>none</operational-flowcontrol> 

806 <operational-speed>10000</operational-speed> 

807 <port>e0d</port> 

808 <port-type>physical</port-type> 

809 <role>data</role> 

810 </net-port-info> 

811 </attributes-list> 

812 <num-records>4</num-records> 

813 </results> 

814""" % {'node_name': NODE_NAME}) 

815 

816SPEED_SORTED_PORTS = ( 

817 {'node': NODE_NAME, 'port': 'e0d', 'speed': '10000'}, 

818 {'node': NODE_NAME, 'port': 'e0c', 'speed': '1000'}, 

819 {'node': NODE_NAME, 'port': 'e0b', 'speed': '100'}, 

820 {'node': NODE_NAME, 'port': 'e0a', 'speed': '10'}, 

821) 

822PORT_NAMES = ('e0a', 'e0b', 'e0c', 'e0d') 

823SPEED_SORTED_PORT_NAMES = ('e0d', 'e0c', 'e0b', 'e0a') 

824 

825UNSORTED_PORTS_ALL_SPEEDS = ( 

826 {'node': NODE_NAME, 'port': 'port6', 'speed': 'undef'}, 

827 {'node': NODE_NAME, 'port': 'port3', 'speed': '100'}, 

828 {'node': NODE_NAME, 'port': 'port1', 'speed': '10000'}, 

829 {'node': NODE_NAME, 'port': 'port4', 'speed': '10'}, 

830 {'node': NODE_NAME, 'port': 'port7'}, 

831 {'node': NODE_NAME, 'port': 'port2', 'speed': '1000'}, 

832 {'node': NODE_NAME, 'port': 'port5', 'speed': 'auto'}, 

833) 

834 

835SORTED_PORTS_ALL_SPEEDS = ( 

836 {'node': NODE_NAME, 'port': 'port1', 'speed': '10000'}, 

837 {'node': NODE_NAME, 'port': 'port2', 'speed': '1000'}, 

838 {'node': NODE_NAME, 'port': 'port3', 'speed': '100'}, 

839 {'node': NODE_NAME, 'port': 'port4', 'speed': '10'}, 

840 {'node': NODE_NAME, 'port': 'port5', 'speed': 'auto'}, 

841 {'node': NODE_NAME, 'port': 'port6', 'speed': 'undef'}, 

842 {'node': NODE_NAME, 'port': 'port7'}, 

843) 

844 

845NET_PORT_GET_ITER_BROADCAST_DOMAIN_RESPONSE = etree.XML(""" 

846 <results status="passed"> 

847 <attributes-list> 

848 <net-port-info> 

849 <ipspace>%(ipspace)s</ipspace> 

850 <broadcast-domain>%(domain)s</broadcast-domain> 

851 <node>%(node)s</node> 

852 <port>%(port)s</port> 

853 </net-port-info> 

854 </attributes-list> 

855 <num-records>1</num-records> 

856 </results> 

857""" % { 

858 'domain': BROADCAST_DOMAIN, 

859 'node': NODE_NAME, 

860 'port': PORT, 

861 'ipspace': IPSPACE_NAME, 

862}) 

863 

864NET_PORT_GET_ITER_BROADCAST_DOMAIN_MISSING_RESPONSE = etree.XML(""" 

865 <results status="passed"> 

866 <attributes-list> 

867 <net-port-info> 

868 <ipspace>%(ipspace)s</ipspace> 

869 <node>%(node)s</node> 

870 <port>%(port)s</port> 

871 </net-port-info> 

872 </attributes-list> 

873 <num-records>1</num-records> 

874 </results> 

875""" % {'node': NODE_NAME, 'port': PORT, 'ipspace': IPSPACE_NAME}) 

876 

877NET_PORT_BROADCAST_DOMAIN_GET_ITER_RESPONSE = etree.XML(""" 

878 <results status="passed"> 

879 <attributes-list> 

880 <net-port-broadcast-domain-info> 

881 <broadcast-domain>%(domain)s</broadcast-domain> 

882 <ipspace>%(ipspace)s</ipspace> 

883 </net-port-broadcast-domain-info> 

884 </attributes-list> 

885 <num-records>1</num-records> 

886 </results> 

887""" % {'domain': BROADCAST_DOMAIN, 'ipspace': IPSPACE_NAME}) 

888 

889NET_IPSPACES_GET_ITER_RESPONSE = etree.XML(""" 

890 <results status="passed"> 

891 <attributes-list> 

892 <net-ipspaces-info> 

893 <broadcast-domains> 

894 <broadcast-domain-name>%(domain)s</broadcast-domain-name> 

895 </broadcast-domains> 

896 <id>fake_id</id> 

897 <ipspace>%(ipspace)s</ipspace> 

898 <ports> 

899 <net-qualified-port-name>%(node)s:%(port)s</net-qualified-port-name> 

900 </ports> 

901 <uuid>fake_uuid</uuid> 

902 <vservers> 

903 <vserver-name>%(ipspace)s</vserver-name> 

904 <vserver-name>%(vserver)s</vserver-name> 

905 </vservers> 

906 </net-ipspaces-info> 

907 </attributes-list> 

908 <num-records>1</num-records> 

909 </results> 

910""" % { 

911 'domain': BROADCAST_DOMAIN, 

912 'ipspace': IPSPACE_NAME, 

913 'node': NODE_NAME2, 

914 'port': VLAN_PORT, 

915 'vserver': VSERVER_NAME 

916}) 

917 

918NET_INTERFACE_GET_ITER_RESPONSE = etree.XML(""" 

919 <results status="passed"> 

920 <attributes-list> 

921 <net-interface-info> 

922 <address>192.168.228.42</address> 

923 <address-family>ipv4</address-family> 

924 <administrative-status>up</administrative-status> 

925 <current-node>%(node)s</current-node> 

926 <current-port>e0c</current-port> 

927 <data-protocols> 

928 <data-protocol>none</data-protocol> 

929 </data-protocols> 

930 <dns-domain-name>none</dns-domain-name> 

931 <failover-group>system-defined</failover-group> 

932 <failover-policy>disabled</failover-policy> 

933 <firewall-policy>mgmt</firewall-policy> 

934 <home-node>%(node)s</home-node> 

935 <home-port>e0c</home-port> 

936 <interface-name>cluster_mgmt</interface-name> 

937 <is-auto-revert>true</is-auto-revert> 

938 <is-home>true</is-home> 

939 <lif-uuid>d3230112-7524-11e4-8608-123478563412</lif-uuid> 

940 <listen-for-dns-query>false</listen-for-dns-query> 

941 <netmask>%(netmask)s</netmask> 

942 <netmask-length>24</netmask-length> 

943 <operational-status>up</operational-status> 

944 <role>cluster_mgmt</role> 

945 <routing-group-name>c192.168.228.0/24</routing-group-name> 

946 <use-failover-group>system_defined</use-failover-group> 

947 <vserver>cluster3</vserver> 

948 </net-interface-info> 

949 <net-interface-info> 

950 <address>192.168.228.43</address> 

951 <address-family>ipv4</address-family> 

952 <administrative-status>up</administrative-status> 

953 <current-node>%(node)s</current-node> 

954 <current-port>e0d</current-port> 

955 <dns-domain-name>none</dns-domain-name> 

956 <failover-group>system-defined</failover-group> 

957 <failover-policy>nextavail</failover-policy> 

958 <firewall-policy>mgmt</firewall-policy> 

959 <home-node>%(node)s</home-node> 

960 <home-port>e0d</home-port> 

961 <interface-name>mgmt1</interface-name> 

962 <is-auto-revert>true</is-auto-revert> 

963 <is-home>true</is-home> 

964 <lif-uuid>0ccc57cc-7525-11e4-8608-123478563412</lif-uuid> 

965 <listen-for-dns-query>false</listen-for-dns-query> 

966 <netmask>%(netmask)s</netmask> 

967 <netmask-length>24</netmask-length> 

968 <operational-status>up</operational-status> 

969 <role>node_mgmt</role> 

970 <routing-group-name>n192.168.228.0/24</routing-group-name> 

971 <use-failover-group>system_defined</use-failover-group> 

972 <vserver>cluster3-01</vserver> 

973 </net-interface-info> 

974 <net-interface-info> 

975 <address>%(address)s</address> 

976 <address-family>ipv4</address-family> 

977 <administrative-status>up</administrative-status> 

978 <current-node>%(node)s</current-node> 

979 <current-port>%(vlan)s</current-port> 

980 <data-protocols> 

981 <data-protocol>nfs</data-protocol> 

982 <data-protocol>cifs</data-protocol> 

983 </data-protocols> 

984 <dns-domain-name>none</dns-domain-name> 

985 <failover-group>system-defined</failover-group> 

986 <failover-policy>nextavail</failover-policy> 

987 <firewall-policy>data</firewall-policy> 

988 <home-node>%(node)s</home-node> 

989 <home-port>%(vlan)s</home-port> 

990 <interface-name>%(lif)s</interface-name> 

991 <is-auto-revert>false</is-auto-revert> 

992 <is-home>true</is-home> 

993 <lif-uuid>db4d91b6-95d9-11e4-8608-123478563412</lif-uuid> 

994 <listen-for-dns-query>false</listen-for-dns-query> 

995 <netmask>%(netmask)s</netmask> 

996 <netmask-length>24</netmask-length> 

997 <operational-status>up</operational-status> 

998 <role>data</role> 

999 <routing-group-name>d10.0.0.0/24</routing-group-name> 

1000 <use-failover-group>system_defined</use-failover-group> 

1001 <vserver>%(vserver)s</vserver> 

1002 </net-interface-info> 

1003 </attributes-list> 

1004 <num-records>3</num-records> 

1005 </results> 

1006""" % { 

1007 'lif': LIF_NAME, 

1008 'vserver': VSERVER_NAME, 

1009 'node': NODE_NAME, 

1010 'address': IP_ADDRESS, 

1011 'netmask': NETMASK, 

1012 'vlan': VLAN_PORT, 

1013}) 

1014 

1015LIF_NAMES = ('cluster_mgmt', 'mgmt1', LIF_NAME) 

1016 

1017NET_INTERFACE_GET_ITER_RESPONSE_NFS = etree.XML(""" 

1018 <results status="passed"> 

1019 <attributes-list> 

1020 <net-interface-info> 

1021 <address>%(address)s</address> 

1022 <address-family>ipv4</address-family> 

1023 <administrative-status>up</administrative-status> 

1024 <current-node>%(node)s</current-node> 

1025 <current-port>%(vlan)s</current-port> 

1026 <data-protocols> 

1027 <data-protocol>nfs</data-protocol> 

1028 <data-protocol>cifs</data-protocol> 

1029 </data-protocols> 

1030 <dns-domain-name>none</dns-domain-name> 

1031 <failover-group>system-defined</failover-group> 

1032 <failover-policy>nextavail</failover-policy> 

1033 <firewall-policy>data</firewall-policy> 

1034 <home-node>%(node)s</home-node> 

1035 <home-port>%(vlan)s</home-port> 

1036 <interface-name>%(lif)s</interface-name> 

1037 <is-auto-revert>false</is-auto-revert> 

1038 <is-home>true</is-home> 

1039 <lif-uuid>db4d91b6-95d9-11e4-8608-123478563412</lif-uuid> 

1040 <listen-for-dns-query>false</listen-for-dns-query> 

1041 <netmask>%(netmask)s</netmask> 

1042 <netmask-length>24</netmask-length> 

1043 <operational-status>up</operational-status> 

1044 <role>data</role> 

1045 <routing-group-name>d10.0.0.0/24</routing-group-name> 

1046 <use-failover-group>system_defined</use-failover-group> 

1047 <vserver>%(vserver)s</vserver> 

1048 </net-interface-info> 

1049 </attributes-list> 

1050 <num-records>1</num-records> 

1051 </results> 

1052""" % { 

1053 'lif': LIF_NAME, 

1054 'vserver': VSERVER_NAME, 

1055 'node': NODE_NAME, 

1056 'address': IP_ADDRESS, 

1057 'netmask': NETMASK, 

1058 'vlan': VLAN_PORT, 

1059}) 

1060 

1061LIFS = ( 

1062 {'address': '192.168.228.42', 

1063 'administrative-status': 'up', 

1064 'home-node': NODE_NAME, 

1065 'home-port': 'e0c', 

1066 'interface-name': 'cluster_mgmt', 

1067 'netmask': NETMASK, 

1068 'role': 'cluster_mgmt', 

1069 'vserver': 'cluster3' 

1070 }, 

1071 {'address': '192.168.228.43', 

1072 'administrative-status': 'up', 

1073 'home-node': NODE_NAME, 

1074 'home-port': 'e0d', 

1075 'interface-name': 'mgmt1', 

1076 'netmask': NETMASK, 

1077 'role': 'node_mgmt', 

1078 'vserver': 'cluster3-01' 

1079 }, 

1080 {'address': IP_ADDRESS, 

1081 'administrative-status': 'up', 

1082 'home-node': NODE_NAME, 

1083 'home-port': VLAN_PORT, 

1084 'interface-name': LIF_NAME, 

1085 'netmask': NETMASK, 

1086 'role': 'data', 

1087 'vserver': VSERVER_NAME, 

1088 }, 

1089) 

1090 

1091NFS_LIFS = [ 

1092 {'address': IP_ADDRESS, 

1093 'administrative-status': 'up', 

1094 'home-node': NODE_NAME, 

1095 'home-port': VLAN_PORT, 

1096 'interface-name': LIF_NAME, 

1097 'netmask': NETMASK, 

1098 'role': 'data', 

1099 'vserver': VSERVER_NAME, 

1100 }, 

1101] 

1102 

1103NFS_LIFS_REST = [ 

1104 { 

1105 'uuid': 'fake_uuid_1', 

1106 'enabled': 'true', 

1107 'address': IP_ADDRESS, 

1108 'home-node': NODE_NAME, 

1109 'home-port': VLAN_PORT, 

1110 'interface-name': LIF_NAME, 

1111 'netmask': NETMASK, 

1112 'role': 'data', 

1113 'vserver': VSERVER_NAME, 

1114 }, 

1115 { 

1116 'uuid': 'fake_uuid_2', 

1117 'enabled': 'true', 

1118 'address': IP_ADDRESS, 

1119 'home-node': NODE_NAME, 

1120 'home-port': VLAN_PORT, 

1121 'interface-name': LIF_NAME, 

1122 'netmask': NETMASK, 

1123 'role': 'data', 

1124 'vserver': VSERVER_NAME, 

1125 }, 

1126 { 

1127 'uuid': 'fake_uuid_3', 

1128 'enabled': 'true', 

1129 'address': IP_ADDRESS, 

1130 'home-node': NODE_NAME, 

1131 'home-port': VLAN_PORT, 

1132 'interface-name': LIF_NAME, 

1133 'netmask': NETMASK, 

1134 'role': 'data', 

1135 'vserver': VSERVER_NAME, 

1136 }, 

1137] 

1138 

1139NET_INTERFACE_GET_ONE_RESPONSE = etree.XML(""" 

1140 <results status="passed"> 

1141 <attributes-list> 

1142 <net-interface-info> 

1143 <interface-name>%(lif)s</interface-name> 

1144 <vserver>%(vserver)s</vserver> 

1145 </net-interface-info> 

1146 </attributes-list> 

1147 <num-records>1</num-records> 

1148 </results> 

1149""" % {'lif': LIF_NAME, 'vserver': VSERVER_NAME}) 

1150 

1151AGGR_GET_NAMES_RESPONSE = etree.XML(""" 

1152 <results status="passed"> 

1153 <attributes-list> 

1154 <aggr-attributes> 

1155 <aggr-raid-attributes> 

1156 </aggr-raid-attributes> 

1157 <aggregate-name>%(root1)s</aggregate-name> 

1158 </aggr-attributes> 

1159 <aggr-attributes> 

1160 <aggr-raid-attributes> 

1161 </aggr-raid-attributes> 

1162 <aggregate-name>%(root2)s</aggregate-name> 

1163 </aggr-attributes> 

1164 <aggr-attributes> 

1165 <aggr-raid-attributes> 

1166 </aggr-raid-attributes> 

1167 <aggregate-name>%(aggr1)s</aggregate-name> 

1168 </aggr-attributes> 

1169 <aggr-attributes> 

1170 <aggr-raid-attributes> 

1171 </aggr-raid-attributes> 

1172 <aggregate-name>%(aggr2)s</aggregate-name> 

1173 </aggr-attributes> 

1174 </attributes-list> 

1175 <num-records>2</num-records> 

1176 </results> 

1177""" % { 

1178 'root1': ROOT_AGGREGATE_NAMES[0], 

1179 'root2': ROOT_AGGREGATE_NAMES[1], 

1180 'aggr1': SHARE_AGGREGATE_NAMES[0], 

1181 'aggr2': SHARE_AGGREGATE_NAMES[1], 

1182}) 

1183 

1184AGGR_GET_SPACE_RESPONSE = etree.XML(""" 

1185 <results status="passed"> 

1186 <attributes-list> 

1187 <aggr-attributes> 

1188 <aggr-raid-attributes> 

1189 <plexes> 

1190 <plex-attributes> 

1191 <plex-name>/%(aggr1)s/plex0</plex-name> 

1192 <raidgroups> 

1193 <raidgroup-attributes> 

1194 <raidgroup-name>/%(aggr1)s/plex0/rg0</raidgroup-name> 

1195 </raidgroup-attributes> 

1196 </raidgroups> 

1197 </plex-attributes> 

1198 </plexes> 

1199 </aggr-raid-attributes> 

1200 <aggr-space-attributes> 

1201 <size-available>45670400</size-available> 

1202 <size-total>943718400</size-total> 

1203 <size-used>898048000</size-used> 

1204 </aggr-space-attributes> 

1205 <aggregate-name>%(aggr1)s</aggregate-name> 

1206 </aggr-attributes> 

1207 <aggr-attributes> 

1208 <aggr-raid-attributes> 

1209 <plexes> 

1210 <plex-attributes> 

1211 <plex-name>/%(aggr2)s/plex0</plex-name> 

1212 <raidgroups> 

1213 <raidgroup-attributes> 

1214 <raidgroup-name>/%(aggr2)s/plex0/rg0</raidgroup-name> 

1215 </raidgroup-attributes> 

1216 <raidgroup-attributes> 

1217 <raidgroup-name>/%(aggr2)s/plex0/rg1</raidgroup-name> 

1218 </raidgroup-attributes> 

1219 </raidgroups> 

1220 </plex-attributes> 

1221 </plexes> 

1222 </aggr-raid-attributes> 

1223 <aggr-space-attributes> 

1224 <size-available>4267659264</size-available> 

1225 <size-total>7549747200</size-total> 

1226 <size-used>3282087936</size-used> 

1227 </aggr-space-attributes> 

1228 <aggregate-name>%(aggr2)s</aggregate-name> 

1229 </aggr-attributes> 

1230 </attributes-list> 

1231 <num-records>2</num-records> 

1232 </results> 

1233""" % { 

1234 'aggr1': SHARE_AGGREGATE_NAMES[0], 

1235 'aggr2': SHARE_AGGREGATE_NAMES[1], 

1236}) 

1237 

1238AGGR_GET_NODE_RESPONSE = etree.XML(""" 

1239 <results status="passed"> 

1240 <attributes-list> 

1241 <aggr-attributes> 

1242 <aggr-ownership-attributes> 

1243 <home-name>%(node)s</home-name> 

1244 </aggr-ownership-attributes> 

1245 <aggregate-name>%(aggr)s</aggregate-name> 

1246 </aggr-attributes> 

1247 </attributes-list> 

1248 <num-records>1</num-records> 

1249 </results> 

1250""" % { 

1251 'aggr': SHARE_AGGREGATE_NAME, 

1252 'node': NODE_NAME 

1253}) 

1254 

1255AGGR_GET_ITER_RESPONSE = etree.XML(""" 

1256 <results status="passed"> 

1257 <attributes-list> 

1258 <aggr-attributes> 

1259 <aggr-64bit-upgrade-attributes> 

1260 <aggr-status-attributes> 

1261 <is-64-bit-upgrade-in-progress>false</is-64-bit-upgrade-in-progress> 

1262 </aggr-status-attributes> 

1263 </aggr-64bit-upgrade-attributes> 

1264 <aggr-fs-attributes> 

1265 <block-type>64_bit</block-type> 

1266 <fsid>1758646411</fsid> 

1267 <type>aggr</type> 

1268 </aggr-fs-attributes> 

1269 <aggr-inode-attributes> 

1270 <files-private-used>512</files-private-used> 

1271 <files-total>30384</files-total> 

1272 <files-used>96</files-used> 

1273 <inodefile-private-capacity>30384</inodefile-private-capacity> 

1274 <inodefile-public-capacity>30384</inodefile-public-capacity> 

1275 <maxfiles-available>30384</maxfiles-available> 

1276 <maxfiles-possible>243191</maxfiles-possible> 

1277 <maxfiles-used>96</maxfiles-used> 

1278 <percent-inode-used-capacity>0</percent-inode-used-capacity> 

1279 </aggr-inode-attributes> 

1280 <aggr-ownership-attributes> 

1281 <home-id>4082368507</home-id> 

1282 <home-name>cluster3-01</home-name> 

1283 <owner-id>4082368507</owner-id> 

1284 <owner-name>cluster3-01</owner-name> 

1285 </aggr-ownership-attributes> 

1286 <aggr-performance-attributes> 

1287 <free-space-realloc>off</free-space-realloc> 

1288 <max-write-alloc-blocks>0</max-write-alloc-blocks> 

1289 </aggr-performance-attributes> 

1290 <aggr-raid-attributes> 

1291 <checksum-status>active</checksum-status> 

1292 <checksum-style>block</checksum-style> 

1293 <disk-count>3</disk-count> 

1294 <ha-policy>cfo</ha-policy> 

1295 <has-local-root>true</has-local-root> 

1296 <has-partner-root>false</has-partner-root> 

1297 <is-checksum-enabled>true</is-checksum-enabled> 

1298 <is-hybrid>false</is-hybrid> 

1299 <is-hybrid-enabled>false</is-hybrid-enabled> 

1300 <is-inconsistent>false</is-inconsistent> 

1301 <mirror-status>unmirrored</mirror-status> 

1302 <mount-state>online</mount-state> 

1303 <plex-count>1</plex-count> 

1304 <plexes> 

1305 <plex-attributes> 

1306 <is-online>true</is-online> 

1307 <is-resyncing>false</is-resyncing> 

1308 <plex-name>/%(aggr1)s/plex0</plex-name> 

1309 <plex-status>normal,active</plex-status> 

1310 <raidgroups> 

1311 <raidgroup-attributes> 

1312 <checksum-style>block</checksum-style> 

1313 <is-cache-tier>false</is-cache-tier> 

1314 <is-recomputing-parity>false</is-recomputing-parity> 

1315 <is-reconstructing>false</is-reconstructing> 

1316 <raidgroup-name>/%(aggr1)s/plex0/rg0</raidgroup-name> 

1317 <recomputing-parity-percentage>0</recomputing-parity-percentage> 

1318 <reconstruction-percentage>0</reconstruction-percentage> 

1319 </raidgroup-attributes> 

1320 </raidgroups> 

1321 <resyncing-percentage>0</resyncing-percentage> 

1322 </plex-attributes> 

1323 </plexes> 

1324 <raid-lost-write-state>on</raid-lost-write-state> 

1325 <raid-size>16</raid-size> 

1326 <raid-status>raid_dp, normal</raid-status> 

1327 <raid-type>raid_dp</raid-type> 

1328 <state>online</state> 

1329 </aggr-raid-attributes> 

1330 <aggr-snaplock-attributes> 

1331 <is-snaplock>true</is-snaplock> 

1332 <snaplock-type>enterprise</snaplock-type> 

1333 </aggr-snaplock-attributes> 

1334 <aggr-snapshot-attributes> 

1335 <files-total>0</files-total> 

1336 <files-used>0</files-used> 

1337 <is-snapshot-auto-create-enabled>true</is-snapshot-auto-create-enabled> 

1338 <is-snapshot-auto-delete-enabled>true</is-snapshot-auto-delete-enabled> 

1339 <maxfiles-available>0</maxfiles-available> 

1340 <maxfiles-possible>0</maxfiles-possible> 

1341 <maxfiles-used>0</maxfiles-used> 

1342 <percent-inode-used-capacity>0</percent-inode-used-capacity> 

1343 <percent-used-capacity>0</percent-used-capacity> 

1344 <size-available>0</size-available> 

1345 <size-total>0</size-total> 

1346 <size-used>0</size-used> 

1347 <snapshot-reserve-percent>0</snapshot-reserve-percent> 

1348 </aggr-snapshot-attributes> 

1349 <aggr-space-attributes> 

1350 <aggregate-metadata>245760</aggregate-metadata> 

1351 <hybrid-cache-size-total>0</hybrid-cache-size-total> 

1352 <percent-used-capacity>95</percent-used-capacity> 

1353 <size-available>45670400</size-available> 

1354 <size-total>943718400</size-total> 

1355 <size-used>898048000</size-used> 

1356 <total-reserved-space>0</total-reserved-space> 

1357 <used-including-snapshot-reserve>898048000</used-including-snapshot-reserve> 

1358 <volume-footprints>897802240</volume-footprints> 

1359 </aggr-space-attributes> 

1360 <aggr-volume-count-attributes> 

1361 <flexvol-count>1</flexvol-count> 

1362 <flexvol-count-collective>0</flexvol-count-collective> 

1363 <flexvol-count-striped>0</flexvol-count-striped> 

1364 </aggr-volume-count-attributes> 

1365 <aggregate-name>%(aggr1)s</aggregate-name> 

1366 <aggregate-uuid>15863632-ea49-49a8-9c88-2bd2d57c6d7a</aggregate-uuid> 

1367 <nodes> 

1368 <node-name>cluster3-01</node-name> 

1369 </nodes> 

1370 <striping-type>unknown</striping-type> 

1371 </aggr-attributes> 

1372 <aggr-attributes> 

1373 <aggr-64bit-upgrade-attributes> 

1374 <aggr-status-attributes> 

1375 <is-64-bit-upgrade-in-progress>false</is-64-bit-upgrade-in-progress> 

1376 </aggr-status-attributes> 

1377 </aggr-64bit-upgrade-attributes> 

1378 <aggr-fs-attributes> 

1379 <block-type>64_bit</block-type> 

1380 <fsid>706602229</fsid> 

1381 <type>aggr</type> 

1382 </aggr-fs-attributes> 

1383 <aggr-inode-attributes> 

1384 <files-private-used>528</files-private-used> 

1385 <files-total>31142</files-total> 

1386 <files-used>96</files-used> 

1387 <inodefile-private-capacity>31142</inodefile-private-capacity> 

1388 <inodefile-public-capacity>31142</inodefile-public-capacity> 

1389 <maxfiles-available>31142</maxfiles-available> 

1390 <maxfiles-possible>1945584</maxfiles-possible> 

1391 <maxfiles-used>96</maxfiles-used> 

1392 <percent-inode-used-capacity>0</percent-inode-used-capacity> 

1393 </aggr-inode-attributes> 

1394 <aggr-ownership-attributes> 

1395 <home-id>4082368507</home-id> 

1396 <home-name>cluster3-01</home-name> 

1397 <owner-id>4082368507</owner-id> 

1398 <owner-name>cluster3-01</owner-name> 

1399 </aggr-ownership-attributes> 

1400 <aggr-performance-attributes> 

1401 <free-space-realloc>off</free-space-realloc> 

1402 <max-write-alloc-blocks>0</max-write-alloc-blocks> 

1403 </aggr-performance-attributes> 

1404 <aggr-raid-attributes> 

1405 <checksum-status>active</checksum-status> 

1406 <checksum-style>block</checksum-style> 

1407 <disk-count>10</disk-count> 

1408 <ha-policy>sfo</ha-policy> 

1409 <has-local-root>false</has-local-root> 

1410 <has-partner-root>false</has-partner-root> 

1411 <is-checksum-enabled>true</is-checksum-enabled> 

1412 <is-hybrid>false</is-hybrid> 

1413 <is-hybrid-enabled>false</is-hybrid-enabled> 

1414 <is-inconsistent>false</is-inconsistent> 

1415 <mirror-status>unmirrored</mirror-status> 

1416 <mount-state>online</mount-state> 

1417 <plex-count>1</plex-count> 

1418 <plexes> 

1419 <plex-attributes> 

1420 <is-online>true</is-online> 

1421 <is-resyncing>false</is-resyncing> 

1422 <plex-name>/%(aggr2)s/plex0</plex-name> 

1423 <plex-status>normal,active</plex-status> 

1424 <raidgroups> 

1425 <raidgroup-attributes> 

1426 <checksum-style>block</checksum-style> 

1427 <is-cache-tier>false</is-cache-tier> 

1428 <is-recomputing-parity>false</is-recomputing-parity> 

1429 <is-reconstructing>false</is-reconstructing> 

1430 <raidgroup-name>/%(aggr2)s/plex0/rg0</raidgroup-name> 

1431 <recomputing-parity-percentage>0</recomputing-parity-percentage> 

1432 <reconstruction-percentage>0</reconstruction-percentage> 

1433 </raidgroup-attributes> 

1434 <raidgroup-attributes> 

1435 <checksum-style>block</checksum-style> 

1436 <is-cache-tier>false</is-cache-tier> 

1437 <is-recomputing-parity>false</is-recomputing-parity> 

1438 <is-reconstructing>false</is-reconstructing> 

1439 <raidgroup-name>/%(aggr2)s/plex0/rg1</raidgroup-name> 

1440 <recomputing-parity-percentage>0</recomputing-parity-percentage> 

1441 <reconstruction-percentage>0</reconstruction-percentage> 

1442 </raidgroup-attributes> 

1443 </raidgroups> 

1444 <resyncing-percentage>0</resyncing-percentage> 

1445 </plex-attributes> 

1446 </plexes> 

1447 <raid-lost-write-state>on</raid-lost-write-state> 

1448 <raid-size>8</raid-size> 

1449 <raid-status>raid4, normal</raid-status> 

1450 <raid-type>raid4</raid-type> 

1451 <state>online</state> 

1452 </aggr-raid-attributes> 

1453 <aggr-snaplock-attributes> 

1454 <is-snaplock>true</is-snaplock> 

1455 <snaplock-type>compliance</snaplock-type> 

1456 </aggr-snaplock-attributes> 

1457 <aggr-snapshot-attributes> 

1458 <files-total>0</files-total> 

1459 <files-used>0</files-used> 

1460 <is-snapshot-auto-create-enabled>true</is-snapshot-auto-create-enabled> 

1461 <is-snapshot-auto-delete-enabled>true</is-snapshot-auto-delete-enabled> 

1462 <maxfiles-available>0</maxfiles-available> 

1463 <maxfiles-possible>0</maxfiles-possible> 

1464 <maxfiles-used>0</maxfiles-used> 

1465 <percent-inode-used-capacity>0</percent-inode-used-capacity> 

1466 <percent-used-capacity>0</percent-used-capacity> 

1467 <size-available>0</size-available> 

1468 <size-total>0</size-total> 

1469 <size-used>0</size-used> 

1470 <snapshot-reserve-percent>0</snapshot-reserve-percent> 

1471 </aggr-snapshot-attributes> 

1472 <aggr-space-attributes> 

1473 <aggregate-metadata>425984</aggregate-metadata> 

1474 <hybrid-cache-size-total>0</hybrid-cache-size-total> 

1475 <percent-used-capacity>15</percent-used-capacity> 

1476 <size-available>6448431104</size-available> 

1477 <size-total>7549747200</size-total> 

1478 <size-used>1101316096</size-used> 

1479 <total-reserved-space>0</total-reserved-space> 

1480 <used-including-snapshot-reserve>1101316096</used-including-snapshot-reserve> 

1481 <volume-footprints>1100890112</volume-footprints> 

1482 </aggr-space-attributes> 

1483 <aggr-volume-count-attributes> 

1484 <flexvol-count>2</flexvol-count> 

1485 <flexvol-count-collective>0</flexvol-count-collective> 

1486 <flexvol-count-striped>0</flexvol-count-striped> 

1487 </aggr-volume-count-attributes> 

1488 <aggregate-name>%(aggr2)s</aggregate-name> 

1489 <aggregate-uuid>2a741934-1aaf-42dd-93ca-aaf231be108a</aggregate-uuid> 

1490 <nodes> 

1491 <node-name>cluster3-01</node-name> 

1492 </nodes> 

1493 <striping-type>not_striped</striping-type> 

1494 </aggr-attributes> 

1495 </attributes-list> 

1496 <num-records>2</num-records> 

1497 </results> 

1498""" % { 

1499 'aggr1': SHARE_AGGREGATE_NAMES[0], 

1500 'aggr2': SHARE_AGGREGATE_NAMES[1], 

1501}) 

1502 

1503AGGR_GET_ITER_SSC_RESPONSE = etree.XML(""" 

1504 <results status="passed"> 

1505 <attributes-list> 

1506 <aggr-attributes> 

1507 <aggr-64bit-upgrade-attributes> 

1508 <aggr-status-attributes> 

1509 <is-64-bit-upgrade-in-progress>false</is-64-bit-upgrade-in-progress> 

1510 </aggr-status-attributes> 

1511 </aggr-64bit-upgrade-attributes> 

1512 <aggr-fs-attributes> 

1513 <block-type>64_bit</block-type> 

1514 <fsid>1758646411</fsid> 

1515 <type>aggr</type> 

1516 </aggr-fs-attributes> 

1517 <aggr-inode-attributes> 

1518 <files-private-used>512</files-private-used> 

1519 <files-total>30384</files-total> 

1520 <files-used>96</files-used> 

1521 <inodefile-private-capacity>30384</inodefile-private-capacity> 

1522 <inodefile-public-capacity>30384</inodefile-public-capacity> 

1523 <maxfiles-available>30384</maxfiles-available> 

1524 <maxfiles-possible>243191</maxfiles-possible> 

1525 <maxfiles-used>96</maxfiles-used> 

1526 <percent-inode-used-capacity>0</percent-inode-used-capacity> 

1527 </aggr-inode-attributes> 

1528 <aggr-ownership-attributes> 

1529 <home-id>4082368507</home-id> 

1530 <home-name>cluster3-01</home-name> 

1531 <owner-id>4082368507</owner-id> 

1532 <owner-name>cluster3-01</owner-name> 

1533 </aggr-ownership-attributes> 

1534 <aggr-performance-attributes> 

1535 <free-space-realloc>off</free-space-realloc> 

1536 <max-write-alloc-blocks>0</max-write-alloc-blocks> 

1537 </aggr-performance-attributes> 

1538 <aggr-raid-attributes> 

1539 <checksum-status>active</checksum-status> 

1540 <checksum-style>block</checksum-style> 

1541 <disk-count>3</disk-count> 

1542 <ha-policy>cfo</ha-policy> 

1543 <has-local-root>true</has-local-root> 

1544 <has-partner-root>false</has-partner-root> 

1545 <is-checksum-enabled>true</is-checksum-enabled> 

1546 <is-hybrid>false</is-hybrid> 

1547 <is-hybrid-enabled>false</is-hybrid-enabled> 

1548 <is-inconsistent>false</is-inconsistent> 

1549 <mirror-status>unmirrored</mirror-status> 

1550 <mount-state>online</mount-state> 

1551 <plex-count>1</plex-count> 

1552 <plexes> 

1553 <plex-attributes> 

1554 <is-online>true</is-online> 

1555 <is-resyncing>false</is-resyncing> 

1556 <plex-name>/%(aggr1)s/plex0</plex-name> 

1557 <plex-status>normal,active</plex-status> 

1558 <raidgroups> 

1559 <raidgroup-attributes> 

1560 <checksum-style>block</checksum-style> 

1561 <is-cache-tier>false</is-cache-tier> 

1562 <is-recomputing-parity>false</is-recomputing-parity> 

1563 <is-reconstructing>false</is-reconstructing> 

1564 <raidgroup-name>/%(aggr1)s/plex0/rg0</raidgroup-name> 

1565 <recomputing-parity-percentage>0</recomputing-parity-percentage> 

1566 <reconstruction-percentage>0</reconstruction-percentage> 

1567 </raidgroup-attributes> 

1568 </raidgroups> 

1569 <resyncing-percentage>0</resyncing-percentage> 

1570 </plex-attributes> 

1571 </plexes> 

1572 <raid-lost-write-state>on</raid-lost-write-state> 

1573 <raid-size>16</raid-size> 

1574 <raid-status>raid_dp, normal</raid-status> 

1575 <raid-type>raid_dp</raid-type> 

1576 <state>online</state> 

1577 </aggr-raid-attributes> 

1578 <aggr-snaplock-attributes> 

1579 <is-snaplock>true</is-snaplock> 

1580 <snaplock-type>compliance</snaplock-type> 

1581 </aggr-snaplock-attributes> 

1582 <aggr-snapshot-attributes> 

1583 <files-total>0</files-total> 

1584 <files-used>0</files-used> 

1585 <is-snapshot-auto-create-enabled>true</is-snapshot-auto-create-enabled> 

1586 <is-snapshot-auto-delete-enabled>true</is-snapshot-auto-delete-enabled> 

1587 <maxfiles-available>0</maxfiles-available> 

1588 <maxfiles-possible>0</maxfiles-possible> 

1589 <maxfiles-used>0</maxfiles-used> 

1590 <percent-inode-used-capacity>0</percent-inode-used-capacity> 

1591 <percent-used-capacity>0</percent-used-capacity> 

1592 <size-available>0</size-available> 

1593 <size-total>0</size-total> 

1594 <size-used>0</size-used> 

1595 <snapshot-reserve-percent>0</snapshot-reserve-percent> 

1596 </aggr-snapshot-attributes> 

1597 <aggr-space-attributes> 

1598 <aggregate-metadata>245760</aggregate-metadata> 

1599 <hybrid-cache-size-total>0</hybrid-cache-size-total> 

1600 <percent-used-capacity>95</percent-used-capacity> 

1601 <size-available>45670400</size-available> 

1602 <size-total>943718400</size-total> 

1603 <size-used>898048000</size-used> 

1604 <total-reserved-space>0</total-reserved-space> 

1605 <used-including-snapshot-reserve>898048000</used-including-snapshot-reserve> 

1606 <volume-footprints>897802240</volume-footprints> 

1607 </aggr-space-attributes> 

1608 <aggr-volume-count-attributes> 

1609 <flexvol-count>1</flexvol-count> 

1610 <flexvol-count-collective>0</flexvol-count-collective> 

1611 <flexvol-count-striped>0</flexvol-count-striped> 

1612 </aggr-volume-count-attributes> 

1613 <aggregate-name>%(aggr1)s</aggregate-name> 

1614 <aggregate-uuid>15863632-ea49-49a8-9c88-2bd2d57c6d7a</aggregate-uuid> 

1615 <nodes> 

1616 <node-name>cluster3-01</node-name> 

1617 </nodes> 

1618 <striping-type>unknown</striping-type> 

1619 </aggr-attributes> 

1620 </attributes-list> 

1621 <num-records>1</num-records> 

1622 </results> 

1623""" % {'aggr1': SHARE_AGGREGATE_NAMES[0]}) 

1624 

1625AGGR_GET_ITER_ROOT_AGGR_RESPONSE = etree.XML(""" 

1626 <results status="passed"> 

1627 <attributes-list> 

1628 <aggr-attributes> 

1629 <aggr-raid-attributes> 

1630 <has-local-root>true</has-local-root> 

1631 <has-partner-root>false</has-partner-root> 

1632 </aggr-raid-attributes> 

1633 <aggregate-name>%(root1)s</aggregate-name> 

1634 </aggr-attributes> 

1635 <aggr-attributes> 

1636 <aggr-raid-attributes> 

1637 <has-local-root>true</has-local-root> 

1638 <has-partner-root>false</has-partner-root> 

1639 </aggr-raid-attributes> 

1640 <aggregate-name>%(root2)s</aggregate-name> 

1641 </aggr-attributes> 

1642 <aggr-attributes> 

1643 <aggr-raid-attributes> 

1644 <has-local-root>false</has-local-root> 

1645 <has-partner-root>false</has-partner-root> 

1646 </aggr-raid-attributes> 

1647 <aggregate-name>%(aggr1)s</aggregate-name> 

1648 </aggr-attributes> 

1649 <aggr-attributes> 

1650 <aggr-raid-attributes> 

1651 <has-local-root>false</has-local-root> 

1652 <has-partner-root>false</has-partner-root> 

1653 </aggr-raid-attributes> 

1654 <aggregate-name>%(aggr2)s</aggregate-name> 

1655 </aggr-attributes> 

1656 </attributes-list> 

1657 <num-records>6</num-records> 

1658 </results> 

1659""" % { 

1660 'root1': ROOT_AGGREGATE_NAMES[0], 

1661 'root2': ROOT_AGGREGATE_NAMES[1], 

1662 'aggr1': SHARE_AGGREGATE_NAMES[0], 

1663 'aggr2': SHARE_AGGREGATE_NAMES[1], 

1664}) 

1665 

1666AGGR_GET_ITER_NON_ROOT_AGGR_RESPONSE = etree.XML(""" 

1667 <results status="passed"> 

1668 <attributes-list> 

1669 <aggr-attributes> 

1670 <aggr-raid-attributes> 

1671 <has-local-root>false</has-local-root> 

1672 <has-partner-root>false</has-partner-root> 

1673 </aggr-raid-attributes> 

1674 <aggregate-name>%(aggr1)s</aggregate-name> 

1675 </aggr-attributes> 

1676 <aggr-attributes> 

1677 <aggr-raid-attributes> 

1678 <has-local-root>false</has-local-root> 

1679 <has-partner-root>false</has-partner-root> 

1680 </aggr-raid-attributes> 

1681 <aggregate-name>%(aggr2)s</aggregate-name> 

1682 </aggr-attributes> 

1683 </attributes-list> 

1684 <num-records>6</num-records> 

1685 </results> 

1686""" % { 

1687 'aggr1': SHARE_AGGREGATE_NAMES[0], 

1688 'aggr2': SHARE_AGGREGATE_NAMES[1], 

1689}) 

1690 

1691VOLUME_GET_NAME_RESPONSE = etree.XML(""" 

1692 <results status="passed"> 

1693 <attributes-list> 

1694 <volume-attributes> 

1695 <volume-id-attributes> 

1696 <name>%(volume)s</name> 

1697 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

1698 </volume-id-attributes> 

1699 </volume-attributes> 

1700 </attributes-list> 

1701 <num-records>1</num-records> 

1702 </results> 

1703""" % {'volume': SHARE_NAME, 'vserver': VSERVER_NAME}) 

1704 

1705VOLUME_GET_VOLUME_PATH_RESPONSE = etree.XML(""" 

1706 <results status="passed"> 

1707 <junction>/%(volume)s</junction> 

1708 </results> 

1709""" % {'volume': SHARE_NAME}) 

1710 

1711VOLUME_GET_VOLUME_PATH_CIFS_RESPONSE = etree.XML(""" 

1712 <results status="passed"> 

1713 <junction>\\%(volume)s</junction> 

1714 </results> 

1715""" % {'volume': SHARE_NAME}) 

1716 

1717VOLUME_JUNCTION_PATH = '/' + SHARE_NAME 

1718VOLUME_JUNCTION_PATH_CIFS = '\\' + SHARE_NAME 

1719 

1720VOLUME_MODIFY_ITER_RESPONSE = etree.XML(""" 

1721 <results status="passed"> 

1722 <failure-list /> 

1723 <num-failed>0</num-failed> 

1724 <num-succeeded>1</num-succeeded> 

1725 <success-list> 

1726 <volume-modify-iter-info> 

1727 <volume-key> 

1728 <volume-attributes> 

1729 <volume-id-attributes> 

1730 <name>%(volume)s</name> 

1731 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

1732 </volume-id-attributes> 

1733 </volume-attributes> 

1734 </volume-key> 

1735 </volume-modify-iter-info> 

1736 </success-list> 

1737 </results> 

1738""" % {'volume': SHARE_NAME, 'vserver': VSERVER_NAME}) 

1739 

1740VOLUME_MODIFY_ITER_ERROR_RESPONSE = etree.XML(""" 

1741 <results status="passed"> 

1742 <failure-list> 

1743 <volume-modify-iter-info> 

1744 <error-code>160</error-code> 

1745 <error-message>Unable to set volume attribute "size"</error-message> 

1746 <volume-key> 

1747 <volume-attributes> 

1748 <volume-id-attributes> 

1749 <name>%(volume)s</name> 

1750 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

1751 </volume-id-attributes> 

1752 </volume-attributes> 

1753 </volume-key> 

1754 </volume-modify-iter-info> 

1755 </failure-list> 

1756 <num-failed>1</num-failed> 

1757 <num-succeeded>0</num-succeeded> 

1758 </results> 

1759""" % {'volume': SHARE_NAME, 'vserver': VSERVER_NAME}) 

1760 

1761SNAPSHOT_ACCESS_TIME = '1466640058' 

1762SNAPSHOT_GET_ITER_NOT_BUSY_RESPONSE = etree.XML(""" 

1763 <results status="passed"> 

1764 <attributes-list> 

1765 <snapshot-info> 

1766 <access-time>%(access_time)s</access-time> 

1767 <busy>false</busy> 

1768 <name>%(snap)s</name> 

1769 <volume>%(volume)s</volume> 

1770 <vserver>%(vserver)s</vserver> 

1771 </snapshot-info> 

1772 </attributes-list> 

1773 <num-records>1</num-records> 

1774 </results> 

1775""" % { 

1776 'access_time': SNAPSHOT_ACCESS_TIME, 

1777 'snap': SNAPSHOT_NAME, 

1778 'volume': SHARE_NAME, 

1779 'vserver': VSERVER_NAME, 

1780}) 

1781 

1782SNAPSHOT_GET_ITER_BUSY_RESPONSE = etree.XML(""" 

1783 <results status="passed"> 

1784 <attributes-list> 

1785 <snapshot-info> 

1786 <access-time>%(access_time)s</access-time> 

1787 <busy>true</busy> 

1788 <name>%(snap)s</name> 

1789 <volume>%(volume)s</volume> 

1790 <vserver>%(vserver)s</vserver> 

1791 <snapshot-owners-list> 

1792 <snapshot-owner> 

1793 <owner>volume clone</owner> 

1794 </snapshot-owner> 

1795 </snapshot-owners-list> 

1796 </snapshot-info> 

1797 </attributes-list> 

1798 <num-records>1</num-records> 

1799 </results> 

1800""" % { 

1801 'access_time': SNAPSHOT_ACCESS_TIME, 

1802 'snap': SNAPSHOT_NAME, 

1803 'volume': SHARE_NAME, 

1804 'vserver': VSERVER_NAME, 

1805}) 

1806 

1807SNAPSHOT_GET_ITER_NOT_UNIQUE_RESPONSE = etree.XML(""" 

1808 <results status="passed"> 

1809 <attributes-list> 

1810 <snapshot-info> 

1811 <busy>false</busy> 

1812 <name>%(snap)s</name> 

1813 <volume>%(volume)s</volume> 

1814 <vserver>%(vserver)s</vserver> 

1815 </snapshot-info> 

1816 <snapshot-info> 

1817 <busy>false</busy> 

1818 <name>%(snap)s</name> 

1819 <volume>%(root_volume)s</volume> 

1820 <vserver>%(admin_vserver)s</vserver> 

1821 </snapshot-info> 

1822 </attributes-list> 

1823 <num-records>1</num-records> 

1824 </results> 

1825""" % { 

1826 'snap': SNAPSHOT_NAME, 

1827 'volume': SHARE_NAME, 

1828 'vserver': VSERVER_NAME, 

1829 'root_volume': ROOT_VOLUME_NAME, 

1830 'admin_vserver': ADMIN_VSERVER_NAME, 

1831}) 

1832 

1833SNAPSHOT_GET_ITER_UNAVAILABLE_RESPONSE = etree.XML(""" 

1834 <results status="passed"> 

1835 <num-records>0</num-records> 

1836 <volume-errors> 

1837 <volume-error> 

1838 <errno>13023</errno> 

1839 <name>%(volume)s</name> 

1840 <reason>Unable to get information for Snapshot copies of volume \ 

1841"%(volume)s" on Vserver "%(vserver)s". Reason: Volume not online.</reason> 

1842 <vserver>%(vserver)s</vserver> 

1843 </volume-error> 

1844 </volume-errors> 

1845 </results> 

1846""" % {'volume': SHARE_NAME, 'vserver': VSERVER_NAME}) 

1847 

1848SNAPSHOT_GET_ITER_OTHER_ERROR_RESPONSE = etree.XML(""" 

1849 <results status="passed"> 

1850 <num-records>0</num-records> 

1851 <volume-errors> 

1852 <volume-error> 

1853 <errno>99999</errno> 

1854 <name>%(volume)s</name> 

1855 <reason>Unable to get information for Snapshot copies of volume \ 

1856"%(volume)s" on Vserver "%(vserver)s".</reason> 

1857 <vserver>%(vserver)s</vserver> 

1858 </volume-error> 

1859 </volume-errors> 

1860 </results> 

1861""" % {'volume': SHARE_NAME, 'vserver': VSERVER_NAME}) 

1862 

1863SNAPSHOT_MULTIDELETE_ERROR_RESPONSE = etree.XML(""" 

1864 <results status="passed"> 

1865 <volume-errors> 

1866 <volume-error> 

1867 <errno>13021</errno> 

1868 <name>%(volume)s</name> 

1869 <reason>No such snapshot.</reason> 

1870 </volume-error> 

1871 </volume-errors> 

1872 </results> 

1873""" % {'volume': SHARE_NAME}) 

1874 

1875SNAPSHOT_GET_ITER_DELETED_RESPONSE = etree.XML(""" 

1876 <results status="passed"> 

1877 <attributes-list> 

1878 <snapshot-info> 

1879 <name>deleted_manila_%(snap)s</name> 

1880 <volume>%(volume)s</volume> 

1881 <vserver>%(vserver)s</vserver> 

1882 </snapshot-info> 

1883 </attributes-list> 

1884 <num-records>1</num-records> 

1885 </results> 

1886""" % { 

1887 'snap': SNAPSHOT_NAME, 

1888 'volume': SHARE_NAME, 

1889 'vserver': VSERVER_NAME, 

1890}) 

1891 

1892SNAPSHOT_GET_ITER_SNAPMIRROR_RESPONSE = etree.XML(""" 

1893 <results status="passed"> 

1894 <attributes-list> 

1895 <snapshot-info> 

1896 <name>%(snap)s</name> 

1897 <volume>%(volume)s</volume> 

1898 <vserver>%(vserver)s</vserver> 

1899 </snapshot-info> 

1900 </attributes-list> 

1901 <num-records>1</num-records> 

1902 </results> 

1903 

1904""" % { 

1905 'snap': SNAPSHOT_NAME, 

1906 'volume': SHARE_NAME, 

1907 'vserver': VSERVER_NAME, 

1908}) 

1909 

1910CIFS_SHARE_ACCESS_CONTROL_GET_ITER = etree.XML(""" 

1911 <results status="passed"> 

1912 <attributes-list> 

1913 <cifs-share-access-control> 

1914 <permission>full_control</permission> 

1915 <share>%(volume)s</share> 

1916 <user-or-group>Administrator</user-or-group> 

1917 <vserver>manila_svm_cifs</vserver> 

1918 </cifs-share-access-control> 

1919 <cifs-share-access-control> 

1920 <permission>change</permission> 

1921 <share>%(volume)s</share> 

1922 <user-or-group>Administrators</user-or-group> 

1923 <vserver>manila_svm_cifs</vserver> 

1924 </cifs-share-access-control> 

1925 <cifs-share-access-control> 

1926 <permission>read</permission> 

1927 <share>%(volume)s</share> 

1928 <user-or-group>Power Users</user-or-group> 

1929 <vserver>manila_svm_cifs</vserver> 

1930 </cifs-share-access-control> 

1931 <cifs-share-access-control> 

1932 <permission>no_access</permission> 

1933 <share>%(volume)s</share> 

1934 <user-or-group>Users</user-or-group> 

1935 <vserver>manila_svm_cifs</vserver> 

1936 </cifs-share-access-control> 

1937 </attributes-list> 

1938 <num-records>4</num-records> 

1939 </results> 

1940""" % {'volume': SHARE_NAME}) 

1941 

1942CIFS_SHARE_GET_ITER_RESPONSE = etree.XML(""" 

1943 <results status="passed"> 

1944 <attributes-list> 

1945 <cifs-share> 

1946 <share-name>%(share_name)s</share-name> 

1947 <vserver>fake_vserver</vserver> 

1948 </cifs-share> 

1949 </attributes-list> 

1950 <num-records>1</num-records> 

1951 </results> 

1952""" % {'share_name': SHARE_NAME}) 

1953 

1954NFS_EXPORT_RULES = ('10.10.10.10', '10.10.10.20') 

1955 

1956NFS_EXPORTFS_LIST_RULES_2_NO_RULES_RESPONSE = etree.XML(""" 

1957 <results status="passed"> 

1958 <rules /> 

1959 </results> 

1960""") 

1961 

1962NFS_EXPORTFS_LIST_RULES_2_RESPONSE = etree.XML(""" 

1963 <results status="passed"> 

1964 <rules> 

1965 <exports-rule-info-2> 

1966 <pathname>%(path)s</pathname> 

1967 <security-rules> 

1968 <security-rule-info> 

1969 <anon>65534</anon> 

1970 <nosuid>false</nosuid> 

1971 <read-only> 

1972 <exports-hostname-info> 

1973 <name>%(host1)s</name> 

1974 </exports-hostname-info> 

1975 <exports-hostname-info> 

1976 <name>%(host2)s</name> 

1977 </exports-hostname-info> 

1978 </read-only> 

1979 <read-write> 

1980 <exports-hostname-info> 

1981 <name>%(host1)s</name> 

1982 </exports-hostname-info> 

1983 <exports-hostname-info> 

1984 <name>%(host2)s</name> 

1985 </exports-hostname-info> 

1986 </read-write> 

1987 <root> 

1988 <exports-hostname-info> 

1989 <name>%(host1)s</name> 

1990 </exports-hostname-info> 

1991 <exports-hostname-info> 

1992 <name>%(host2)s</name> 

1993 </exports-hostname-info> 

1994 </root> 

1995 <sec-flavor> 

1996 <sec-flavor-info> 

1997 <flavor>sys</flavor> 

1998 </sec-flavor-info> 

1999 </sec-flavor> 

2000 </security-rule-info> 

2001 </security-rules> 

2002 </exports-rule-info-2> 

2003 </rules> 

2004 </results> 

2005""" % { 

2006 'path': VOLUME_JUNCTION_PATH, 

2007 'host1': NFS_EXPORT_RULES[0], 

2008 'host2': NFS_EXPORT_RULES[1], 

2009}) 

2010 

2011AGGR_GET_RAID_TYPE_RESPONSE = etree.XML(""" 

2012 <results status="passed"> 

2013 <attributes-list> 

2014 <aggr-attributes> 

2015 <aggr-raid-attributes> 

2016 <plexes> 

2017 <plex-attributes> 

2018 <plex-name>/%(aggr1)s/plex0</plex-name> 

2019 <raidgroups> 

2020 <raidgroup-attributes> 

2021 <raidgroup-name>/%(aggr1)s/plex0/rg0</raidgroup-name> 

2022 </raidgroup-attributes> 

2023 </raidgroups> 

2024 </plex-attributes> 

2025 </plexes> 

2026 <raid-type>%(raid_type1)s</raid-type> 

2027 </aggr-raid-attributes> 

2028 <aggregate-name>%(aggr1)s</aggregate-name> 

2029 </aggr-attributes> 

2030 <aggr-attributes> 

2031 <aggr-raid-attributes> 

2032 <plexes> 

2033 <plex-attributes> 

2034 <plex-name>/%(aggr2)s/plex0</plex-name> 

2035 <raidgroups> 

2036 <raidgroup-attributes> 

2037 <raidgroup-name>/%(aggr2)s/plex0/rg0</raidgroup-name> 

2038 </raidgroup-attributes> 

2039 <raidgroup-attributes> 

2040 <raidgroup-name>/%(aggr2)s/plex0/rg1</raidgroup-name> 

2041 </raidgroup-attributes> 

2042 </raidgroups> 

2043 </plex-attributes> 

2044 </plexes> 

2045 <raid-type>%(raid_type2)s</raid-type> 

2046 </aggr-raid-attributes> 

2047 <aggregate-name>%(aggr2)s</aggregate-name> 

2048 </aggr-attributes> 

2049 </attributes-list> 

2050 <num-records>2</num-records> 

2051 </results> 

2052""" % { 

2053 'aggr1': SHARE_AGGREGATE_NAMES[0], 

2054 'aggr2': SHARE_AGGREGATE_NAMES[1], 

2055 'raid_type1': SHARE_AGGREGATE_RAID_TYPES[0], 

2056 'raid_type2': SHARE_AGGREGATE_RAID_TYPES[1] 

2057}) 

2058 

2059STORAGE_DISK_GET_ITER_RESPONSE = etree.XML(""" 

2060 <results status="passed"> 

2061 <attributes-list> 

2062 <storage-disk-info> 

2063 <disk-name>cluster3-01:v5.19</disk-name> 

2064 <disk-raid-info> 

2065 <effective-disk-type>%(type0)s</effective-disk-type> 

2066 </disk-raid-info> 

2067 </storage-disk-info> 

2068 <storage-disk-info> 

2069 <disk-name>cluster3-01:v5.20</disk-name> 

2070 <disk-raid-info> 

2071 <effective-disk-type>%(type0)s</effective-disk-type> 

2072 </disk-raid-info> 

2073 </storage-disk-info> 

2074 <storage-disk-info> 

2075 <disk-name>cluster3-01:v5.20</disk-name> 

2076 <disk-raid-info> 

2077 <effective-disk-type>%(type1)s</effective-disk-type> 

2078 </disk-raid-info> 

2079 </storage-disk-info> 

2080 <storage-disk-info> 

2081 <disk-name>cluster3-01:v5.20</disk-name> 

2082 <disk-raid-info> 

2083 <effective-disk-type>%(type1)s</effective-disk-type> 

2084 </disk-raid-info> 

2085 </storage-disk-info> 

2086 </attributes-list> 

2087 <num-records>4</num-records> 

2088 </results> 

2089""" % { 

2090 'type0': SHARE_AGGREGATE_DISK_TYPES[0], 

2091 'type1': SHARE_AGGREGATE_DISK_TYPES[1], 

2092}) 

2093 

2094STORAGE_DISK_GET_ITER_RESPONSE_PAGE_1 = etree.XML(""" 

2095 <results status="passed"> 

2096 <attributes-list> 

2097 <storage-disk-info> 

2098 <disk-name>cluster3-01:v4.16</disk-name> 

2099 </storage-disk-info> 

2100 <storage-disk-info> 

2101 <disk-name>cluster3-01:v4.17</disk-name> 

2102 </storage-disk-info> 

2103 <storage-disk-info> 

2104 <disk-name>cluster3-01:v4.18</disk-name> 

2105 </storage-disk-info> 

2106 <storage-disk-info> 

2107 <disk-name>cluster3-01:v4.19</disk-name> 

2108 </storage-disk-info> 

2109 <storage-disk-info> 

2110 <disk-name>cluster3-01:v4.20</disk-name> 

2111 </storage-disk-info> 

2112 <storage-disk-info> 

2113 <disk-name>cluster3-01:v4.21</disk-name> 

2114 </storage-disk-info> 

2115 <storage-disk-info> 

2116 <disk-name>cluster3-01:v4.22</disk-name> 

2117 </storage-disk-info> 

2118 <storage-disk-info> 

2119 <disk-name>cluster3-01:v4.24</disk-name> 

2120 </storage-disk-info> 

2121 <storage-disk-info> 

2122 <disk-name>cluster3-01:v4.25</disk-name> 

2123 </storage-disk-info> 

2124 <storage-disk-info> 

2125 <disk-name>cluster3-01:v4.26</disk-name> 

2126 </storage-disk-info> 

2127 </attributes-list> 

2128 <next-tag>next_tag_1</next-tag> 

2129 <num-records>10</num-records> 

2130 </results> 

2131""") 

2132 

2133STORAGE_DISK_GET_ITER_RESPONSE_PAGE_2 = etree.XML(""" 

2134 <results status="passed"> 

2135 <attributes-list> 

2136 <storage-disk-info> 

2137 <disk-name>cluster3-01:v4.27</disk-name> 

2138 </storage-disk-info> 

2139 <storage-disk-info> 

2140 <disk-name>cluster3-01:v4.28</disk-name> 

2141 </storage-disk-info> 

2142 <storage-disk-info> 

2143 <disk-name>cluster3-01:v4.29</disk-name> 

2144 </storage-disk-info> 

2145 <storage-disk-info> 

2146 <disk-name>cluster3-01:v4.32</disk-name> 

2147 </storage-disk-info> 

2148 <storage-disk-info> 

2149 <disk-name>cluster3-01:v5.16</disk-name> 

2150 </storage-disk-info> 

2151 <storage-disk-info> 

2152 <disk-name>cluster3-01:v5.17</disk-name> 

2153 </storage-disk-info> 

2154 <storage-disk-info> 

2155 <disk-name>cluster3-01:v5.18</disk-name> 

2156 </storage-disk-info> 

2157 <storage-disk-info> 

2158 <disk-name>cluster3-01:v5.19</disk-name> 

2159 </storage-disk-info> 

2160 <storage-disk-info> 

2161 <disk-name>cluster3-01:v5.20</disk-name> 

2162 </storage-disk-info> 

2163 <storage-disk-info> 

2164 <disk-name>cluster3-01:v5.21</disk-name> 

2165 </storage-disk-info> 

2166 </attributes-list> 

2167 <next-tag>next_tag_2</next-tag> 

2168 <num-records>10</num-records> 

2169 </results> 

2170""") 

2171 

2172STORAGE_DISK_GET_ITER_RESPONSE_PAGE_3 = etree.XML(""" 

2173 <results status="passed"> 

2174 <attributes-list> 

2175 <storage-disk-info> 

2176 <disk-name>cluster3-01:v5.22</disk-name> 

2177 </storage-disk-info> 

2178 <storage-disk-info> 

2179 <disk-name>cluster3-01:v5.24</disk-name> 

2180 </storage-disk-info> 

2181 <storage-disk-info> 

2182 <disk-name>cluster3-01:v5.25</disk-name> 

2183 </storage-disk-info> 

2184 <storage-disk-info> 

2185 <disk-name>cluster3-01:v5.26</disk-name> 

2186 </storage-disk-info> 

2187 <storage-disk-info> 

2188 <disk-name>cluster3-01:v5.27</disk-name> 

2189 </storage-disk-info> 

2190 <storage-disk-info> 

2191 <disk-name>cluster3-01:v5.28</disk-name> 

2192 </storage-disk-info> 

2193 <storage-disk-info> 

2194 <disk-name>cluster3-01:v5.29</disk-name> 

2195 </storage-disk-info> 

2196 <storage-disk-info> 

2197 <disk-name>cluster3-01:v5.32</disk-name> 

2198 </storage-disk-info> 

2199 </attributes-list> 

2200 <num-records>8</num-records> 

2201 </results> 

2202""") 

2203 

2204GET_AGGREGATE_FOR_VOLUME_RESPONSE = etree.XML(""" 

2205 <results status="passed"> 

2206 <attributes-list> 

2207 <volume-attributes> 

2208 <volume-id-attributes> 

2209 <containing-aggregate-name>%(aggr)s</containing-aggregate-name> 

2210 <name>%(share)s</name> 

2211 <owning-vserver-name>os_aa666789-5576-4835-87b7-868069856459</owning-vserver-name> 

2212 </volume-id-attributes> 

2213 </volume-attributes> 

2214 </attributes-list> 

2215 <num-records>1</num-records> 

2216 </results> 

2217""" % { 

2218 'aggr': SHARE_AGGREGATE_NAME, 

2219 'share': SHARE_NAME 

2220}) 

2221 

2222GET_AGGREGATE_FOR_FLEXGROUP_VOL_RESPONSE = etree.XML(""" 

2223 <results status="passed"> 

2224 <attributes-list> 

2225 <volume-attributes> 

2226 <volume-id-attributes> 

2227 <aggr-list> 

2228 <aggr-name>%(aggr)s</aggr-name> 

2229 </aggr-list> 

2230 <name>%(share)s</name> 

2231 <owning-vserver-name>os_aa666789-5576-4835-87b7-868069856459</owning-vserver-name> 

2232 </volume-id-attributes> 

2233 </volume-attributes> 

2234 </attributes-list> 

2235 <num-records>1</num-records> 

2236 </results> 

2237""" % { 

2238 'aggr': SHARE_AGGREGATE_NAME, 

2239 'share': SHARE_NAME 

2240}) 

2241 

2242VOLUME_AUTOSIZE_GET_RESPONSE = etree.XML(""" 

2243 <results status="passed"> 

2244 <grow-threshold-percent>%(grow_percent)s</grow-threshold-percent> 

2245 <is-enabled>false</is-enabled> 

2246 <maximum-size>%(max_size)s</maximum-size> 

2247 <minimum-size>%(min_size)s</minimum-size> 

2248 <mode>%(mode)s</mode> 

2249 <shrink-threshold-percent>%(shrink_percent)s</shrink-threshold-percent> 

2250 </results> 

2251""" % {'grow_percent': VOLUME_AUTOSIZE_ATTRS.get('grow-threshold-percent'), 

2252 'max_size': VOLUME_AUTOSIZE_ATTRS.get('maximum-size'), 

2253 'min_size': VOLUME_AUTOSIZE_ATTRS.get('minimum-size'), 

2254 'mode': VOLUME_AUTOSIZE_ATTRS.get('mode'), 

2255 'shrink_percent': VOLUME_AUTOSIZE_ATTRS.get( 

2256 'shrink-threshold-percent')}) 

2257 

2258GET_VOLUME_FOR_ENCRYPTED_RESPONSE = etree.XML(""" 

2259 <results status="passed"> 

2260 <attributes-list> 

2261 <volume-attributes> 

2262 <encrypt>true</encrypt> 

2263 <volume-id-attributes> 

2264 <name>%(volume)s</name> 

2265 <owning-vserver-name>manila_svm</owning-vserver-name> 

2266 </volume-id-attributes> 

2267 </volume-attributes> 

2268 </attributes-list> 

2269 <num-records>1</num-records> 

2270 </results> 

2271""" % {'volume': SHARE_NAME}) 

2272 

2273GET_VOLUME_FOR_ENCRYPTED_OLD_SYS_VERSION_RESPONSE = etree.XML(""" 

2274 <results status="passed"> 

2275 <attributes-list> 

2276 <volume-attributes> 

2277 <volume-id-attributes> 

2278 <name>%(volume)s</name> 

2279 <owning-vserver-name>manila_svm</owning-vserver-name> 

2280 </volume-id-attributes> 

2281 </volume-attributes> 

2282 </attributes-list> 

2283 <num-records>1</num-records> 

2284 </results> 

2285""" % {'volume': SHARE_NAME}) 

2286 

2287EXPORT_RULE_GET_ITER_RESPONSE = etree.XML(""" 

2288 <results status="passed"> 

2289 <attributes-list> 

2290 <export-rule-info> 

2291 <client-match>%(rule)s</client-match> 

2292 <policy-name>%(policy)s</policy-name> 

2293 <rule-index>3</rule-index> 

2294 <vserver-name>manila_svm</vserver-name> 

2295 </export-rule-info> 

2296 <export-rule-info> 

2297 <client-match>%(rule)s</client-match> 

2298 <policy-name>%(policy)s</policy-name> 

2299 <rule-index>1</rule-index> 

2300 <vserver-name>manila_svm</vserver-name> 

2301 </export-rule-info> 

2302 </attributes-list> 

2303 <num-records>2</num-records> 

2304 </results> 

2305""" % {'policy': EXPORT_POLICY_NAME, 'rule': IP_ADDRESS}) 

2306 

2307VOLUME_GET_EXPORT_POLICY_RESPONSE = etree.XML(""" 

2308 <results status="passed"> 

2309 <attributes-list> 

2310 <volume-attributes> 

2311 <volume-export-attributes> 

2312 <policy>%(policy)s</policy> 

2313 </volume-export-attributes> 

2314 <volume-id-attributes> 

2315 <name>%(volume)s</name> 

2316 <owning-vserver-name>manila_svm</owning-vserver-name> 

2317 </volume-id-attributes> 

2318 </volume-attributes> 

2319 </attributes-list> 

2320 <num-records>1</num-records> 

2321 </results> 

2322""" % {'policy': EXPORT_POLICY_NAME, 'volume': SHARE_NAME}) 

2323 

2324DELETED_EXPORT_POLICY_GET_ITER_RESPONSE = etree.XML(""" 

2325 <results status="passed"> 

2326 <attributes-list> 

2327 <export-policy-info> 

2328 <policy-name>%(policy1)s</policy-name> 

2329 <vserver>%(vserver)s</vserver> 

2330 </export-policy-info> 

2331 <export-policy-info> 

2332 <policy-name>%(policy2)s</policy-name> 

2333 <vserver>%(vserver)s</vserver> 

2334 </export-policy-info> 

2335 <export-policy-info> 

2336 <policy-name>%(policy3)s</policy-name> 

2337 <vserver>%(vserver2)s</vserver> 

2338 </export-policy-info> 

2339 </attributes-list> 

2340 <num-records>2</num-records> 

2341 </results> 

2342""" % { 

2343 'vserver': VSERVER_NAME, 

2344 'vserver2': VSERVER_NAME_2, 

2345 'policy1': DELETED_EXPORT_POLICIES[VSERVER_NAME][0], 

2346 'policy2': DELETED_EXPORT_POLICIES[VSERVER_NAME][1], 

2347 'policy3': DELETED_EXPORT_POLICIES[VSERVER_NAME_2][0], 

2348}) 

2349 

2350LUN_GET_ITER_RESPONSE = etree.XML(""" 

2351 <results status="passed"> 

2352 <attributes-list> 

2353 <lun-info> 

2354 <path>/vol/%(volume)s/fakelun</path> 

2355 <qtree /> 

2356 <volume>%(volume)s</volume> 

2357 <vserver>%(vserver)s</vserver> 

2358 </lun-info> 

2359 </attributes-list> 

2360 <num-records>1</num-records> 

2361 </results> 

2362""" % { 

2363 'vserver': VSERVER_NAME, 

2364 'volume': SHARE_NAME, 

2365}) 

2366 

2367VOLUME_GET_ITER_NOT_UNIQUE_RESPONSE = etree.XML(""" 

2368 <results status="passed"> 

2369 <attributes-list> 

2370 <volume-attributes> 

2371 <volume-id-attributes> 

2372 <name>%(volume1)s</name> 

2373 </volume-id-attributes> 

2374 </volume-attributes> 

2375 <volume-attributes> 

2376 <volume-id-attributes> 

2377 <name>%(volume2)s</name> 

2378 </volume-id-attributes> 

2379 </volume-attributes> 

2380 </attributes-list> 

2381 <num-records>2</num-records> 

2382 </results> 

2383""" % { 

2384 'volume1': SHARE_NAME, 

2385 'volume2': SHARE_NAME_2, 

2386}) 

2387 

2388VOLUME_GET_ITER_SNAPSHOT_ATTRIBUTES_RESPONSE = etree.XML(""" 

2389 <results status="passed"> 

2390 <attributes-list> 

2391 <volume-attributes> 

2392 <volume-snapshot-attributes> 

2393 <snapshot-policy>%(snapshot_policy)s</snapshot-policy> 

2394 <snapdir-access-enabled>%(snapdir_access_enabled)s</snapdir-access-enabled> 

2395 </volume-snapshot-attributes> 

2396 </volume-attributes> 

2397 </attributes-list> 

2398 <num-records>1</num-records> 

2399 </results> 

2400""" % { 

2401 'snapshot_policy': 'daily', 

2402 'snapdir_access_enabled': 'false', 

2403}) 

2404 

2405 

2406VOLUME_GET_ITER_JUNCTIONED_VOLUMES_RESPONSE = etree.XML(""" 

2407 <results status="passed"> 

2408 <attributes-list> 

2409 <volume-attributes> 

2410 <volume-id-attributes> 

2411 <name>fake_volume</name> 

2412 <owning-vserver-name>test</owning-vserver-name> 

2413 </volume-id-attributes> 

2414 </volume-attributes> 

2415 </attributes-list> 

2416 <num-records>1</num-records> 

2417 </results> 

2418""") 

2419 

2420VOLUME_GET_ITER_VOLUME_TO_MANAGE_RESPONSE = etree.XML(""" 

2421 <results status="passed"> 

2422 <attributes-list> 

2423 <volume-attributes> 

2424 <volume-id-attributes> 

2425 <containing-aggregate-name>%(aggr)s</containing-aggregate-name> 

2426 <junction-path>/%(volume)s</junction-path> 

2427 <name>%(volume)s</name> 

2428 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2429 <style>flex</style> 

2430 <type>rw</type> 

2431 <style-extended>%(style-extended)s</style-extended> 

2432 </volume-id-attributes> 

2433 <volume-space-attributes> 

2434 <size>%(size)s</size> 

2435 <size-used>%(size-used)s</size-used> 

2436 </volume-space-attributes> 

2437 <volume-qos-attributes> 

2438 <policy-group-name>%(qos-policy-group-name)s</policy-group-name> 

2439 </volume-qos-attributes> 

2440 <volume-snaplock-attributes> 

2441 <snaplock-type>compliance</snaplock-type> 

2442 </volume-snaplock-attributes> 

2443 </volume-attributes> 

2444 </attributes-list> 

2445 <num-records>1</num-records> 

2446 </results> 

2447""" % { 

2448 'aggr': SHARE_AGGREGATE_NAME, 

2449 'vserver': VSERVER_NAME, 

2450 'volume': SHARE_NAME, 

2451 'size': SHARE_SIZE, 

2452 'size-used': SHARE_USED_SIZE, 

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

2454 'style-extended': FLEXVOL_STYLE_EXTENDED, 

2455}) 

2456 

2457VOLUME_GET_ITER_FLEXGROUP_VOLUME_TO_MANAGE_RESPONSE = etree.XML(""" 

2458 <results status="passed"> 

2459 <attributes-list> 

2460 <volume-attributes> 

2461 <volume-id-attributes> 

2462 <aggr-list> 

2463 <aggr-name>%(aggr)s</aggr-name> 

2464 </aggr-list> 

2465 <junction-path>/%(volume)s</junction-path> 

2466 <name>%(volume)s</name> 

2467 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2468 <style>flex</style> 

2469 <type>rw</type> 

2470 <style-extended>%(style-extended)s</style-extended> 

2471 </volume-id-attributes> 

2472 <volume-space-attributes> 

2473 <size>%(size)s</size> 

2474 <size-used>%(size-used)s</size-used> 

2475 </volume-space-attributes> 

2476 <volume-qos-attributes> 

2477 <policy-group-name>%(qos-policy-group-name)s</policy-group-name> 

2478 </volume-qos-attributes> 

2479 <volume-snaplock-attributes> 

2480 <snaplock-type>compliance</snaplock-type> 

2481 </volume-snaplock-attributes> 

2482 </volume-attributes> 

2483 </attributes-list> 

2484 <num-records>1</num-records> 

2485 </results> 

2486""" % { 

2487 'aggr': SHARE_AGGREGATE_NAME, 

2488 'vserver': VSERVER_NAME, 

2489 'volume': SHARE_NAME, 

2490 'size': SHARE_SIZE, 

2491 'size-used': SHARE_USED_SIZE, 

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

2493 'style-extended': FLEXGROUP_STYLE_EXTENDED, 

2494}) 

2495 

2496VOLUME_GET_ITER_NO_QOS_RESPONSE = etree.XML(""" 

2497 <results status="passed"> 

2498 <attributes-list> 

2499 <volume-attributes> 

2500 <volume-id-attributes> 

2501 <containing-aggregate-name>%(aggr)s</containing-aggregate-name> 

2502 <junction-path>/%(volume)s</junction-path> 

2503 <name>%(volume)s</name> 

2504 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2505 <style>flex</style> 

2506 <type>rw</type> 

2507 <style-extended>%(style-extended)s</style-extended> 

2508 </volume-id-attributes> 

2509 <volume-space-attributes> 

2510 <size>%(size)s</size> 

2511 <size-used>%(size-used)s</size-used> 

2512 </volume-space-attributes> 

2513 <volume-snaplock-attributes> 

2514 <snaplock-type>compliance</snaplock-type> 

2515 </volume-snaplock-attributes> 

2516 </volume-attributes> 

2517 </attributes-list> 

2518 <num-records>1</num-records> 

2519 </results> 

2520""" % { 

2521 'aggr': SHARE_AGGREGATE_NAME, 

2522 'vserver': VSERVER_NAME, 

2523 'volume': SHARE_NAME, 

2524 'size': SHARE_SIZE, 

2525 'size-used': SHARE_USED_SIZE, 

2526 'style-extended': FLEXVOL_STYLE_EXTENDED, 

2527}) 

2528 

2529CLONE_CHILD_1 = 'fake_child_1' 

2530CLONE_CHILD_2 = 'fake_child_2' 

2531VOLUME_GET_ITER_CLONE_CHILDREN_RESPONSE = etree.XML(""" 

2532 <results status="passed"> 

2533 <attributes-list> 

2534 <volume-attributes> 

2535 <volume-id-attributes> 

2536 <name>%(clone1)s</name> 

2537 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2538 </volume-id-attributes> 

2539 </volume-attributes> 

2540 <volume-attributes> 

2541 <volume-id-attributes> 

2542 <name>%(clone2)s</name> 

2543 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2544 </volume-id-attributes> 

2545 </volume-attributes> 

2546 </attributes-list> 

2547 <num-records>2</num-records> 

2548 </results> 

2549""" % { 

2550 'vserver': VSERVER_NAME, 

2551 'clone1': CLONE_CHILD_1, 

2552 'clone2': CLONE_CHILD_2, 

2553}) 

2554 

2555VOLUME_GET_ITER_PARENT_SNAP_EMPTY_RESPONSE = etree.XML(""" 

2556 <results status="passed"> 

2557 <attributes-list> 

2558 <volume-attributes> 

2559 <volume-id-attributes> 

2560 <name>%(name)s</name> 

2561 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2562 </volume-id-attributes> 

2563 </volume-attributes> 

2564 </attributes-list> 

2565 <num-records>1</num-records> 

2566 </results> 

2567""" % { 

2568 'vserver': VSERVER_NAME, 

2569 'name': SHARE_NAME, 

2570}) 

2571 

2572VOLUME_GET_ITER_PARENT_SNAP_RESPONSE = etree.XML(""" 

2573 <results status="passed"> 

2574 <attributes-list> 

2575 <volume-attributes> 

2576 <volume-clone-attributes> 

2577 <volume-clone-parent-attributes> 

2578 <snapshot-name>%(snapshot_name)s</snapshot-name> 

2579 </volume-clone-parent-attributes> 

2580 </volume-clone-attributes> 

2581 <volume-id-attributes> 

2582 <name>%(name)s</name> 

2583 <owning-vserver-name>%(vserver)s</owning-vserver-name> 

2584 </volume-id-attributes> 

2585 </volume-attributes> 

2586 </attributes-list> 

2587 <num-records>1</num-records> 

2588 </results> 

2589""" % { 

2590 'snapshot_name': SNAPSHOT_NAME, 

2591 'vserver': VSERVER_NAME, 

2592 'name': SHARE_NAME, 

2593}) 

2594 

2595SIS_GET_ITER_RESPONSE = etree.XML(""" 

2596 <results status="passed"> 

2597 <attributes-list> 

2598 <sis-status-info> 

2599 <is-compression-enabled>true</is-compression-enabled> 

2600 <path>/vol/%(volume)s</path> 

2601 <state>enabled</state> 

2602 <vserver>%(vserver)s</vserver> 

2603 </sis-status-info> 

2604 </attributes-list> 

2605 </results> 

2606""" % { 

2607 'vserver': VSERVER_NAME, 

2608 'volume': SHARE_NAME, 

2609}) 

2610 

2611CLUSTER_PEER_GET_ITER_RESPONSE = etree.XML(""" 

2612 <results status="passed"> 

2613 <attributes-list> 

2614 <cluster-peer-info> 

2615 <active-addresses> 

2616 <remote-inet-address>%(addr1)s</remote-inet-address> 

2617 <remote-inet-address>%(addr2)s</remote-inet-address> 

2618 </active-addresses> 

2619 <availability>available</availability> 

2620 <cluster-name>%(cluster)s</cluster-name> 

2621 <cluster-uuid>fake_uuid</cluster-uuid> 

2622 <peer-addresses> 

2623 <remote-inet-address>%(addr1)s</remote-inet-address> 

2624 </peer-addresses> 

2625 <remote-cluster-name>%(remote_cluster)s</remote-cluster-name> 

2626 <serial-number>fake_serial_number</serial-number> 

2627 <timeout>60</timeout> 

2628 </cluster-peer-info> 

2629 </attributes-list> 

2630 <num-records>1</num-records> 

2631 </results> 

2632""" % { 

2633 'addr1': CLUSTER_ADDRESS_1, 

2634 'addr2': CLUSTER_ADDRESS_2, 

2635 'cluster': CLUSTER_NAME, 

2636 'remote_cluster': REMOTE_CLUSTER_NAME, 

2637}) 

2638 

2639CLUSTER_PEER_POLICY_GET_RESPONSE = etree.XML(""" 

2640 <results status="passed"> 

2641 <attributes> 

2642 <cluster-peer-policy> 

2643 <is-unauthenticated-access-permitted>false</is-unauthenticated-access-permitted> 

2644 <passphrase-minimum-length>8</passphrase-minimum-length> 

2645 </cluster-peer-policy> 

2646 </attributes> 

2647 </results> 

2648""") 

2649 

2650CLUSTER_GET_CLUSTER_NAME = etree.XML(""" 

2651 <results status="passed"> 

2652 <attributes> 

2653 <cluster-identity-info> 

2654 <cluster-contact /> 

2655 <cluster-location>-</cluster-location> 

2656 <cluster-name>%(cluster_name)s</cluster-name> 

2657 <cluster-serial-number>1-80-000000</cluster-serial-number> 

2658 <cluster-uuid>fake_uuid</cluster-uuid> 

2659 <rdb-uuid>fake_rdb</rdb-uuid> 

2660 </cluster-identity-info> 

2661 </attributes> 

2662 </results> 

2663""" % { 

2664 'cluster_name': CLUSTER_NAME, 

2665}) 

2666 

2667VSERVER_PEER_GET_ITER_RESPONSE = etree.XML(""" 

2668 <results status="passed"> 

2669 <attributes-list> 

2670 <vserver-peer-info> 

2671 <applications> 

2672 <vserver-peer-application>snapmirror</vserver-peer-application> 

2673 </applications> 

2674 <peer-cluster>%(cluster)s</peer-cluster> 

2675 <peer-state>peered</peer-state> 

2676 <peer-vserver>%(vserver2)s</peer-vserver> 

2677 <vserver>%(vserver1)s</vserver> 

2678 </vserver-peer-info> 

2679 </attributes-list> 

2680 <num-records>2</num-records> 

2681 </results> 

2682""" % { 

2683 'cluster': CLUSTER_NAME, 

2684 'vserver1': VSERVER_NAME, 

2685 'vserver2': VSERVER_NAME_2 

2686}) 

2687 

2688SNAPMIRROR_GET_ITER_RESPONSE = etree.XML(""" 

2689 <results status="passed"> 

2690 <attributes-list> 

2691 <snapmirror-info> 

2692 <destination-volume>fake_destination_volume</destination-volume> 

2693 <destination-volume-node>fake_destination_node</destination-volume-node> 

2694 <destination-vserver>fake_destination_vserver</destination-vserver> 

2695 <exported-snapshot>fake_snapshot</exported-snapshot> 

2696 <exported-snapshot-timestamp>1442701782</exported-snapshot-timestamp> 

2697 <is-constituent>false</is-constituent> 

2698 <is-healthy>true</is-healthy> 

2699 <lag-time>2187</lag-time> 

2700 <last-transfer-duration>109</last-transfer-duration> 

2701 <last-transfer-end-timestamp>1442701890</last-transfer-end-timestamp> 

2702 <last-transfer-from>test:manila</last-transfer-from> 

2703 <last-transfer-size>1171456</last-transfer-size> 

2704 <last-transfer-type>initialize</last-transfer-type> 

2705 <max-transfer-rate>0</max-transfer-rate> 

2706 <mirror-state>snapmirrored</mirror-state> 

2707 <newest-snapshot>fake_snapshot</newest-snapshot> 

2708 <newest-snapshot-timestamp>1442701782</newest-snapshot-timestamp> 

2709 <policy>DPDefault</policy> 

2710 <relationship-control-plane>v2</relationship-control-plane> 

2711 <relationship-id>ea8bfcc6-5f1d-11e5-8446-123478563412</relationship-id> 

2712 <relationship-status>idle</relationship-status> 

2713 <relationship-type>data_protection</relationship-type> 

2714 <schedule>daily</schedule> 

2715 <source-volume>fake_source_volume</source-volume> 

2716 <source-vserver>fake_source_vserver</source-vserver> 

2717 <vserver>fake_destination_vserver</vserver> 

2718 </snapmirror-info> 

2719 </attributes-list> 

2720 <num-records>1</num-records> 

2721 </results> 

2722""") 

2723 

2724SNAPMIRROR_GET_ITER_FILTERED_RESPONSE = etree.XML(""" 

2725 <results status="passed"> 

2726 <attributes-list> 

2727 <snapmirror-info> 

2728 <destination-vserver>fake_destination_vserver</destination-vserver> 

2729 <destination-volume>fake_destination_volume</destination-volume> 

2730 <is-healthy>true</is-healthy> 

2731 <mirror-state>snapmirrored</mirror-state> 

2732 <relationship-status>idle</relationship-status> 

2733 <schedule>daily</schedule> 

2734 <source-vserver>fake_source_vserver</source-vserver> 

2735 <source-volume>fake_source_volume</source-volume> 

2736 </snapmirror-info> 

2737 </attributes-list> 

2738 <num-records>1</num-records> 

2739 </results> 

2740""") 

2741 

2742SNAPMIRROR_GET_ITER_FILTERED_RESPONSE_2 = etree.XML(""" 

2743 <results status="passed"> 

2744 <attributes-list> 

2745 <snapmirror-info> 

2746 <source-vserver>fake_source_vserver</source-vserver> 

2747 <destination-vserver>fake_destination_vserver</destination-vserver> 

2748 <mirror-state>snapmirrored</mirror-state> 

2749 <relationship-status>idle</relationship-status> 

2750 </snapmirror-info> 

2751 </attributes-list> 

2752 <num-records>1</num-records> 

2753 </results> 

2754""") 

2755 

2756SNAPMIRROR_GET_DESTINATIONS_ITER_FILTERED_RESPONSE = etree.XML(""" 

2757 <results status="passed"> 

2758 <attributes-list> 

2759 <snapmirror-destination-info> 

2760 <destination-location>fake_destination_vserver:</destination-location> 

2761 <destination-vserver>fake_destination_vserver</destination-vserver> 

2762 <relationship-id>fake_relationship_id</relationship-id> 

2763 <source-location>fake_source_vserver:</source-location> 

2764 <source-vserver>fake_source_vserver</source-vserver> 

2765 </snapmirror-destination-info> 

2766 </attributes-list> 

2767 <num-records>1</num-records> 

2768 </results> 

2769""") 

2770 

2771SNAPMIRROR_INITIALIZE_RESULT = etree.XML(""" 

2772 <results status="passed"> 

2773 <result-status>succeeded</result-status> 

2774 </results> 

2775""") 

2776 

2777VOLUME_MOVE_GET_ITER_RESULT = etree.XML(""" 

2778 <results status="passed"> 

2779 <attributes-list> 

2780 <volume-move-info> 

2781 <cutover-action>retry_on_failure</cutover-action> 

2782 <details>Cutover Completed::Volume move job finishing move</details> 

2783 <estimated-completion-time>1481919246</estimated-completion-time> 

2784 <percent-complete>82</percent-complete> 

2785 <phase>finishing</phase> 

2786 <state>healthy</state> 

2787 <volume>%(volume)s</volume> 

2788 <vserver>%(vserver)s</vserver> 

2789 </volume-move-info> 

2790 </attributes-list> 

2791 <num-records>1</num-records> 

2792 </results> 

2793""" % { 

2794 'volume': SHARE_NAME, 

2795 'vserver': VSERVER_NAME, 

2796}) 

2797 

2798NFS_INFO_STR = """ 

2799 <nfs-info> 

2800 <is-rquota-enabled>false</is-rquota-enabled> 

2801 <is-tcp-enabled>true</is-tcp-enabled> 

2802 <is-v3-hide-snapshot>false</is-v3-hide-snapshot> 

2803 <ntfs-unix-security-ops>use_export_policy</ntfs-unix-security-ops> 

2804 <permitted-enc-types> 

2805 <string>des</string> 

2806 <string>des3</string> 

2807 <string>aes_128</string> 

2808 <string>aes_256</string> 

2809 </permitted-enc-types> 

2810 <tcp-max-xfer-size>65536</tcp-max-xfer-size> 

2811 <udp-max-xfer-size>32768</udp-max-xfer-size> 

2812 <v3-search-unconverted-filename>false</v3-search-unconverted-filename> 

2813 <v4-inherited-acl-preserve>false</v4-inherited-acl-preserve> 

2814 </nfs-info> 

2815""" 

2816 

2817NFS_INFO_DEFAULT_TREE = etree.XML(NFS_INFO_STR) 

2818 

2819NFS_CONFIG_DEFAULT_RESULT = etree.XML(""" 

2820 <results status="passed"> 

2821 <defaults> 

2822 %s 

2823 </defaults> 

2824 </results> 

2825""" % NFS_INFO_STR) 

2826 

2827NFS_CONFIG_SERVER_RESULT = etree.XML(""" 

2828 <results status="passed"> 

2829 <attributes-list> 

2830 %s 

2831 </attributes-list> 

2832 </results> 

2833""" % NFS_INFO_STR) 

2834 

2835PERF_OBJECT_COUNTER_TOTAL_CP_MSECS_LABELS = [ 

2836 'SETUP', 'PRE_P0', 'P0_SNAP_DEL', 'P1_CLEAN', 'P1_QUOTA', 'IPU_DISK_ADD', 

2837 'P2V_INOFILE', 'P2V_INO_PUB', 'P2V_INO_PRI', 'P2V_FSINFO', 'P2V_DLOG1', 

2838 'P2V_DLOG2', 'P2V_REFCOUNT', 'P2V_TOPAA', 'P2V_DF_SCORES_SUB', 'P2V_BM', 

2839 'P2V_SNAP', 'P2V_DF_SCORES', 'P2V_VOLINFO', 'P2V_CONT', 'P2A_INOFILE', 

2840 'P2A_INO', 'P2A_DLOG1', 'P2A_HYA', 'P2A_DLOG2', 'P2A_FSINFO', 

2841 'P2A_IPU_BITMAP_GROW', 'P2A_REFCOUNT', 'P2A_TOPAA', 'P2A_HYABC', 'P2A_BM', 

2842 'P2A_SNAP', 'P2A_VOLINFO', 'P2_FLUSH', 'P2_FINISH', 'P3_WAIT', 

2843 'P3V_VOLINFO', 'P3A_VOLINFO', 'P3_FINISH', 'P4_FINISH', 'P5_FINISH', 

2844] 

2845 

2846PERF_OBJECT_COUNTER_LIST_INFO_WAFL_RESPONSE = etree.XML(""" 

2847 <results status="passed"> 

2848 <counters> 

2849 <counter-info> 

2850 <desc>No. of times 8.3 names are accessed per second.</desc> 

2851 <name>access_8_3_names</name> 

2852 <privilege-level>diag</privilege-level> 

2853 <properties>rate</properties> 

2854 <unit>per_sec</unit> 

2855 </counter-info> 

2856 <counter-info> 

2857 <desc>Array of counts of different types of CPs</desc> 

2858 <labels> 

2859 <label-info>wafl_timer generated CP</label-info> 

2860 <label-info>snapshot generated CP</label-info> 

2861 <label-info>wafl_avail_bufs generated CP</label-info> 

2862 <label-info>dirty_blk_cnt generated CP</label-info> 

2863 <label-info>full NV-log generated CP,back-to-back CP</label-info> 

2864 <label-info>flush generated CP,sync generated CP</label-info> 

2865 <label-info>deferred back-to-back CP</label-info> 

2866 <label-info>low mbufs generated CP</label-info> 

2867 <label-info>low datavecs generated CP</label-info> 

2868 <label-info>nvlog replay takeover time limit CP</label-info> 

2869 </labels> 

2870 <name>cp_count</name> 

2871 <privilege-level>diag</privilege-level> 

2872 <properties>delta</properties> 

2873 <type>array</type> 

2874 <unit>none</unit> 

2875 </counter-info> 

2876 <counter-info> 

2877 <base-counter>total_cp_msecs</base-counter> 

2878 <desc>Array of percentage time spent in different phases of CP</desc> 

2879 <labels> 

2880 <label-info>%(labels)s</label-info> 

2881 </labels> 

2882 <name>cp_phase_times</name> 

2883 <privilege-level>diag</privilege-level> 

2884 <properties>percent</properties> 

2885 <type>array</type> 

2886 <unit>percent</unit> 

2887 </counter-info> 

2888 </counters> 

2889 </results> 

2890""" % {'labels': ','.join(PERF_OBJECT_COUNTER_TOTAL_CP_MSECS_LABELS)}) 

2891 

2892PERF_OBJECT_GET_INSTANCES_SYSTEM_RESPONSE_CMODE = etree.XML(""" 

2893 <results status="passed"> 

2894 <instances> 

2895 <instance-data> 

2896 <counters> 

2897 <counter-data> 

2898 <name>avg_processor_busy</name> 

2899 <value>5674745133134</value> 

2900 </counter-data> 

2901 </counters> 

2902 <name>system</name> 

2903 <uuid>%(node1)s:kernel:system</uuid> 

2904 </instance-data> 

2905 <instance-data> 

2906 <counters> 

2907 <counter-data> 

2908 <name>avg_processor_busy</name> 

2909 <value>4077649009234</value> 

2910 </counter-data> 

2911 </counters> 

2912 <name>system</name> 

2913 <uuid>%(node2)s:kernel:system</uuid> 

2914 </instance-data> 

2915 </instances> 

2916 <timestamp>1453412013</timestamp> 

2917 </results> 

2918""" % {'node1': NODE_NAMES[0], 'node2': NODE_NAMES[1]}) 

2919 

2920PERF_OBJECT_GET_INSTANCES_SYSTEM_RESPONSE_7MODE = etree.XML(""" 

2921 <results status="passed"> 

2922 <timestamp>1454146292</timestamp> 

2923 <instances> 

2924 <instance-data> 

2925 <name>system</name> 

2926 <counters> 

2927 <counter-data> 

2928 <name>avg_processor_busy</name> 

2929 <value>13215732322</value> 

2930 </counter-data> 

2931 </counters> 

2932 </instance-data> 

2933 </instances> 

2934 </results>""") 

2935 

2936PERF_OBJECT_INSTANCE_LIST_INFO_ITER_RESPONSE = etree.XML(""" 

2937 <results status="passed"> 

2938 <attributes-list> 

2939 <instance-info> 

2940 <name>system</name> 

2941 <uuid>%(node)s:kernel:system</uuid> 

2942 </instance-info> 

2943 </attributes-list> 

2944 <num-records>1</num-records> 

2945 </results> 

2946""" % {'node': NODE_NAME}) 

2947 

2948PERF_OBJECT_INSTANCE_LIST_INFO_RESPONSE = etree.XML(""" 

2949 <results status="passed"> 

2950 <instances> 

2951 <instance-info> 

2952 <name>processor0</name> 

2953 </instance-info> 

2954 <instance-info> 

2955 <name>processor1</name> 

2956 </instance-info> 

2957 </instances> 

2958 </results>""") 

2959 

2960NET_ROUTES_CREATE_RESPONSE = etree.XML(""" 

2961 <results status="passed"> 

2962 <result> 

2963 <net-vs-routes-info> 

2964 <address-family>ipv4</address-family> 

2965 <destination>%(subnet)s</destination> 

2966 <gateway>%(gateway)s</gateway> 

2967 <metric>20</metric> 

2968 <vserver>%(vserver)s</vserver> 

2969 </net-vs-routes-info> 

2970 </result> 

2971 </results>""" % { 

2972 'gateway': GATEWAY, 

2973 'vserver': VSERVER_NAME, 

2974 'subnet': SUBNET, 

2975}) 

2976 

2977QOS_POLICY_GROUP_GET_ITER_RESPONSE = etree.XML(""" 

2978 <results status="passed"> 

2979 <attributes-list> 

2980 <qos-policy-group-info> 

2981 <max-throughput>%(max_throughput)s</max-throughput> 

2982 <min-throughput>%(min_throughput)s</min-throughput> 

2983 <num-workloads>1</num-workloads> 

2984 <policy-group>%(qos_policy_group_name)s</policy-group> 

2985 <vserver>%(vserver)s</vserver> 

2986 </qos-policy-group-info> 

2987 </attributes-list> 

2988 <num-records>1</num-records> 

2989 </results>""" % { 

2990 'qos_policy_group_name': QOS_POLICY_GROUP_NAME, 

2991 'vserver': VSERVER_NAME, 

2992 'max_throughput': QOS_MAX_THROUGHPUT, 

2993 'min_throughput': QOS_MIN_THROUGHPUT, 

2994}) 

2995 

2996SNAPMIRROR_POLICY_GET_ITER_RESPONSE = etree.XML(""" 

2997 <results status="passed"> 

2998 <attributes-list> 

2999 <snapmirror-policy-info> 

3000 <policy-name>%(policy_name)s</policy-name> 

3001 <type>%(policy_type)s</type> 

3002 <vserver-name>%(vserver_name)s</vserver-name> 

3003 </snapmirror-policy-info> 

3004 </attributes-list> 

3005 <num-records>1</num-records> 

3006 </results>""" % { 

3007 'policy_name': SNAPMIRROR_POLICY_NAME, 

3008 'policy_type': SNAPMIRROR_POLICY_TYPE, 

3009 'vserver_name': VSERVER_NAME, 

3010}) 

3011 

3012KERBEROS_CONFIG_GET_RESPONSE = etree.XML(""" 

3013 <results status="passed"> 

3014 <attributes> 

3015 <kerberos-config-info> 

3016 <interface-name>%(lif_name)s</interface-name> 

3017 <is-kerberos-enabled>true</is-kerberos-enabled> 

3018 <vserver>%(vserver_name)s</vserver> 

3019 </kerberos-config-info> 

3020 </attributes> 

3021 </results>""" % { 

3022 'lif_name': LIF_NAME, 

3023 'vserver_name': VSERVER_NAME, 

3024}) 

3025 

3026DNS_CONFIG_GET_RESPONSE = etree.XML(""" 

3027 <results status="passed"> 

3028 <attributes> 

3029 <net-dns-info> 

3030 <attempts>1</attempts> 

3031 <dns-state>enabled</dns-state> 

3032 <domains> 

3033 <string>fake_domain.com</string> 

3034 </domains> 

3035 <is-tld-query-enabled>true</is-tld-query-enabled> 

3036 <name-servers> 

3037 <ip-address>fake_dns_1</ip-address> 

3038 <ip-address>fake_dns_2</ip-address> 

3039 </name-servers> 

3040 <require-packet-query-match>true</require-packet-query-match> 

3041 <require-source-address-match>true</require-source-address-match> 

3042 <timeout>2</timeout> 

3043 <vserver-name>%(vserver_name)s</vserver-name> 

3044 </net-dns-info> 

3045 </attributes> 

3046 </results>""" % { 

3047 'vserver_name': VSERVER_NAME, 

3048}) 

3049 

3050FPOLICY_EVENT_GET_ITER_RESPONSE = etree.XML(""" 

3051 <results status="passed"> 

3052 <attributes-list> 

3053 <fpolicy-event-options-config> 

3054 <event-name>%(event_name)s</event-name> 

3055 <file-operations> 

3056 <fpolicy-operation>create</fpolicy-operation> 

3057 <fpolicy-operation>write</fpolicy-operation> 

3058 <fpolicy-operation>rename</fpolicy-operation> 

3059 </file-operations> 

3060 <protocol>%(protocol)s</protocol> 

3061 <volume-operation>false</volume-operation> 

3062 <vserver>%(vserver_name)s</vserver> 

3063 </fpolicy-event-options-config> 

3064 </attributes-list> 

3065 <num-records>1</num-records> 

3066 </results>""" % { 

3067 'event_name': FPOLICY_EVENT_NAME, 

3068 'protocol': FPOLICY_PROTOCOL, 

3069 'vserver_name': VSERVER_NAME, 

3070}) 

3071 

3072FPOLICY_POLICY_GET_ITER_RESPONSE = etree.XML(""" 

3073 <results status="passed"> 

3074 <attributes-list> 

3075 <fpolicy-policy-info> 

3076 <allow-privileged-access>false</allow-privileged-access> 

3077 <engine-name>%(engine)s</engine-name> 

3078 <events> 

3079 <event-name>%(event_name)s</event-name> 

3080 </events> 

3081 <is-mandatory>true</is-mandatory> 

3082 <is-passthrough-read-enabled>false</is-passthrough-read-enabled> 

3083 <policy-name>%(policy_name)s</policy-name> 

3084 <vserver>%(vserver_name)s</vserver> 

3085 </fpolicy-policy-info> 

3086 </attributes-list> 

3087 <num-records>1</num-records> 

3088 </results>""" % { 

3089 'engine': FPOLICY_ENGINE, 

3090 'event_name': FPOLICY_EVENT_NAME, 

3091 'policy_name': FPOLICY_POLICY_NAME, 

3092 'vserver_name': VSERVER_NAME, 

3093}) 

3094 

3095FPOLICY_SCOPE_GET_ITER_RESPONSE = etree.XML(""" 

3096 <results status="passed"> 

3097 <attributes-list> 

3098 <fpolicy-scope-config> 

3099 <check-extensions-on-directories>true</check-extensions-on-directories> 

3100 <file-extensions-to-exclude> 

3101 <string>jpg</string> 

3102 <string>mp3</string> 

3103 </file-extensions-to-exclude> 

3104 <file-extensions-to-include> 

3105 <string>avi</string> 

3106 </file-extensions-to-include> 

3107 <is-monitoring-of-objects-with-no-extension-enabled>false</is-monitoring-of-objects-with-no-extension-enabled> 

3108 <policy-name>%(policy_name)s</policy-name> 

3109 <shares-to-include> 

3110 <string>%(share_name)s</string> 

3111 </shares-to-include> 

3112 <vserver>%(vserver_name)s</vserver> 

3113 </fpolicy-scope-config> 

3114 </attributes-list> 

3115 <num-records>1</num-records> 

3116 </results>""" % { 

3117 'policy_name': FPOLICY_POLICY_NAME, 

3118 'share_name': SHARE_NAME, 

3119 'vserver_name': VSERVER_NAME, 

3120}) 

3121 

3122FPOLICY_POLICY_STATUS_GET_ITER_RESPONSE = etree.XML(""" 

3123 <results status="passed"> 

3124 <attributes-list> 

3125 <fpolicy-policy-status-info> 

3126 <policy-name>%(policy_name)s</policy-name> 

3127 <sequence-number>1</sequence-number> 

3128 <status>true</status> 

3129 <vserver>%(vserver_name)s</vserver> 

3130 </fpolicy-policy-status-info> 

3131 </attributes-list> 

3132 <num-records>1</num-records> 

3133 </results>""" % { 

3134 'policy_name': FPOLICY_POLICY_NAME, 

3135 'vserver_name': VSERVER_NAME, 

3136}) 

3137 

3138FAKE_VOL_XML = """<volume-info> 

3139 <name>open123</name> 

3140 <state>online</state> 

3141 <size-total>0</size-total> 

3142 <size-used>0</size-used> 

3143 <size-available>0</size-available> 

3144 <is-inconsistent>false</is-inconsistent> 

3145 <is-invalid>false</is-invalid> 

3146 </volume-info>""" 

3147 

3148SNAPLOCK_CLOCK_CONFIG_1 = etree.XML(""" 

3149 <results status="passed"> 

3150 <snaplock-node-compliance-clock> 

3151 <compliance-clock-info> 

3152 <formatted-snaplock-compliance-clock>%(clock_info)s</formatted-snaplock-compliance-clock> 

3153 <snaplock-compliance-clock>1723063070</snaplock-compliance-clock> 

3154 </compliance-clock-info> 

3155 </snaplock-node-compliance-clock> 

3156 </results>""" % { 

3157 'clock_info': 'Wed Aug 07 16:37:50' 

3158}) 

3159 

3160 

3161SNAPLOCK_CLOCK_CONFIG_2 = etree.XML(""" 

3162 <results status="passed"> 

3163 <snaplock-node-compliance-clock> 

3164 <compliance-clock-info> 

3165 <formatted-snaplock-compliance-clock>%(clock_info)s</formatted-snaplock-compliance-clock> 

3166 <snaplock-compliance-clock>1723063070</snaplock-compliance-clock> 

3167 </compliance-clock-info> 

3168 </snaplock-node-compliance-clock> 

3169 </results>""" % { 

3170 'clock_info': 'ComplianceClock is not configured' 

3171}) 

3172 

3173FAKE_XML1 = """<options>\ 

3174<test1>abc</test1>\ 

3175<test2>abc</test2>\ 

3176</options>""" 

3177 

3178FAKE_XML2 = """<root><options>somecontent</options></root>""" 

3179 

3180FAKE_NA_ELEMENT = api.NaElement(etree.XML(FAKE_VOL_XML)) 

3181 

3182FAKE_INVOKE_DATA = 'somecontent' 

3183 

3184FAKE_XML_STR = 'abc' 

3185FAKE_REST_CALL_STR = 'def' 

3186 

3187FAKE_API_NAME = 'volume-get-iter' 

3188 

3189FAKE_API_NAME_ELEMENT = api.NaElement(FAKE_API_NAME) 

3190 

3191FAKE_NA_SERVER_STR = '127.0.0.1' 

3192 

3193FAKE_NA_SERVER = api.NaServer(FAKE_NA_SERVER_STR) 

3194 

3195FAKE_NA_SERVER_API_1_5 = api.NaServer(FAKE_NA_SERVER_STR) 

3196FAKE_NA_SERVER_API_1_5.set_vfiler('filer') 

3197FAKE_NA_SERVER_API_1_5.set_api_version(1, 5) 

3198 

3199 

3200FAKE_NA_SERVER_API_1_14 = api.NaServer(FAKE_NA_SERVER_STR) 

3201FAKE_NA_SERVER_API_1_14.set_vserver('server') 

3202FAKE_NA_SERVER_API_1_14.set_api_version(1, 14) 

3203 

3204 

3205FAKE_NA_SERVER_API_1_20 = api.NaServer(FAKE_NA_SERVER_STR) 

3206FAKE_NA_SERVER_API_1_20.set_vfiler('filer') 

3207FAKE_NA_SERVER_API_1_20.set_vserver('server') 

3208FAKE_NA_SERVER_API_1_20.set_api_version(1, 20) 

3209 

3210 

3211FAKE_QUERY = {'volume-attributes': None} 

3212 

3213FAKE_DES_ATTR = {'volume-attributes': ['volume-id-attributes', 

3214 'volume-space-attributes', 

3215 'volume-state-attributes', 

3216 'volume-qos-attributes']} 

3217 

3218FAKE_CALL_ARGS_LIST = [mock.call(80), mock.call(8088), mock.call(443), 

3219 mock.call(8488)] 

3220 

3221FAKE_RESULT_API_ERR_REASON = api.NaElement('result') 

3222FAKE_RESULT_API_ERR_REASON.add_attr('errno', '000') 

3223FAKE_RESULT_API_ERR_REASON.add_attr('reason', 'fake_reason') 

3224 

3225FAKE_RESULT_API_ERRNO_INVALID = api.NaElement('result') 

3226FAKE_RESULT_API_ERRNO_INVALID.add_attr('errno', '000') 

3227 

3228FAKE_RESULT_API_ERRNO_VALID = api.NaElement('result') 

3229FAKE_RESULT_API_ERRNO_VALID.add_attr('errno', '14956') 

3230 

3231FAKE_RESULT_SUCCESS = api.NaElement('result') 

3232FAKE_RESULT_SUCCESS.add_attr('status', 'passed') 

3233 

3234FAKE_HTTP_SESSION = requests.Session() 

3235 

3236FAKE_MANAGE_VOLUME = { 

3237 'aggregate': SHARE_AGGREGATE_NAME, 

3238 'name': SHARE_NAME, 

3239 'owning-vserver-name': VSERVER_NAME, 

3240 'junction_path': VOLUME_JUNCTION_PATH, 

3241 'style': 'fake_style', 

3242 'size': SHARE_SIZE, 

3243} 

3244 

3245FAKE_KEY_MANAGER_ERROR = "The onboard key manager is not enabled. To enable \ 

3246 it, run \"security key-manager setup\"." 

3247 

3248FAKE_ACTION_URL = '/endpoint' 

3249FAKE_BASE_URL = '10.0.0.3/api' 

3250FAKE_HTTP_BODY = {'fake_key': 'fake_value'} 

3251FAKE_HTTP_QUERY = {'type': 'fake_type'} 

3252FAKE_FORMATTED_HTTP_QUERY = "?type=fake_type" 

3253FAKE_HTTP_HEADER = {"fake_header_key": "fake_header_value"} 

3254FAKE_URL_PARAMS = {"fake_url_key": "fake_url_value_to_be_concatenated"} 

3255 

3256FAKE_MIGRATION_RESPONSE_WITH_JOB = { 

3257 "_links": { 

3258 "self": { 

3259 "href": "/api/resourcelink" 

3260 } 

3261 }, 

3262 "job": { 

3263 "start_time": "2021-08-27T19:23:41.691Z", 

3264 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412", 

3265 "description": "Fake Job", 

3266 "state": "success", 

3267 "message": "Complete: Successful", 

3268 "end_time": "2021-08-27T19:23:41.691Z", 

3269 "code": "0" 

3270 } 

3271} 

3272FAKE_JOB_ID = FAKE_MIGRATION_RESPONSE_WITH_JOB['job']['uuid'] 

3273FAKE_MIGRATION_POST_ID = 'fake_migration_id' 

3274FAKE_JOB_SUCCESS_STATE = { 

3275 "_links": { 

3276 "self": { 

3277 "href": "/api/resourcelink" 

3278 } 

3279 }, 

3280 "start_time": "2021-08-27T19:23:41.691Z", 

3281 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412", 

3282 "description": "POST migrations/%s" % FAKE_MIGRATION_POST_ID, 

3283 "state": "success", 

3284 "message": "Complete: Successful", 

3285 "end_time": "2021-08-27T19:23:41.691Z", 

3286 "code": "0" 

3287} 

3288 

3289FAKE_MIGRATION_JOB_SUCCESS = { 

3290 "auto_cutover": True, 

3291 "auto_source_cleanup": True, 

3292 "current_operation": "none", 

3293 "cutover_complete_time": "2020-12-02T18:36:19-08:00", 

3294 "cutover_start_time": "2020-12-02T18:36:19-08:00", 

3295 "cutover_trigger_time": "2020-12-02T18:36:19-08:00", 

3296 "destination": { 

3297 "ipspace": { 

3298 "_links": { 

3299 "self": { 

3300 "href": "/api/resourcelink" 

3301 } 

3302 }, 

3303 "name": "exchange", 

3304 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412" 

3305 }, 

3306 "volume_placement": { 

3307 "aggregates": [ 

3308 { 

3309 "_links": { 

3310 "self": { 

3311 "href": "/api/resourcelink" 

3312 } 

3313 }, 

3314 "name": "aggr1", 

3315 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412" 

3316 } 

3317 ], 

3318 "volumes": [ 

3319 { 

3320 "aggregate": { 

3321 "_links": { 

3322 "self": { 

3323 "href": "/api/resourcelink" 

3324 } 

3325 }, 

3326 "name": "aggr1", 

3327 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412" 

3328 }, 

3329 "volume": { 

3330 "_links": { 

3331 "self": { 

3332 "href": "/api/resourcelink" 

3333 } 

3334 }, 

3335 "name": "this_volume", 

3336 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412" 

3337 } 

3338 } 

3339 ] 

3340 } 

3341 }, 

3342 "end_time": "2020-12-02T18:36:19-08:00", 

3343 "last_failed_state": "precheck_started", 

3344 "last_operation": "none", 

3345 "last_pause_time": "2020-12-02T18:36:19-08:00", 

3346 "last_resume_time": "2020-12-02T18:36:19-08:00", 

3347 "messages": [ 

3348 { 

3349 "code": 852126, 

3350 "message": "SVM migrate cannot start since a volume move is " 

3351 "running.""Retry the command once volume move has " 

3352 "finished." 

3353 } 

3354 ], 

3355 "point_of_no_return": True, 

3356 "restart_count": 0, 

3357 "source": { 

3358 "cluster": { 

3359 "_links": { 

3360 "self": { 

3361 "href": "/api/resourcelink" 

3362 } 

3363 }, 

3364 "name": "cluster1", 

3365 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412" 

3366 }, 

3367 "svm": { 

3368 "_links": { 

3369 "self": { 

3370 "href": "/api/resourcelink" 

3371 } 

3372 }, 

3373 "name": "svm1", 

3374 "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7" 

3375 } 

3376 }, 

3377 "start_time": "2020-12-02T18:36:19-08:00", 

3378 "state": "migrate_complete", 

3379 "uuid": "4ea7a442-86d1-11e0-ae1c-123478563412" 

3380} 

3381 

3382 

3383VOLUME_GET_ITER_STATE_RESPONSE = etree.XML(""" 

3384 <results status="passed"> 

3385 <num-records>1</num-records> 

3386 <attributes-list> 

3387 <volume-attributes> 

3388 <volume-state-attributes> 

3389 <state>online</state> 

3390 </volume-state-attributes> 

3391 </volume-attributes> 

3392 </attributes-list> 

3393 </results> 

3394""") 

3395 

3396ASYNC_OPERATION_RESPONSE = etree.XML(""" 

3397 <results status="passed"> 

3398 <result-status>in_progress</result-status> 

3399 <result-jobid>123</result-jobid> 

3400 </results> 

3401""") 

3402 

3403VOLUME_GET_ITER_STYLE_FLEXGROUP_RESPONSE = etree.XML(""" 

3404 <results status="passed"> 

3405 <num-records>1</num-records> 

3406 <attributes-list> 

3407 <volume-attributes> 

3408 <volume-id-attributes> 

3409 <style-extended>%(style)s</style-extended> 

3410 </volume-id-attributes> 

3411 </volume-attributes> 

3412 </attributes-list> 

3413 </results> 

3414""" % { 

3415 'style': FLEXGROUP_STYLE_EXTENDED, 

3416}) 

3417 

3418VOLUME_GET_ITER_STYLE_FLEXVOL_RESPONSE = etree.XML(""" 

3419 <results status="passed"> 

3420 <num-records>1</num-records> 

3421 <attributes-list> 

3422 <volume-attributes> 

3423 <volume-id-attributes> 

3424 <style-extended>flexvol</style-extended> 

3425 </volume-id-attributes> 

3426 </volume-attributes> 

3427 </attributes-list> 

3428 </results> 

3429""") 

3430 

3431JOB_GET_STATE_RESPONSE = etree.XML(""" 

3432 <results status="passed"> 

3433 <num-records>1</num-records> 

3434 <attributes-list> 

3435 <job-info> 

3436 <job-state>%(state)s</job-state> 

3437 </job-info> 

3438 </attributes-list> 

3439 </results> 

3440""" % { 

3441 'state': JOB_STATE, 

3442}) 

3443 

3444JOB_GET_STATE_NOT_UNIQUE_RESPONSE = etree.XML(""" 

3445 <results status="passed"> 

3446 <num-records>1</num-records> 

3447 <attributes-list> 

3448 <job-info> 

3449 <job-state>%(state)s</job-state> 

3450 </job-info> 

3451 <job-info> 

3452 <job-state>%(state)s</job-state> 

3453 </job-info> 

3454 </attributes-list> 

3455 </results> 

3456""" % { 

3457 'state': JOB_STATE, 

3458}) 

3459 

3460NO_RECORDS_RESPONSE_REST = { 

3461 "records": [], 

3462 "num_records": 0, 

3463 "_links": { 

3464 "self": { 

3465 "href": "/api/cluster/nodes" 

3466 } 

3467 } 

3468} 

3469 

3470ERROR_RESPONSE_REST = { 

3471 "error": { 

3472 "code": 1100, 

3473 "message": "fake error", 

3474 } 

3475} 

3476 

3477GET_VERSION_RESPONSE_REST = { 

3478 "records": [ 

3479 { 

3480 "version": { 

3481 "generation": "9", 

3482 "minor": "11", 

3483 "major": "1", 

3484 "full": "NetApp Release 9.11.1: Sun Nov 05 18:20:57 UTC 2017" 

3485 } 

3486 } 

3487 ], 

3488 "_links": { 

3489 "next": { 

3490 "href": "/api/resourcelink" 

3491 }, 

3492 "self": { 

3493 "href": "/api/resourcelink" 

3494 } 

3495 }, 

3496 "num_records": 0 

3497} 

3498 

3499VOLUME_GET_ITER_RESPONSE_LIST_REST = [ 

3500 { 

3501 "uuid": "2407b637-119c-11ec-a4fb-00a0b89c9a78", 

3502 "name": VOLUME_NAMES[0], 

3503 "state": "online", 

3504 "style": "flexvol", 

3505 "is_svm_root": False, 

3506 "type": "rw", 

3507 "error_state": { 

3508 "is_inconsistent": False 

3509 }, 

3510 "_links": { 

3511 "self": { 

3512 "href": "/api/storage/volumes/2407b637-119c-11ec-a4fb" 

3513 } 

3514 } 

3515 }, 

3516 { 

3517 "uuid": "2c190609-d51c-11eb-b83a", 

3518 "name": VOLUME_NAMES[1], 

3519 "state": "online", 

3520 "style": "flexvol", 

3521 "is_svm_root": False, 

3522 "type": "rw", 

3523 "error_state": { 

3524 "is_inconsistent": False 

3525 }, 

3526 "_links": { 

3527 "self": { 

3528 "href": "/api/storage/volumes/2c190609-d51c-11eb-b83a" 

3529 } 

3530 } 

3531 } 

3532] 

3533 

3534VOLUME_GET_ITER_RESPONSE_REST_PAGE = { 

3535 "records": [ 

3536 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3537 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3538 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3539 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3540 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3541 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3542 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3543 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3544 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3545 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3546 ], 

3547 "num_records": 10, 

3548 "_links": { 

3549 "self": { 

3550 "href": "/api/storage/volumes?fields=name&max_records=2" 

3551 }, 

3552 "next": { 

3553 "href": "/api/storage/volumes?" 

3554 f"start.uuid={VOLUME_GET_ITER_RESPONSE_LIST_REST[0]['uuid']}" 

3555 "&fields=name&max_records=2" 

3556 } 

3557 } 

3558} 

3559 

3560VOLUME_GET_ITER_RESPONSE_REST_LAST_PAGE = { 

3561 "records": [ 

3562 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3563 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3564 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3565 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3566 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3567 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3568 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3569 VOLUME_GET_ITER_RESPONSE_LIST_REST[0], 

3570 ], 

3571 "num_records": 8, 

3572} 

3573 

3574INVALID_GET_ITER_RESPONSE_NO_RECORDS_REST = { 

3575 "num_records": 1, 

3576} 

3577 

3578INVALID_GET_ITER_RESPONSE_NO_NUM_RECORDS_REST = { 

3579 "records": [], 

3580} 

3581 

3582JOB_RESPONSE_REST = { 

3583 "job": { 

3584 "uuid": "uuid-12345", 

3585 "_links": { 

3586 "self": { 

3587 "href": "/api/cluster/jobs/uuid-12345" 

3588 } 

3589 } 

3590 } 

3591} 

3592 

3593JOB_SUCCESSFUL_REST = { 

3594 "uuid": FAKE_UUID, 

3595 "description": "Fake description", 

3596 "state": "success", 

3597 "message": "success", 

3598 "code": 0, 

3599 "start_time": "2022-02-18T20:08:03+00:00", 

3600 "end_time": "2022-02-18T20:08:04+00:00", 

3601} 

3602 

3603JOB_RUNNING_REST = { 

3604 "uuid": FAKE_UUID, 

3605 "description": "Fake description", 

3606 "state": "running", 

3607 "message": "running", 

3608 "code": 0, 

3609} 

3610 

3611JOB_ERROR_REST = { 

3612 "uuid": FAKE_UUID, 

3613 "description": "Fake description", 

3614 "state": "failure", 

3615 "message": "failure", 

3616 "code": 4, 

3617 "error": { 

3618 "target": "uuid", 

3619 "arguments": [ 

3620 { 

3621 "message": "string", 

3622 "code": "string" 

3623 } 

3624 ], 

3625 "message": "entry doesn't exist", 

3626 "code": "4" 

3627 }, 

3628 "start_time": "2022-02-18T20:08:03+00:00", 

3629 "end_time": "2022-02-18T20:08:04+00:00", 

3630} 

3631 

3632FAKE_GET_ONTAP_VERSION_REST = { 

3633 "version": { 

3634 "full": "NetApp Release 9.10.1RC1: Wed Oct 27 02:46:19 UTC 2021", 

3635 "generation": 9, 

3636 "major": 10, 

3637 "minor": 1 

3638 }, 

3639} 

3640 

3641FAKE_GET_CLUSTER_NODE_VERSION_REST = { 

3642 "records": [ 

3643 { 

3644 "uuid": "fake_uuid", 

3645 "name": CLUSTER_NAME, 

3646 "version": FAKE_GET_ONTAP_VERSION_REST["version"], 

3647 } 

3648 ], 

3649} 

3650 

3651FAKE_GET_LICENSES_REST = { 

3652 "records": [ 

3653 { 

3654 "name": "base", 

3655 }, 

3656 { 

3657 "name": "nfs", 

3658 }, 

3659 { 

3660 "name": "cifs", 

3661 } 

3662 ], 

3663 "num_records": 3, 

3664} 

3665 

3666VOLUME_ITEM_SIMPLE_RESPONSE_REST = { 

3667 "uuid": "fake_uuid", 

3668 "name": VOLUME_NAMES[0], 

3669 "style": 'flexvol', 

3670 "svm": { 

3671 "name": VSERVER_NAME, 

3672 "uuid": "fake_uuid", 

3673 }, 

3674 "efficiency": { 

3675 "state": "enabled", 

3676 "compression": "true" 

3677 }, 

3678 "snapshot_directory_access_enabled": "false", 

3679 "snapshot_policy": { 

3680 "name": "daily", 

3681 }, 

3682 "state": "online", 

3683} 

3684 

3685VOLUME_LIST_SIMPLE_RESPONSE_REST = { 

3686 "records": [ 

3687 VOLUME_ITEM_SIMPLE_RESPONSE_REST 

3688 ], 

3689 "num_records": 1, 

3690} 

3691 

3692SVMS_LIST_SIMPLE_RESPONSE_REST = { 

3693 "records": [ 

3694 { 

3695 "uuid": "fake_uuid", 

3696 "name": VSERVER_NAME, 

3697 "subtype": VSERVER_TYPE_DEFAULT, 

3698 "state": VSERVER_STATE, 

3699 }, 

3700 { 

3701 "uuid": "fake_uuid_2", 

3702 "name": VSERVER_NAME_2, 

3703 "subtype": VSERVER_TYPE_DEFAULT, 

3704 "state": VSERVER_STATE, 

3705 }, 

3706 ], 

3707 "num_records": 2, 

3708} 

3709 

3710KEYSTORE_SIMPLE_RESPONSE_REST = { 

3711 "records": [ 

3712 { 

3713 "type": "fake_type_barbican", 

3714 "configuration": 

3715 { 

3716 "name": FAKE_CONFIG_NAME, 

3717 "uuid": FAKE_CONFIG_UUID 

3718 }, 

3719 "uuid": FAKE_CONFIG_UUID 

3720 } 

3721 ], 

3722 "num_records": 1 

3723} 

3724 

3725AGGR_GET_ITER_RESPONSE_REST = { 

3726 "records": [ 

3727 { 

3728 "uuid": "fake_uuid_1", 

3729 "name": "fake_aggr1", 

3730 "home_node": { 

3731 "name": "fake_home_node_name" 

3732 }, 

3733 "snaplock_type": "enterprise", 

3734 "is_snaplock": True, 

3735 "space": { 

3736 "footprint": 702764609536, 

3737 "footprint_percent": 55, 

3738 "block_storage": { 

3739 "size": 1271819509760, 

3740 "available": 568692293632, 

3741 "used": 703127216128, 

3742 }, 

3743 "snapshot": { 

3744 "used_percent": 0, 

3745 "available": 0, 

3746 "total": 0, 

3747 "used": 0, 

3748 "reserve_percent": 0 

3749 }, 

3750 "cloud_storage": { 

3751 "used": 0 

3752 }, 

3753 "efficiency": { 

3754 "savings": 70597836800, 

3755 "ratio": 11.00085294873662, 

3756 "logical_used": 77657018368 

3757 }, 

3758 "efficiency_without_snapshots": { 

3759 "savings": 4288385024, 

3760 "ratio": 1.614324692241794, 

3761 "logical_used": 11269033984 

3762 }, 

3763 "efficiency_without_snapshots_flexclones": { 

3764 "savings": 4288385024, 

3765 "ratio": 1.614324692241794, 

3766 "logical_used": 11269033984 

3767 } 

3768 }, 

3769 "block_storage": { 

3770 "storage_type": "vmdisk", 

3771 "primary": { 

3772 "raid_type": "raid0" 

3773 } 

3774 }, 

3775 }, 

3776 { 

3777 "uuid": "fake_uuid_2", 

3778 "name": "fake_aggr2", 

3779 "home_node": { 

3780 "name": "fake_home_node_name" 

3781 }, 

3782 "space": { 

3783 "footprint": 699261227008, 

3784 "footprint_percent": 49, 

3785 "block_storage": { 

3786 "size": 1426876227584, 

3787 "available": 727211110400, 

3788 "used": 699665117184, 

3789 }, 

3790 "snapshot": { 

3791 "used_percent": 0, 

3792 "available": 0, 

3793 "total": 0, 

3794 "used": 0, 

3795 "reserve_percent": 0 

3796 }, 

3797 "cloud_storage": { 

3798 "used": 0 

3799 }, 

3800 "efficiency": { 

3801 "savings": 4173848576, 

3802 "ratio": 1.447821420943505, 

3803 "logical_used": 13494190080 

3804 }, 

3805 "efficiency_without_snapshots": { 

3806 "savings": 0, 

3807 "ratio": 1, 

3808 "logical_used": 8565026816 

3809 }, 

3810 "efficiency_without_snapshots_flexclones": { 

3811 "savings": 0, 

3812 "ratio": 1, 

3813 "logical_used": 8565026816 

3814 } 

3815 }, 

3816 "block_storage": { 

3817 "storage_type": "vmdisk", 

3818 "primary": { 

3819 "raid_type": "raid0" 

3820 } 

3821 }, 

3822 } 

3823 ], 

3824 "num_records": 2, 

3825} 

3826 

3827EFFECTIVE_TYPE = 'fake_effective_type1' 

3828DISK_LIST_SIMPLE_RESPONSE_REST = { 

3829 "records": [ 

3830 { 

3831 "name": "NET-1.2", 

3832 "effective_type": EFFECTIVE_TYPE, 

3833 } 

3834 ], 

3835 "num_records": 1, 

3836} 

3837 

3838GENERIC_JOB_POST_RESPONSE = { 

3839 "job": { 

3840 "_links": { 

3841 "self": { 

3842 "href": "/api/resourcelink" 

3843 } 

3844 }, 

3845 "uuid": "fake_uuid" 

3846 } 

3847} 

3848 

3849GENERIC_NETWORK_INTERFACES_GET_REPONSE = { 

3850 "records": [ 

3851 { 

3852 "uuid": "fake_uuid", 

3853 "name": LIF_NAME, 

3854 "enabled": "true", 

3855 "ip": { 

3856 "address": IP_ADDRESS, 

3857 "netmask": NETMASK 

3858 }, 

3859 "svm": { 

3860 "name": VSERVER_NAME 

3861 }, 

3862 "services": [ 

3863 "data_nfs", 

3864 "data_cifs", 

3865 ], 

3866 "location": { 

3867 "home_node": { 

3868 "name": CLUSTER_NAME 

3869 }, 

3870 "home_port": { 

3871 "name": PORT 

3872 }, 

3873 } 

3874 } 

3875 ], 

3876 "num_records": 1, 

3877} 

3878 

3879GENERIC_EXPORT_POLICY_RESPONSE_AND_VOLUMES = { 

3880 "records": [ 

3881 { 

3882 "svm": { 

3883 "uuid": "fake_uuid", 

3884 "name": VSERVER_NAME, 

3885 }, 

3886 "efficiency": { 

3887 "volume_path": VOLUME_JUNCTION_PATH 

3888 }, 

3889 "id": "fake-policy-uuid", 

3890 "name": EXPORT_POLICY_NAME, 

3891 "style": "flexvol", 

3892 "type": "rw", 

3893 "aggregates": [ 

3894 { 

3895 "name": SHARE_AGGREGATE_NAME 

3896 } 

3897 ], 

3898 "nas": { 

3899 "path": VOLUME_JUNCTION_PATH 

3900 }, 

3901 "space": { 

3902 "size": 21474836480, 

3903 'used': SHARE_USED_SIZE, 

3904 }, 

3905 "snaplock": { 

3906 "type": "compliance" 

3907 } 

3908 } 

3909 ], 

3910 "num_records": 1, 

3911} 

3912 

3913GENERIC_FPOLICY_RESPONSE = { 

3914 "records": [ 

3915 { 

3916 "name": FPOLICY_POLICY_NAME, 

3917 "enabled": "true", 

3918 "priority": 1, 

3919 "events": [ 

3920 { 

3921 "name": FPOLICY_EVENT_NAME, 

3922 } 

3923 ], 

3924 "engine": { 

3925 "name": FPOLICY_ENGINE, 

3926 }, 

3927 "scope": { 

3928 "include_shares": [ 

3929 VOLUME_NAMES[0] 

3930 ], 

3931 "include_extension": FPOLICY_EXT_TO_INCLUDE_LIST, 

3932 "exclude_extension": FPOLICY_EXT_TO_EXCLUDE_LIST 

3933 }, 

3934 } 

3935 ], 

3936 "num_records": 1, 

3937} 

3938 

3939GENERIC_FPOLICY_EVENTS_RESPONSE = { 

3940 "records": [ 

3941 { 

3942 "name": FPOLICY_EVENT_NAME, 

3943 "protocol": FPOLICY_PROTOCOL, 

3944 "file_operations": { 

3945 "create": 'true', 

3946 "write": 'true', 

3947 "rename": 'true' 

3948 }, 

3949 } 

3950 ], 

3951 "num_records": 1, 

3952} 

3953 

3954EXPORT_POLICY_REST = { 

3955 "records": [ 

3956 { 

3957 "_links": { 

3958 "self": { 

3959 "href": "/api/resourcelink" 

3960 } 

3961 }, 

3962 "name": "string", 

3963 "id": 0, 

3964 "svm": { 

3965 "_links": { 

3966 "self": { 

3967 "href": "/api/resourcelink" 

3968 } 

3969 }, 

3970 "name": "svm1", 

3971 "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7" 

3972 }, 

3973 "rules": [{ 

3974 "rw_rule": [ 

3975 "any" 

3976 ], 

3977 "_links": { 

3978 "self": { 

3979 "href": "/api/resourcelink" 

3980 } 

3981 }, 

3982 "ro_rule": [ 

3983 "any" 

3984 ], 

3985 "allow_suid": True, 

3986 "chown_mode": "restricted", 

3987 "index": 0, 

3988 "superuser": [ 

3989 "any" 

3990 ], 

3991 "protocols": [ 

3992 "any" 

3993 ], 

3994 "anonymous_user": "string", 

3995 "clients": [ 

3996 {"match": "0.0.0.0/0"} 

3997 ], 

3998 "ntfs_unix_security": "fail", 

3999 "allow_device_creation": True 

4000 }] 

4001 }], 

4002 "_links": { 

4003 "next": { 

4004 "href": "/api/resourcelink" 

4005 }, 

4006 "self": { 

4007 "href": "/api/resourcelink" 

4008 } 

4009 }, 

4010 "num_records": 1 

4011} 

4012 

4013QOS_POLICY_GROUP_REST = { 

4014 "records": [ 

4015 { 

4016 "policy_class": "undefined", 

4017 "object_count": '0', 

4018 "fixed": { 

4019 "max_throughput_iops": 0, 

4020 "capacity_shared": True, 

4021 "max_throughput_mbps": 0, 

4022 "min_throughput_iops": 0, 

4023 "min_throughput_mbps": 0 

4024 }, 

4025 "_links": { 

4026 "self": { 

4027 "href": "/api/resourcelink" 

4028 } 

4029 }, 

4030 "name": "extreme", 

4031 "adaptive": { 

4032 "expected_iops_allocation": "allocated_space", 

4033 "expected_iops": 0, 

4034 "peak_iops_allocation": "used_space", 

4035 "block_size": "any", 

4036 "peak_iops": 0, 

4037 "absolute_min_iops": 0 

4038 }, 

4039 "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412", 

4040 "svm": { 

4041 "_links": { 

4042 "self": { 

4043 "href": "/api/resourcelink" 

4044 } 

4045 }, 

4046 "name": "svm1", 

4047 "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7" 

4048 }, 

4049 "pgid": 0, 

4050 "scope": "cluster" 

4051 } 

4052 ], 

4053 "_links": { 

4054 "next": { 

4055 "href": "/api/resourcelink" 

4056 }, 

4057 "self": { 

4058 "href": "/api/resourcelink" 

4059 } 

4060 }, 

4061 "error": { 

4062 "target": "uuid", 

4063 "arguments": [ 

4064 { 

4065 "message": "string", 

4066 "code": "string" 

4067 } 

4068 ], 

4069 "message": "entry doesn't exist", 

4070 "code": "4" 

4071 }, 

4072 "num_records": 1 

4073} 

4074 

4075FAKE_SNAPSHOT_UUID = "fake_uuid" 

4076FAKE_VOLUME_UUID = "fake_volume_uuid" 

4077SNAPSHOT_REST = { 

4078 "name": SNAPSHOT_NAME, 

4079 "uuid": FAKE_SNAPSHOT_UUID, 

4080 "volume": { 

4081 "name": VOLUME_NAMES[0], 

4082 "uuid": FAKE_VOLUME_UUID, 

4083 }, 

4084 "create_time": "2019-02-04T19:00:00Z", 

4085 "owners": ["volume_clone"], 

4086 "svm": { 

4087 "name": VSERVER_NAME, 

4088 } 

4089} 

4090 

4091SNAPSHOTS_REST_RESPONSE = { 

4092 "records": [ 

4093 SNAPSHOT_REST, 

4094 ], 

4095 "num_records": 1, 

4096} 

4097 

4098SNAPSHOTS_MULTIPLE_REST_RESPONSE = { 

4099 "records": [ 

4100 SNAPSHOT_REST, 

4101 SNAPSHOT_REST, 

4102 ], 

4103 "num_records": 2, 

4104} 

4105 

4106SNAPMIRROR_GET_ITER_RESPONSE_REST = { 

4107 "records": [ 

4108 { 

4109 "uuid": FAKE_UUID, 

4110 "source": { 

4111 "path": SM_SOURCE_VSERVER + ':' + SM_SOURCE_VOLUME, 

4112 "svm": { 

4113 "name": SM_SOURCE_VSERVER 

4114 } 

4115 }, 

4116 "destination": { 

4117 "path": SM_DEST_VSERVER + ':' + SM_DEST_VOLUME, 

4118 "svm": { 

4119 "name": SM_DEST_VSERVER 

4120 } 

4121 }, 

4122 "policy": { 

4123 "type": "async" 

4124 }, 

4125 "state": "snapmirrored", 

4126 "healthy": True, 

4127 "transfer_schedule": { 

4128 "name": "hourly", 

4129 }, 

4130 "transfer": { 

4131 "state": "success", 

4132 "bytes_transferred": "3352", 

4133 }, 

4134 "last_transfer_type": "update", 

4135 } 

4136 ], 

4137 "num_records": 1, 

4138} 

4139 

4140REST_GET_SNAPMIRRORS_RESPONSE = [{ 

4141 'destination-volume': SM_DEST_VOLUME, 

4142 'destination-vserver': SM_DEST_VSERVER, 

4143 'last-transfer-end-timestamp': 0, 

4144 'mirror-state': 'snapmirrored', 

4145 'relationship-status': 'idle', 

4146 'source-volume': SM_SOURCE_VOLUME, 

4147 'source-vserver': SM_SOURCE_VSERVER, 

4148 'uuid': FAKE_UUID, 

4149 'policy-type': 'async', 

4150 'schedule': 'hourly', 

4151 'transferring-state': 'success', 

4152 'is-healthy': 'true', 

4153 'last-transfer-size': '3352', 

4154 'last-transfer-type': 'update', 

4155}] 

4156 

4157FAKE_CIFS_RECORDS = { 

4158 "records": [ 

4159 { 

4160 "svm": { 

4161 "uuid": "000c5cd2-ebdf-11e8-a96e-0050568ea3cb", 

4162 "name": "vs1" 

4163 }, 

4164 "user_or_group": "Everyone", 

4165 "permission": "full_control" 

4166 }, 

4167 { 

4168 "svm": { 

4169 "uuid": "000c5cd2-ebdf-11e8-a96e-0050568ea3cb", 

4170 "name": "vs1" 

4171 }, 

4172 "user_or_group": "root", 

4173 "permission": "no_access" 

4174 } 

4175 ], 

4176 "num_records": 2 

4177} 

4178 

4179FAKE_VOL_MOVE_STATUS = { 

4180 "records": [ 

4181 { 

4182 "svm": { 

4183 "_links": { 

4184 "self": { 

4185 "href": "/api/resourcelink" 

4186 } 

4187 }, 

4188 "name": "fake_svm", 

4189 "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7" 

4190 }, 

4191 "uuid": "fake_uuid", 

4192 "name": "fake_name", 

4193 "movement": { 

4194 "state": "success", 

4195 "percent_complete": 100 

4196 }, 

4197 } 

4198 ], 

4199 "num_records": 1, 

4200} 

4201 

4202REST_SIMPLE_RESPONSE = { 

4203 "records": [ 

4204 { 

4205 'uuid': FAKE_UUID 

4206 } 

4207 ] 

4208} 

4209 

4210FAKE_GET_VOLUME_CLONE_REST = [ 

4211 { 

4212 "uuid": FAKE_UUID, 

4213 "name": VOLUME_NAMES[0], 

4214 "clone": { 

4215 "parent_volume": { 

4216 "name": VOLUME_NAMES[1] 

4217 } 

4218 }, 

4219 "num_records": 1, 

4220 } 

4221] 

4222 

4223VSERVER_DATA_LIST_RESPONSE_REST = { 

4224 'records': [ 

4225 { 

4226 'name': VSERVER_NAME 

4227 }, 

4228 { 

4229 'name': VSERVER_NAME_2 

4230 } 

4231 ], 

4232 'num_records': 2, 

4233} 

4234 

4235PERF_COUNTER_LIST_INFO_WAFL_RESPONSE_REST = { 

4236 'name': 'wafl', 

4237 'counter_schemas': [ 

4238 { 

4239 'name': 'cp_phase_times', 

4240 'description': 'Array of percentage time spent in different phases' 

4241 + ' of Consistency Point (CP).', 

4242 'type': 'percent', 

4243 'unit': 'percent', 

4244 'denominator': { 

4245 'name': 'total_cp_msecs' 

4246 } 

4247 } 

4248 ], 

4249} 

4250 

4251PERF_COUNTER_TOTAL_CP_MSECS_LABELS_REST = [ 

4252 'cp_setup', 'cp_pre_p0', 'cp_p0_snap_del', 'cp_p1_clean', 'cp_p1_quota', 

4253 'cp_ipu_disk_add', 'cp_p2v_inofile', 'cp_p2v_ino_pub', 'cp_p2v_ino_pri', 

4254 'cp_p2v_fsinfo', 'cp_p2v_dlog1', 'cp_p2v_dlog2', 'cp_p2v_refcount', 

4255 'cp_p2v_topaa', 'cp_p2v_df_scores_sub', 'cp_p2v_bm', 'cp_p2v_snap', 

4256 'cp_p2v_df_scores', 'cp_p2v_volinfo', 'cp_p2v_cont', 'cp_p2a_inofile', 

4257 'cp_p2a_ino', 'cp_p2a_dlog1', 'cp_p2a_hya', 'cp_p2a_dlog2', 

4258 'cp_p2a_fsinfo', 'cp_p2a_ipu_bitmap_grow', 'cp_p2a_refcount', 

4259 'cp_p2a_topaa', 'cp_p2a_hyabc', 'cp_p2a_bm', 'cp_p2a_snap', 

4260 'cp_p2a_volinfo', 'cp_p2_flush', 'cp_p2_finish', 'cp_p3_wait', 

4261 'cp_p3v_volinfo', 'cp_p3a_volinfo', 'cp_p3_finish', 'cp_p4_finish', 

4262 'cp_p5_finish', 

4263] 

4264 

4265PERF_COUNTER_TOTAL_CP_MSECS_LABELS_RESULT = [ 

4266 label[3:] for label in PERF_COUNTER_TOTAL_CP_MSECS_LABELS_REST 

4267] 

4268 

4269PERF_COUNTER_TOTAL_CP_MSECS_VALUES_REST = [ 

4270 0, 3112, 3, 0, 0, 3, 757, 0, 99, 0, 26, 0, 22, 1, 0, 194, 4, 224, 359, 222, 

4271 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 62, 0, 133, 16, 35, 334219, 43, 

4272 2218, 20, 0, 

4273] 

4274 

4275PERF_COUNTER_TABLE_ROWS_WAFL = { 

4276 'records': [ 

4277 { 

4278 'id': NODE_NAME + ':wafl', 

4279 'counters': [ 

4280 { 

4281 'name': 'cp_phase_times', 

4282 'values': PERF_COUNTER_TOTAL_CP_MSECS_VALUES_REST, 

4283 'labels': PERF_COUNTER_TOTAL_CP_MSECS_LABELS_REST 

4284 } 

4285 ], 

4286 } 

4287 ], 

4288 'num_records': 1, 

4289} 

4290 

4291PERF_COUNTER_DOMAIN_BUSY_LABELS = [ 

4292 'exempt', 'ha', 'host_os', 'idle', 'kahuna', 'kahuna_legacy', 'none', 

4293 'nwk_exempt', 'network', 'protocol', 'raid', 'raid_exempt', 'sm_exempt', 

4294 'ssan_exempt', 'storage', 'target', 'unclassified', 'wafl_exempt', 

4295 'wafl_mpcleaner', 'xor_exempt', 'ssan_exempt2', 'exempt_ise', 'zombie', 

4296] 

4297 

4298PERF_COUNTER_DOMAIN_BUSY_VALUES_1 = [ 

4299 83071627197, 1334877, 19459898, 588539096, 11516887, 14878622, 18, 

4300 647698, 20, 229232646, 4310322, 441035, 12946782, 57837913, 38765442, 

4301 1111004351701, 1497335, 949657, 109890, 768027, 21, 14, 13 

4302] 

4303 

4304PERF_COUNTER_DOMAIN_BUSY_VALUES_2 = [ 

4305 1191129018056, 135991, 22842513, 591213798, 9449562, 15345460, 0, 

4306 751656, 0, 162605694, 3927323, 511160, 7644403, 29696759, 21787992, 

4307 3585552592, 1058902, 957296, 87811, 499766, 0, 0, 0 

4308] 

4309 

4310PERF_COUNTER_ELAPSED_TIME_1 = 1199265469753 

4311PERF_COUNTER_ELAPSED_TIME_2 = 1199265469755 

4312 

4313PERF_GET_INSTANCES_PROCESSOR_RESPONSE_REST = { 

4314 'records': [ 

4315 { 

4316 'counter_table': { 

4317 'name': 'processor' 

4318 }, 

4319 'id': NODE_NAME + ':processor0', 

4320 'counters': [ 

4321 { 

4322 'name': 'domain_busy_percent', 

4323 'values': PERF_COUNTER_DOMAIN_BUSY_VALUES_1, 

4324 'labels': PERF_COUNTER_DOMAIN_BUSY_LABELS 

4325 }, 

4326 { 

4327 'name': 'elapsed_time', 

4328 'value': PERF_COUNTER_ELAPSED_TIME_1, 

4329 } 

4330 ], 

4331 }, 

4332 { 

4333 'counter_table': { 

4334 'name': 'processor' 

4335 }, 

4336 'id': NODE_NAME + ':processor1', 

4337 'counters': [ 

4338 { 

4339 'name': 'domain_busy_percent', 

4340 'values': PERF_COUNTER_DOMAIN_BUSY_VALUES_2, 

4341 'labels': PERF_COUNTER_DOMAIN_BUSY_LABELS 

4342 }, 

4343 { 

4344 'name': 'elapsed_time', 

4345 'value': PERF_COUNTER_ELAPSED_TIME_2, 

4346 } 

4347 ], 

4348 } 

4349 ], 

4350 'num_records': 2, 

4351} 

4352 

4353PERF_COUNTERS_PROCESSOR_EXPECTED = [ 

4354 { 

4355 'instance-name': 'processor', 

4356 'instance-uuid': NODE_NAME + ':processor0', 

4357 'node-name': NODE_NAME, 

4358 'timestamp': mock.ANY, 

4359 'domain_busy': 

4360 ','.join([str(v) for v in PERF_COUNTER_DOMAIN_BUSY_VALUES_1]) 

4361 }, 

4362 { 

4363 'instance-name': 'processor', 

4364 'instance-uuid': NODE_NAME + ':processor0', 

4365 'node-name': NODE_NAME, 

4366 'timestamp': mock.ANY, 

4367 'processor_elapsed_time': PERF_COUNTER_ELAPSED_TIME_1 

4368 }, 

4369 { 

4370 'instance-name': 'processor', 

4371 'instance-uuid': NODE_NAME + ':processor1', 

4372 'node-name': NODE_NAME, 

4373 'timestamp': mock.ANY, 

4374 'domain_busy': 

4375 ','.join([str(v) for v in PERF_COUNTER_DOMAIN_BUSY_VALUES_2]) 

4376 }, 

4377 { 

4378 'instance-name': 'processor', 

4379 'instance-uuid': NODE_NAME + ':processor1', 

4380 'node-name': NODE_NAME, 

4381 'timestamp': mock.ANY, 

4382 'processor_elapsed_time': PERF_COUNTER_ELAPSED_TIME_2 

4383 }, 

4384] 

4385 

4386DELETED_EXPORT_POLICY_GET_ITER_RESPONSE_REST = { 

4387 'records': [ 

4388 { 

4389 'name': DELETED_EXPORT_POLICIES[VSERVER_NAME][0], 

4390 'svm': {'name': VSERVER_NAME}, 

4391 }, 

4392 { 

4393 'name': DELETED_EXPORT_POLICIES[VSERVER_NAME][1], 

4394 'svm': {'name': VSERVER_NAME}, 

4395 }, 

4396 { 

4397 'name': DELETED_EXPORT_POLICIES[VSERVER_NAME_2][0], 

4398 'svm': {'name': VSERVER_NAME_2}, 

4399 } 

4400 ], 

4401 'num_records': 3 

4402} 

4403 

4404SECUTITY_KEY_MANAGER_SUPPORT_RESPONSE_TRUE_REST = { 

4405 'records': [ 

4406 { 

4407 'volume_encryption': { 

4408 'supported': True, 

4409 'message': '', 

4410 'code': 0 

4411 } 

4412 } 

4413 ], 

4414 'num_records': 1 

4415} 

4416 

4417SECUTITY_KEY_MANAGER_SUPPORT_RESPONSE_FALSE_REST = { 

4418 'records': [ 

4419 { 

4420 'volume_encryption': { 

4421 'supported': False, 

4422 'message': 'No platform support for volume encryption ' 

4423 'in following nodes - node1, node2.', 

4424 'code': 346758 

4425 } 

4426 } 

4427 ], 

4428 'num_records': 1 

4429} 

4430 

4431NFS_CONFIG_DEFAULT_RESULT_REST = { 

4432 'records': [ 

4433 { 

4434 'svm': { 

4435 'uuid': FAKE_UUID, 

4436 'name': VSERVER_NAME, 

4437 }, 

4438 'transport': { 

4439 'udp_enabled': True, 

4440 'tcp_enabled': True, 

4441 'tcp_max_transfer_size': 65536 

4442 }, 

4443 } 

4444 ], 

4445 'num_records': 1, 

4446} 

4447 

4448DNS_REST_RESPONSE = { 

4449 "domains": [ 

4450 "example.com", 

4451 "example2.example3.com" 

4452 ], 

4453 "dynamic_dns": { 

4454 "fqdn": "example.com", 

4455 "time_to_live": "P2D", 

4456 "use_secure": "true", 

4457 "enabled": "true" 

4458 }, 

4459 "servers": [ 

4460 "10.224.65.20", 

4461 "2001:db08:a0b:12f0::1" 

4462 ], 

4463} 

4464 

4465SVM_ITEM_SIMPLE_RESPONSE_REST = { 

4466 "uuid": "fake_uuid", 

4467 "name": VSERVER_NAME, 

4468} 

4469 

4470LOCAL_USERS_CIFS_RESPONSE = { 

4471 "sid": "fake_SID", 

4472 "svm": { 

4473 "name": "svm1", 

4474 "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7" 

4475 } 

4476} 

4477 

4478PREFERRED_DC_REST = { 

4479 "fqdn": "test.com", 

4480 "server_ip": "4.4.4.4" 

4481} 

4482 

4483FAKE_VSERVER_PEERS = [{ 

4484 'uuid': 'fake_uuid' 

4485 }] 

4486 

4487 

4488FAKE_PEER_GET_RESPONSE = { 

4489 'records': [ 

4490 { 

4491 'uuid': FAKE_UUID, 

4492 'svm': { 

4493 'name': VSERVER_NAME, 

4494 }, 

4495 'peer': { 

4496 'svm': { 

4497 'name': VSERVER_NAME_2 

4498 }, 

4499 'cluster': { 

4500 'name': CLUSTER_NAME 

4501 } 

4502 }, 

4503 'state': VSERVER_PEER_STATE, 

4504 } 

4505 ], 

4506 'num_records': 1 

4507} 

4508 

4509REST_SPEED_SORTED_PORTS = [ 

4510 {'node': NODE_NAME, 'port': 'e0d', 'speed': 10000}, 

4511 {'node': NODE_NAME, 'port': 'e0c', 'speed': 1000}, 

4512 {'node': NODE_NAME, 'port': 'e0b', 'speed': 100}, 

4513] 

4514 

4515REST_SPEED_NOT_SORTED_PORTS = [ 

4516 {'node': NODE_NAME, 'port': 'e0b', 'speed': 100}, 

4517 {'node': NODE_NAME, 'port': 'e0c', 'speed': 1000}, 

4518 {'node': NODE_NAME, 'port': 'e0d', 'speed': 10000}, 

4519] 

4520 

4521REST_ETHERNET_PORTS = { 

4522 "records": [ 

4523 { 

4524 "uuid": "fake_uuid1", 

4525 "name": "e0a", 

4526 "type": "physical", 

4527 "node": { 

4528 "name": NODE_NAME 

4529 }, 

4530 "broadcast_domain": { 

4531 "name": "fake_domain_1", 

4532 "ipspace": { 

4533 "name": "Default" 

4534 } 

4535 }, 

4536 "state": "up", 

4537 "speed": 10, 

4538 }, 

4539 { 

4540 "uuid": "fake_uuid2", 

4541 "name": "e0b", 

4542 "type": "physical", 

4543 "node": { 

4544 "name": NODE_NAME 

4545 }, 

4546 "broadcast_domain": { 

4547 "name": "fake_domain_2", 

4548 "ipspace": { 

4549 "name": "Default" 

4550 } 

4551 }, 

4552 "state": "up", 

4553 "speed": 100, 

4554 }, 

4555 { 

4556 "uuid": "fake_uuid3", 

4557 "name": "e0c", 

4558 "type": "physical", 

4559 "node": { 

4560 "name": NODE_NAME 

4561 }, 

4562 "broadcast_domain": { 

4563 "name": "fake_domain_3", 

4564 "ipspace": { 

4565 "name": "Default" 

4566 } 

4567 }, 

4568 "state": "up", 

4569 "speed": 1000, 

4570 }, 

4571 { 

4572 "uuid": "fake_uuid4", 

4573 "name": "e0d", 

4574 "type": "physical", 

4575 "node": { 

4576 "name": NODE_NAME 

4577 }, 

4578 "broadcast_domain": { 

4579 "name": "fake_domain_4", 

4580 "ipspace": { 

4581 "name": "Default" 

4582 } 

4583 }, 

4584 "state": "up", 

4585 "speed": 10000, 

4586 } 

4587 ], 

4588} 

4589 

4590SVM_ITEM_SIMPLE_RESPONSE_REST = { 

4591 "uuid": "fake_uuid", 

4592 "name": VSERVER_NAME, 

4593} 

4594 

4595FAKE_GET_BROADCAST_DOMAIN = { 

4596 'records': [ 

4597 { 

4598 'ports': [ 

4599 { 

4600 'name': PORT, 

4601 'node': {'name': NODE_NAME} 

4602 } 

4603 ], 

4604 'name': BROADCAST_DOMAIN, 

4605 'ipspace': {'name': IPSPACE_NAME} 

4606 } 

4607 ] 

4608} 

4609 

4610NFS_CONFIG_RESULT_REST = { 

4611 'records': [ 

4612 { 

4613 'svm': { 

4614 'uuid': FAKE_UUID, 

4615 'name': VSERVER_NAME, 

4616 }, 

4617 'transport': { 

4618 'udp_enabled': True, 

4619 'tcp_enabled': True, 

4620 'tcp_max_transfer_size': 65536 

4621 }, 

4622 } 

4623 ], 

4624 'num_records': 1, 

4625} 

4626 

4627SERVICE_POLICIES_REST = { 

4628 'records': [ 

4629 { 

4630 'uuid': 'fake_policy_uuid', 

4631 'name': 'default-data-files', 

4632 'svm': { 

4633 'name': VSERVER_NAME 

4634 }, 

4635 'services': [ 

4636 'data_core', 

4637 'data_flexcache', 

4638 'data_fpolicy_client', 

4639 'management_dns_client', 

4640 'management_ad_client', 

4641 'management_ldap_client', 

4642 'management_nis_client', 

4643 'data_dns_server' 

4644 ], 

4645 }, 

4646 ], 

4647 'num_records': 1, 

4648} 

4649 

4650SECURITY_CERT_GET_RESPONSE_REST = { 

4651 'records': [ 

4652 { 

4653 'uuid': 'fake_cert_uuid', 

4654 'serial_number': 'fake_serial_number', 

4655 'key_size': 0, 

4656 'hash_function': "sha256", 

4657 'common_name': "fake_common_name", 

4658 'name': "cert1", 

4659 'ca': 'fake_ca', 

4660 'expiry_time': 'fake_expiry_time', 

4661 'svm': { 

4662 'name': VSERVER_NAME, 

4663 'uuid': 'fake_uuid', 

4664 }, 

4665 }, 

4666 ], 

4667 'num_records': 1, 

4668} 

4669 

4670SECURITY_CERT_POST_RESPONSE_REST = { 

4671 'records': [ 

4672 { 

4673 'uuid': 'fake_cert_uuid', 

4674 'serial_number': 'fake_serial_number', 

4675 'key_size': 0, 

4676 'hash_function': "sha256", 

4677 'common_name': "fake_common_name", 

4678 'name': "cert1", 

4679 'ca': 'fake_ca', 

4680 'expiry_time': 'fake_expiry_time', 

4681 'svm': { 

4682 'name': VSERVER_NAME, 

4683 'uuid': 'fake_uuid', 

4684 }, 

4685 }, 

4686 ], 

4687 'num_records': 1, 

4688} 

4689 

4690GET_SNAPMIRROR_POLICIES_REST = { 

4691 

4692 "records": [ 

4693 { 

4694 "uuid": FAKE_UUID, 

4695 "name": SNAPMIRROR_POLICY_NAME 

4696 }], 

4697 'num_records': 1, 

4698} 

4699 

4700REST_VSERVER_GET_IPSPACE_NAME_RESPONSE = { 

4701 "records": [ 

4702 { 

4703 "uuid": FAKE_UUID, 

4704 "ipspace": {'name': IPSPACE_NAME} 

4705 } 

4706 ], 

4707 'num_records': 1, 

4708} 

4709 

4710BROADCAST_DOMAIN_LIST_SIMPLE_RESPONSE_REST = { 

4711 "records": [ 

4712 { 

4713 "ports": [ 

4714 { 

4715 "_links": { 

4716 "self": { 

4717 "href": FAKE_BASE_URL 

4718 } 

4719 }, 

4720 "name": "fake_port_name", 

4721 "uuid": FAKE_UUID, 

4722 "node": { 

4723 "name": "fake_node_name" 

4724 } 

4725 } 

4726 ], 

4727 "_links": { 

4728 "self": { 

4729 "href": FAKE_BASE_URL 

4730 } 

4731 }, 

4732 "name": "fake_broadcast_name", 

4733 "ipspace": { 

4734 "_links": { 

4735 "self": { 

4736 "href": FAKE_BASE_URL 

4737 } 

4738 }, 

4739 "name": IPSPACE_NAME, 

4740 "uuid": FAKE_UUID 

4741 }, 

4742 "uuid": FAKE_UUID, 

4743 "mtu": MTU 

4744 } 

4745 ], 

4746 "_links": { 

4747 "next": { 

4748 "href": FAKE_BASE_URL 

4749 }, 

4750 "self": { 

4751 "href": FAKE_BASE_URL 

4752 } 

4753 }, 

4754 "num_records": 1 

4755} 

4756 

4757GET_IPSPACES_RESPONSE = { 

4758 'ipspace': IPSPACE_NAME, 

4759 'uuid': FAKE_UUID, 

4760 'broadcast-domains': [BROADCAST_DOMAIN], 

4761 'ports': [PORT], 

4762 'vservers': [VSERVER_NAME, VSERVER_NAME_2] 

4763} 

4764 

4765IPSPACE_INFO = { 

4766 'records': [ 

4767 { 

4768 'name': IPSPACE_NAME, 

4769 'uuid': FAKE_UUID 

4770 } 

4771 ] 

4772} 

4773 

4774REST_SINGLE_PORT = { 

4775 "records": [ 

4776 { 

4777 "uuid": "fake_uuid1", 

4778 "name": "e0a", 

4779 "type": "physical", 

4780 "node": { 

4781 "name": NODE_NAME 

4782 }, 

4783 "broadcast_domain": { 

4784 "name": "fake_domain_1", 

4785 "ipspace": { 

4786 "name": "Default" 

4787 } 

4788 }, 

4789 "state": "up", 

4790 "speed": 10, 

4791 } 

4792 ] 

4793} 

4794 

4795VOLUME = { 

4796 "name": "fake_volume_name", 

4797 "uuid": "028baa66-41bd-11e9-81d5-00a0986138f7", 

4798 "max_dir_size": 0, 

4799} 

4800 

4801SECUTITY_KEY_MANAGER_SUPPORT_RESPONSE_TRUE_REST = { 

4802 'records': [ 

4803 { 

4804 'volume_encryption': { 

4805 'supported': True, 

4806 'message': '', 

4807 'code': 0 

4808 } 

4809 } 

4810 ], 

4811 'num_records': 1 

4812} 

4813 

4814SECUTITY_KEY_MANAGER_SUPPORT_RESPONSE_FALSE_REST = { 

4815 'records': [ 

4816 { 

4817 'volume_encryption': { 

4818 'supported': False, 

4819 'message': 'No platform support for volume encryption ' 

4820 'in following nodes - node1, node2.', 

4821 'code': 346758 

4822 } 

4823 } 

4824 ], 

4825 'num_records': 1 

4826} 

4827 

4828FAKE_DISK_TYPE_RESPONSE = { 

4829 "records": [ 

4830 { 

4831 "effective_type": "fakedisk" 

4832 } 

4833 ] 

4834} 

4835 

4836FAKE_SVM_AGGREGATES = { 

4837 "records": [ 

4838 { 

4839 "name": VSERVER_NAME, 

4840 "aggregates": [ 

4841 { 

4842 "name": SHARE_AGGREGATE_NAMES_LIST[0], 

4843 "available_size": 568692293632 

4844 }, 

4845 { 

4846 "name": SHARE_AGGREGATE_NAMES_LIST[1], 

4847 "available_size": 727211110400 

4848 }, 

4849 ] 

4850 } 

4851 ] 

4852} 

4853 

4854FAKE_AGGREGATES_RESPONSE = { 

4855 "records": [ 

4856 { 

4857 "aggregates": [ 

4858 { 

4859 "name": SHARE_AGGREGATE_NAME 

4860 } 

4861 ], 

4862 "name": VSERVER_NAME, 

4863 } 

4864 ] 

4865} 

4866 

4867FAKE_SVM_AGGR_EMPTY = { 

4868 "records": [ 

4869 { 

4870 "name": VSERVER_NAME, 

4871 "aggregates": [] 

4872 } 

4873 ] 

4874} 

4875 

4876FAKE_AGGR_LIST = { 

4877 "records": [ 

4878 { 

4879 "name": SHARE_AGGREGATE_NAMES_LIST[0] 

4880 } 

4881 ] 

4882} 

4883 

4884REST_DATA_INTERFACES = { 

4885 "records": [ 

4886 { 

4887 "uuid": "fake-uuid-1", 

4888 "name": "data-1", 

4889 "location": { 

4890 "port": { 

4891 "name": "e0b" 

4892 } 

4893 }, 

4894 "service_policy": { 

4895 "name": "default-management" 

4896 }, 

4897 }, 

4898 { 

4899 "uuid": "fake-uuid-2", 

4900 "name": "data-2", 

4901 "location": { 

4902 "port": { 

4903 "name": "e0c" 

4904 } 

4905 }, 

4906 "service_policy": { 

4907 "name": "default-management" 

4908 }, 

4909 }, 

4910 { 

4911 "uuid": "fake-uuid-3", 

4912 "name": "data-3", 

4913 "location": { 

4914 "port": { 

4915 "name": "e0d" 

4916 } 

4917 }, 

4918 "service_policy": { 

4919 "name": "default-management" 

4920 }, 

4921 } 

4922 ], 

4923 "num_records": 3, 

4924} 

4925 

4926FAKE_CIFS_LOCAL_USER = { 

4927 'records': [ 

4928 { 

4929 'sid': 'S-1-5-21-256008430-3394229847-3930036330-1001' 

4930 } 

4931 ] 

4932} 

4933 

4934FAKE_SERVER_SWITCH_NAME = 'fake_ss_name' 

4935FAKE_SUBTYPE = 'fake_subtype' 

4936FAKE_DNS_CONFIG = { 

4937 'dns-state': 'true', 

4938 'domains': ['fake_domain'], 

4939 'dns-ips': ['fake_ip'] 

4940} 

4941 

4942FAKE_VOLUME_MANAGE = { 

4943 'records': [ 

4944 { 

4945 'name': VOLUME_NAMES[0], 

4946 'aggregates': [ 

4947 { 

4948 'name': SHARE_AGGREGATE_NAME 

4949 } 

4950 ], 

4951 'nas': { 

4952 'path': VOLUME_JUNCTION_PATH 

4953 }, 

4954 'style': 'flex', 

4955 'type': 'fake_type', 

4956 'svm': { 

4957 'name': VSERVER_NAME 

4958 }, 

4959 'qos': { 

4960 'policy': { 

4961 'name': QOS_POLICY_GROUP_NAME 

4962 } 

4963 }, 

4964 'space': { 

4965 'size': SHARE_SIZE, 

4966 'used': SHARE_USED_SIZE, 

4967 }, 

4968 'snaplock': { 

4969 'type': "compliance" 

4970 } 

4971 } 

4972 ], 

4973 'num_records': 1 

4974} 

4975 

4976FAKE_PORTS = [ 

4977 {'speed': ''}, 

4978 {'speed': '4'}, 

4979 {'speed': 'auto'}, 

4980 {'speed': 'undef'}, 

4981 {'speed': 'fake_speed'} 

4982 ] 

4983 

4984FAKE_ROOT_AGGREGATES_RESPONSE = { 

4985 "records": [ 

4986 { 

4987 "aggregate": SHARE_AGGREGATE_NAME 

4988 } 

4989 ] 

4990} 

4991 

4992FAKE_GET_VOLUME = { 

4993 "records": [ 

4994 { 

4995 "uuid": FAKE_UUID, 

4996 "name": "share_6cb5b3f4_35d0_40b8_a106_d35262ac17c7", 

4997 "size": 1024**3, 

4998 } 

4999 ], 

5000} 

5001 

5002STORAGE_FAIL_OVER_PARTNER = etree.XML(""" 

5003 <results status="passed"> 

5004 <partner>fake_partner_node</partner> 

5005 </results>""") 

5006 

5007 

5008DATA_LIF_CAPACITY_DETAILS = etree.XML(""" 

5009 <results status='passed'> 

5010 <attributes-list> 

5011 <data-lif-capacity-details-info> 

5012 <capacity-for-node>512</capacity-for-node> 

5013 <count-for-node>44</count-for-node> 

5014 <limit-for-node>512</limit-for-node> 

5015 <node>fake_node</node> 

5016 </data-lif-capacity-details-info> 

5017 </attributes-list> 

5018 <num-records>1</num-records> 

5019 </results>""")