"Fossies" - the Fresh Open Source Software Archive

Member "manila-8.1.3/manila/tests/share/drivers/netapp/dataontap/fakes.py" (20 Jul 2020, 43937 Bytes) of package /linux/misc/openstack/manila-8.1.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "fakes.py": 8.1.2_vs_8.1.3.

    1 # Copyright (c) 2015 Clinton Knight  All rights reserved.
    2 # Copyright (c) 2015 Tom Barron  All rights reserved.
    3 #
    4 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    5 #    not use this file except in compliance with the License. You may obtain
    6 #    a copy of the License at
    7 #
    8 #         http://www.apache.org/licenses/LICENSE-2.0
    9 #
   10 #    Unless required by applicable law or agreed to in writing, software
   11 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   12 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   13 #    License for the specific language governing permissions and limitations
   14 #    under the License.
   15 
   16 import copy
   17 
   18 from manila.common import constants
   19 import manila.tests.share.drivers.netapp.fakes as na_fakes
   20 
   21 NO_SNAPRESTORE_LICENSE = '"SnapRestore" is not licensed in the cluster.'
   22 BACKEND_NAME = 'fake_backend_name'
   23 DRIVER_NAME = 'fake_driver_name'
   24 APP_VERSION = 'fake_app_vsersion'
   25 HOST_NAME = 'fake_host'
   26 POOL_NAME = 'fake_pool'
   27 VSERVER1 = 'fake_vserver_1'
   28 VSERVER2 = 'fake_vserver_2'
   29 LICENSES = ('base', 'cifs', 'fcp', 'flexclone', 'iscsi', 'nfs', 'snapmirror',
   30             'snaprestore', 'snapvault')
   31 VOLUME_NAME_TEMPLATE = 'share_%(share_id)s'
   32 VSERVER_NAME_TEMPLATE = 'os_%s'
   33 AGGREGATE_NAME_SEARCH_PATTERN = '(.*)'
   34 SHARE_NAME = 'share_7cf7c200_d3af_4e05_b87e_9167c95dfcad'
   35 SHARE_INSTANCE_NAME = 'share_d24e7257_124e_4fb6_b05b_d384f660bc85'
   36 FLEXVOL_NAME = 'fake_volume'
   37 JUNCTION_PATH = '/%s' % FLEXVOL_NAME
   38 EXPORT_LOCATION = '%s:%s' % (HOST_NAME, JUNCTION_PATH)
   39 SNAPSHOT_NAME = 'fake_snapshot'
   40 SNAPSHOT_ACCESS_TIME = '1466455782'
   41 CONSISTENCY_GROUP_NAME = 'fake_consistency_group'
   42 SHARE_SIZE = 10
   43 TENANT_ID = '24cb2448-13d8-4f41-afd9-eff5c4fd2a57'
   44 SHARE_ID = '7cf7c200-d3af-4e05-b87e-9167c95dfcad'
   45 SHARE_ID2 = 'b51c5a31-aa5b-4254-9ee8-7d39fa4c8c38'
   46 SHARE_ID3 = '1379991d-037b-4897-bf3a-81b4aac72eff'
   47 SHARE_ID4 = '1cb41aad-fd9b-4964-8059-646f69de925e'
   48 SHARE_INSTANCE_ID = 'd24e7257-124e-4fb6-b05b-d384f660bc85'
   49 PARENT_SHARE_ID = '585c3935-2aa9-437c-8bad-5abae1076555'
   50 SNAPSHOT_ID = 'de4c9050-e2f9-4ce1-ade4-5ed0c9f26451'
   51 CONSISTENCY_GROUP_ID = '65bfa2c9-dc6c-4513-951a-b8d15b453ad8'
   52 CONSISTENCY_GROUP_ID2 = '35f5c1ea-45fb-40c4-98ae-2a2a17554159'
   53 CG_SNAPSHOT_ID = '6ddd8a6b-5df7-417b-a2ae-3f6e449f4eea'
   54 CG_SNAPSHOT_MEMBER_ID1 = '629f79ef-b27e-4596-9737-30f084e5ba29'
   55 CG_SNAPSHOT_MEMBER_ID2 = 'e876aa9c-a322-4391-bd88-9266178262be'
   56 FREE_CAPACITY = 10000000000
   57 TOTAL_CAPACITY = 20000000000
   58 AGGREGATE = 'manila_aggr_1'
   59 AGGREGATES = ('manila_aggr_1', 'manila_aggr_2')
   60 ROOT_AGGREGATES = ('root_aggr_1', 'root_aggr_2')
   61 ROOT_VOLUME_AGGREGATE = 'manila1'
   62 ROOT_VOLUME = 'root'
   63 CLUSTER_NODE = 'cluster1_01'
   64 CLUSTER_NODES = ('cluster1_01', 'cluster1_02')
   65 NODE_DATA_PORT = 'e0c'
   66 NODE_DATA_PORTS = ('e0c', 'e0d')
   67 LIF_NAME_TEMPLATE = 'os_%(net_allocation_id)s'
   68 SHARE_TYPE_ID = '26e89a5b-960b-46bb-a8cf-0778e653098f'
   69 SHARE_TYPE_NAME = 'fake_share_type'
   70 IPSPACE = 'fake_ipspace'
   71 IPSPACE_ID = '27d38c27-3e8b-4d7d-9d91-fcf295e3ac8f'
   72 MTU = 1234
   73 DEFAULT_MTU = 1500
   74 MANILA_HOST_NAME = '%(host)s@%(backend)s#%(pool)s' % {
   75     'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME}
   76 QOS_EXTRA_SPEC = 'netapp:maxiops'
   77 QOS_SIZE_DEPENDENT_EXTRA_SPEC = 'netapp:maxbpspergib'
   78 QOS_NORMALIZED_SPEC = 'maxiops'
   79 QOS_POLICY_GROUP_NAME = 'fake_qos_policy_group_name'
   80 
   81 CLIENT_KWARGS = {
   82     'username': 'admin',
   83     'trace': False,
   84     'hostname': '127.0.0.1',
   85     'vserver': None,
   86     'transport_type': 'https',
   87     'password': 'pass',
   88     'port': '443',
   89     'api_trace_pattern': '(.*)',
   90 }
   91 
   92 SHARE = {
   93     'id': SHARE_ID,
   94     'host': MANILA_HOST_NAME,
   95     'project_id': TENANT_ID,
   96     'name': SHARE_NAME,
   97     'size': SHARE_SIZE,
   98     'share_proto': 'fake',
   99     'share_type_id': 'fake_share_type_id',
  100     'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0',
  101     'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86',
  102     'network_info': {
  103         'network_allocations': [{'ip_address': 'ip'}]
  104     },
  105     'replica_state': constants.REPLICA_STATE_ACTIVE,
  106     'status': constants.STATUS_AVAILABLE,
  107     'share_server': None,
  108     'encrypt': False,
  109 }
  110 
  111 SHARE_INSTANCE = {
  112     'id': SHARE_INSTANCE_ID,
  113     'share_id': SHARE_ID,
  114     'host': MANILA_HOST_NAME,
  115     'project_id': TENANT_ID,
  116     'name': SHARE_INSTANCE_NAME,
  117     'size': SHARE_SIZE,
  118     'share_proto': 'fake',
  119     'share_type_id': SHARE_TYPE_ID,
  120     'share_network_id': '5dfe0898-e2a1-4740-9177-81c7d26713b0',
  121     'share_server_id': '7e6a2cc8-871f-4b1d-8364-5aad0f98da86',
  122     'replica_state': constants.REPLICA_STATE_ACTIVE,
  123     'status': constants.STATUS_AVAILABLE,
  124 }
  125 
  126 FLEXVOL_TO_MANAGE = {
  127     'aggregate': POOL_NAME,
  128     'junction-path': '/%s' % FLEXVOL_NAME,
  129     'name': FLEXVOL_NAME,
  130     'type': 'rw',
  131     'style': 'flex',
  132     'size': '1610612736',  # rounds up to 2 GB
  133 }
  134 
  135 FLEXVOL_WITHOUT_QOS = copy.deepcopy(FLEXVOL_TO_MANAGE)
  136 FLEXVOL_WITHOUT_QOS.update({'qos-policy-group-name': None})
  137 FLEXVOL_WITH_QOS = copy.deepcopy(FLEXVOL_TO_MANAGE)
  138 FLEXVOL_WITH_QOS.update({'qos-policy-group-name': QOS_POLICY_GROUP_NAME})
  139 
  140 QOS_POLICY_GROUP = {
  141     'policy-group': QOS_POLICY_GROUP_NAME,
  142     'vserver': VSERVER1,
  143     'max-throughput': '3000iops',
  144     'num-workloads': 1,
  145 }
  146 
  147 FLEXVOL = {
  148     'aggregate': POOL_NAME,
  149     'junction-path': '/%s' % FLEXVOL_NAME,
  150     'name': FLEXVOL_NAME,
  151     'type': 'rw',
  152     'style': 'flex',
  153     'size': '1610612736',  # rounds down to 1 GB,
  154     'owning-vserver-name': VSERVER1,
  155 }
  156 
  157 EXTRA_SPEC = {
  158     'netapp:thin_provisioned': 'true',
  159     'netapp:snapshot_policy': 'default',
  160     'netapp:language': 'en-US',
  161     'netapp:dedup': 'True',
  162     'netapp:compression': 'false',
  163     'netapp:max_files': 5000,
  164     'netapp:split_clone_on_create': 'true',
  165     'netapp_disk_type': 'FCAL',
  166     'netapp_raid_type': 'raid4',
  167     'netapp_flexvol_encryption': 'true',
  168 }
  169 
  170 EXTRA_SPEC_WITH_QOS = copy.deepcopy(EXTRA_SPEC)
  171 EXTRA_SPEC_WITH_QOS.update({
  172     'qos': True,
  173     QOS_EXTRA_SPEC: '3000',
  174 })
  175 
  176 EXTRA_SPEC_WITH_SIZE_DEPENDENT_QOS = copy.deepcopy(EXTRA_SPEC)
  177 EXTRA_SPEC_WITH_SIZE_DEPENDENT_QOS.update({
  178     'qos': True,
  179     QOS_SIZE_DEPENDENT_EXTRA_SPEC: '1000',
  180 })
  181 
  182 PROVISIONING_OPTIONS = {
  183     'thin_provisioned': True,
  184     'snapshot_policy': 'default',
  185     'language': 'en-US',
  186     'dedup_enabled': True,
  187     'compression_enabled': False,
  188     'max_files': 5000,
  189     'split': True,
  190     'encrypt': False,
  191     'hide_snapdir': False,
  192 }
  193 
  194 PROVISIONING_OPTIONS_WITH_QOS = copy.deepcopy(PROVISIONING_OPTIONS)
  195 PROVISIONING_OPTIONS_WITH_QOS.update(
  196     {'qos_policy_group': QOS_POLICY_GROUP_NAME})
  197 
  198 PROVISIONING_OPTIONS_BOOLEAN = {
  199     'thin_provisioned': True,
  200     'dedup_enabled': False,
  201     'compression_enabled': False,
  202     'split': False,
  203     'hide_snapdir': False,
  204 }
  205 
  206 PROVISIONING_OPTIONS_BOOLEAN_THIN_PROVISIONED_TRUE = {
  207     'thin_provisioned': True,
  208     'snapshot_policy': None,
  209     'language': None,
  210     'dedup_enabled': False,
  211     'compression_enabled': False,
  212     'max_files': None,
  213     'split': False,
  214     'encrypt': False,
  215 }
  216 
  217 PROVISIONING_OPTIONS_STRING = {
  218     'snapshot_policy': 'default',
  219     'language': 'en-US',
  220     'max_files': 5000,
  221 }
  222 
  223 PROVISIONING_OPTIONS_STRING_MISSING_SPECS = {
  224     'snapshot_policy': 'default',
  225     'language': 'en-US',
  226     'max_files': None,
  227 }
  228 
  229 PROVISIONING_OPTIONS_STRING_DEFAULT = {
  230     'snapshot_policy': None,
  231     'language': None,
  232     'max_files': None,
  233 }
  234 
  235 SHORT_BOOLEAN_EXTRA_SPEC = {
  236     'netapp:thin_provisioned': 'true',
  237 }
  238 
  239 STRING_EXTRA_SPEC = {
  240     'netapp:snapshot_policy': 'default',
  241     'netapp:language': 'en-US',
  242     'netapp:max_files': 5000,
  243 }
  244 
  245 SHORT_STRING_EXTRA_SPEC = {
  246     'netapp:snapshot_policy': 'default',
  247     'netapp:language': 'en-US',
  248 }
  249 
  250 INVALID_EXTRA_SPEC = {
  251     'netapp:thin_provisioned': 'ture',
  252     'netapp:snapshot_policy': 'wrong_default',
  253     'netapp:language': 'abc',
  254 }
  255 
  256 INVALID_EXTRA_SPEC_COMBO = {
  257     'netapp:dedup': 'false',
  258     'netapp:compression': 'true'
  259 }
  260 
  261 INVALID_MAX_FILE_EXTRA_SPEC = {
  262     'netapp:max_files': -1,
  263 }
  264 
  265 EMPTY_EXTRA_SPEC = {}
  266 
  267 SHARE_TYPE = {
  268     'id': SHARE_TYPE_ID,
  269     'name': SHARE_TYPE_NAME,
  270     'extra_specs': EXTRA_SPEC
  271 }
  272 
  273 OVERLAPPING_EXTRA_SPEC = {
  274     'compression': '<is> True',
  275     'netapp:compression': 'true',
  276     'dedupe': '<is> True',
  277     'netapp:dedup': 'false',
  278     'thin_provisioning': '<is> False',
  279     'netapp:thin_provisioned': 'true',
  280 }
  281 
  282 REMAPPED_OVERLAPPING_EXTRA_SPEC = {
  283     'netapp:compression': 'true',
  284     'netapp:dedup': 'true',
  285     'netapp:thin_provisioned': 'false',
  286 }
  287 
  288 USER_NETWORK_ALLOCATIONS = [
  289     {
  290         'id': '132dbb10-9a36-46f2-8d89-3d909830c356',
  291         'ip_address': '10.10.10.10',
  292         'cidr': '10.10.10.0/24',
  293         'segmentation_id': '1000',
  294         'network_type': 'vlan',
  295         'label': 'user',
  296         'mtu': MTU,
  297         'gateway': '10.10.10.1',
  298     },
  299     {
  300         'id': '7eabdeed-bad2-46ea-bd0f-a33884c869e0',
  301         'ip_address': '10.10.10.20',
  302         'cidr': '10.10.10.0/24',
  303         'segmentation_id': '1000',
  304         'network_type': 'vlan',
  305         'label': 'user',
  306         'mtu': MTU,
  307         'gateway': '10.10.10.1',
  308     }
  309 ]
  310 
  311 USER_NETWORK_ALLOCATIONS_IPV6 = [
  312     {
  313         'id': '234dbb10-9a36-46f2-8d89-3d909830c356',
  314         'ip_address': 'fd68:1a09:66ab:8d51:0:10:0:1',
  315         'cidr': 'fd68:1a09:66ab:8d51::/64',
  316         'segmentation_id': '2000',
  317         'network_type': 'vlan',
  318         'label': 'user',
  319         'mtu': MTU,
  320         'gateway': 'fd68:1a09:66ab:8d51:0:0:0:1',
  321     },
  322     {
  323         'id': '6677deed-bad2-46ea-bd0f-a33884c869e0',
  324         'ip_address': 'fd68:1a09:66ab:8d51:0:10:0:2',
  325         'cidr': 'fd68:1a09:66ab:8d51::/64',
  326         'segmentation_id': '2000',
  327         'network_type': 'vlan',
  328         'label': 'user',
  329         'mtu': MTU,
  330         'gateway': 'fd68:1a09:66ab:8d51:0:0:0:1',
  331     }
  332 ]
  333 
  334 ADMIN_NETWORK_ALLOCATIONS = [
  335     {
  336         'id': '132dbb10-9a36-46f2-8d89-3d909830c356',
  337         'ip_address': '10.10.20.10',
  338         'cidr': '10.10.20.0/24',
  339         'segmentation_id': None,
  340         'network_type': 'flat',
  341         'label': 'admin',
  342         'mtu': MTU,
  343         'gateway': '10.10.20.1'
  344     },
  345 ]
  346 
  347 NETWORK_INFO = {
  348     'server_id': '56aafd02-4d44-43d7-b784-57fc88167224',
  349     'security_services': ['fake_ldap', 'fake_kerberos', 'fake_ad', ],
  350     'network_allocations': USER_NETWORK_ALLOCATIONS,
  351     'admin_network_allocations': ADMIN_NETWORK_ALLOCATIONS,
  352     'neutron_net_id': '4eff22ca-5ad2-454d-a000-aadfd7b40b39',
  353     'neutron_subnet_id': '62bf1c2c-18eb-421b-8983-48a6d39aafe0',
  354     'segmentation_id': '1000',
  355 }
  356 NETWORK_INFO_NETMASK = '255.255.255.0'
  357 
  358 SHARE_SERVER = {
  359     'id': 'fake_id',
  360     'share_network_id': 'c5b3a865-56d0-4d88-abe5-879965e099c9',
  361     'backend_details': {
  362         'vserver_name': VSERVER1
  363     },
  364     'network_allocations': (USER_NETWORK_ALLOCATIONS +
  365                             ADMIN_NETWORK_ALLOCATIONS),
  366 }
  367 
  368 SNAPSHOT = {
  369     'id': SNAPSHOT_ID,
  370     'project_id': TENANT_ID,
  371     'share_id': PARENT_SHARE_ID,
  372     'status': constants.STATUS_CREATING,
  373     'provider_location': None,
  374 }
  375 
  376 SNAPSHOT_TO_MANAGE = {
  377     'id': SNAPSHOT_ID,
  378     'project_id': TENANT_ID,
  379     'share_id': PARENT_SHARE_ID,
  380     'status': constants.STATUS_CREATING,
  381     'provider_location': SNAPSHOT_NAME,
  382 }
  383 
  384 CDOT_SNAPSHOT = {
  385     'name': SNAPSHOT_NAME,
  386     'volume': SHARE_NAME,
  387     'busy': False,
  388     'owners': set(),
  389     'access-time': SNAPSHOT_ACCESS_TIME,
  390 }
  391 
  392 CDOT_SNAPSHOT_BUSY_VOLUME_CLONE = {
  393     'name': SNAPSHOT_NAME,
  394     'volume': SHARE_NAME,
  395     'busy': True,
  396     'owners': {'volume clone'},
  397     'access-time': SNAPSHOT_ACCESS_TIME,
  398 }
  399 
  400 CDOT_SNAPSHOT_BUSY_SNAPMIRROR = {
  401     'name': SNAPSHOT_NAME,
  402     'volume': SHARE_NAME,
  403     'busy': True,
  404     'owners': {'snapmirror'},
  405     'access-time': SNAPSHOT_ACCESS_TIME,
  406 }
  407 
  408 CDOT_CLONE_CHILD_1 = 'fake_child_1'
  409 CDOT_CLONE_CHILD_2 = 'fake_child_2'
  410 CDOT_CLONE_CHILDREN = [
  411     {'name': CDOT_CLONE_CHILD_1},
  412     {'name': CDOT_CLONE_CHILD_2},
  413 ]
  414 
  415 SHARE_FOR_CG1 = {
  416     'id': SHARE_ID,
  417     'host': '%(host)s@%(backend)s#%(pool)s' % {
  418         'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME},
  419     'name': 'share_1',
  420     'share_proto': 'NFS',
  421     'source_share_group_snapshot_member_id': None,
  422 }
  423 
  424 SHARE_FOR_CG2 = {
  425     'id': SHARE_ID2,
  426     'host': '%(host)s@%(backend)s#%(pool)s' % {
  427         'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME},
  428     'name': 'share_2',
  429     'share_proto': 'NFS',
  430     'source_share_group_snapshot_member_id': None,
  431 }
  432 
  433 # Clone dest of SHARE_FOR_CG1
  434 SHARE_FOR_CG3 = {
  435     'id': SHARE_ID3,
  436     'host': '%(host)s@%(backend)s#%(pool)s' % {
  437         'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME},
  438     'name': 'share3',
  439     'share_proto': 'NFS',
  440     'source_share_group_snapshot_member_id': CG_SNAPSHOT_MEMBER_ID1,
  441 }
  442 
  443 # Clone dest of SHARE_FOR_CG2
  444 SHARE_FOR_CG4 = {
  445     'id': SHARE_ID4,
  446     'host': '%(host)s@%(backend)s#%(pool)s' % {
  447         'host': HOST_NAME, 'backend': BACKEND_NAME, 'pool': POOL_NAME},
  448     'name': 'share4',
  449     'share_proto': 'NFS',
  450     'source_share_group_snapshot_member_id': CG_SNAPSHOT_MEMBER_ID2,
  451 }
  452 
  453 EMPTY_CONSISTENCY_GROUP = {
  454     'cgsnapshots': [],
  455     'description': 'fake description',
  456     'host': '%(host)s@%(backend)s' % {
  457         'host': HOST_NAME, 'backend': BACKEND_NAME},
  458     'id': CONSISTENCY_GROUP_ID,
  459     'name': CONSISTENCY_GROUP_NAME,
  460     'shares': [],
  461 }
  462 
  463 CONSISTENCY_GROUP = {
  464     'cgsnapshots': [],
  465     'description': 'fake description',
  466     'host': '%(host)s@%(backend)s' % {
  467         'host': HOST_NAME, 'backend': BACKEND_NAME},
  468     'id': CONSISTENCY_GROUP_ID,
  469     'name': CONSISTENCY_GROUP_NAME,
  470     'shares': [SHARE_FOR_CG1, SHARE_FOR_CG2],
  471 }
  472 
  473 CONSISTENCY_GROUP_DEST = {
  474     'cgsnapshots': [],
  475     'description': 'fake description',
  476     'host': '%(host)s@%(backend)s' % {
  477         'host': HOST_NAME, 'backend': BACKEND_NAME},
  478     'id': CONSISTENCY_GROUP_ID,
  479     'name': CONSISTENCY_GROUP_NAME,
  480     'shares': [SHARE_FOR_CG3, SHARE_FOR_CG4],
  481 }
  482 
  483 CG_SNAPSHOT_MEMBER_1 = {
  484     'cgsnapshot_id': CG_SNAPSHOT_ID,
  485     'id': CG_SNAPSHOT_MEMBER_ID1,
  486     'share_id': SHARE_ID,
  487     'share_proto': 'NFS',
  488     'size': SHARE_SIZE,
  489 }
  490 
  491 CG_SNAPSHOT_MEMBER_2 = {
  492     'cgsnapshot_id': CG_SNAPSHOT_ID,
  493     'id': CG_SNAPSHOT_MEMBER_ID2,
  494     'share_id': SHARE_ID2,
  495     'share_proto': 'NFS',
  496     'size': SHARE_SIZE,
  497 }
  498 
  499 CG_SNAPSHOT = {
  500     'share_group_snapshot_members': [CG_SNAPSHOT_MEMBER_1,
  501                                      CG_SNAPSHOT_MEMBER_2],
  502     'share_group': CONSISTENCY_GROUP,
  503     'share_group_id': CONSISTENCY_GROUP_ID,
  504     'id': CG_SNAPSHOT_ID,
  505     'project_id': TENANT_ID,
  506 }
  507 
  508 COLLATED_CGSNAPSHOT_INFO = [
  509     {
  510         'share': SHARE_FOR_CG3,
  511         'snapshot': {
  512             'share_id': SHARE_ID,
  513             'id': CG_SNAPSHOT_ID,
  514             'size': SHARE_SIZE,
  515         }
  516     },
  517     {
  518         'share': SHARE_FOR_CG4,
  519         'snapshot': {
  520             'share_id': SHARE_ID2,
  521             'id': CG_SNAPSHOT_ID,
  522             'size': SHARE_SIZE,
  523         }
  524     },
  525 ]
  526 
  527 IDENTIFIER = 'c5b3a865-56d0-4d88-dke5-853465e099c9'
  528 
  529 LIF_NAMES = []
  530 LIF_ADDRESSES = ['10.10.10.10', '10.10.10.20']
  531 LIFS = (
  532     {'address': LIF_ADDRESSES[0],
  533      'home-node': CLUSTER_NODES[0],
  534      'home-port': 'e0c',
  535      'interface-name': 'os_132dbb10-9a36-46f2-8d89-3d909830c356',
  536      'netmask': NETWORK_INFO_NETMASK,
  537      'role': 'data',
  538      'vserver': VSERVER1
  539      },
  540     {'address': LIF_ADDRESSES[1],
  541      'home-node': CLUSTER_NODES[1],
  542      'home-port': 'e0c',
  543      'interface-name': 'os_7eabdeed-bad2-46ea-bd0f-a33884c869e0',
  544      'netmask': NETWORK_INFO_NETMASK,
  545      'role': 'data',
  546      'vserver': VSERVER1
  547      },
  548 )
  549 
  550 INTERFACE_ADDRESSES_WITH_METADATA = {
  551     LIF_ADDRESSES[0]: {
  552         'is_admin_only': False,
  553         'preferred': True,
  554     },
  555     LIF_ADDRESSES[1]: {
  556         'is_admin_only': True,
  557         'preferred': False,
  558     },
  559 }
  560 
  561 NFS_EXPORTS = [
  562     {
  563         'path': ':'.join([LIF_ADDRESSES[0], 'fake_export_path']),
  564         'is_admin_only': False,
  565         'metadata': {
  566             'preferred': True,
  567         },
  568     },
  569     {
  570         'path': ':'.join([LIF_ADDRESSES[1], 'fake_export_path']),
  571         'is_admin_only': True,
  572         'metadata': {
  573             'preferred': False,
  574         },
  575     },
  576 ]
  577 
  578 SHARE_ACCESS = {
  579     'access_type': 'user',
  580     'access_to': [LIF_ADDRESSES[0]]
  581 }
  582 
  583 EMS_MESSAGE_0 = {
  584     'computer-name': HOST_NAME,
  585     'event-id': '0',
  586     'event-source': 'Manila driver %s' % DRIVER_NAME,
  587     'app-version': APP_VERSION,
  588     'category': 'provisioning',
  589     'event-description': 'OpenStack Manila connected to cluster node',
  590     'log-level': '5',
  591     'auto-support': 'false'
  592 }
  593 
  594 EMS_MESSAGE_1 = {
  595     'computer-name': HOST_NAME,
  596     'event-id': '1',
  597     'event-source': 'Manila driver %s' % DRIVER_NAME,
  598     'app-version': APP_VERSION,
  599     'category': 'provisioning',
  600     'event-description': '',
  601     'log-level': '5',
  602     'auto-support': 'false'
  603 }
  604 
  605 AGGREGATE_CAPACITIES = {
  606     AGGREGATES[0]: {
  607         'available': 1181116007,  # 1.1 GB
  608         'total': 3543348020,      # 3.3 GB
  609         'used': 2362232013,       # 2.2 GB
  610     },
  611     AGGREGATES[1]: {
  612         'available': 2147483648,  # 2.0 GB
  613         'total': 6442450944,      # 6.0 GB
  614         'used': 4294967296,       # 4.0 GB
  615     }
  616 }
  617 
  618 AGGREGATE_CAPACITIES_VSERVER_CREDS = {
  619     AGGREGATES[0]: {
  620         'available': 1181116007,  # 1.1 GB
  621     },
  622     AGGREGATES[1]: {
  623         'available': 2147483648,  # 2.0 GB
  624     }
  625 }
  626 
  627 SSC_INFO = {
  628     AGGREGATES[0]: {
  629         'netapp_raid_type': 'raid4',
  630         'netapp_disk_type': 'FCAL',
  631         'netapp_hybrid_aggregate': 'false',
  632         'netapp_aggregate': AGGREGATES[0],
  633     },
  634     AGGREGATES[1]: {
  635         'netapp_raid_type': 'raid_dp',
  636         'netapp_disk_type': ['SATA', 'SSD'],
  637         'netapp_hybrid_aggregate': 'true',
  638         'netapp_aggregate': AGGREGATES[1],
  639     }
  640 }
  641 
  642 SSC_INFO_VSERVER_CREDS = {
  643     AGGREGATES[0]: {
  644         'netapp_aggregate': AGGREGATES[0],
  645     },
  646     AGGREGATES[1]: {
  647         'netapp_aggregate': AGGREGATES[1],
  648     }
  649 }
  650 
  651 POOLS = [
  652     {
  653         'pool_name': AGGREGATES[0],
  654         'netapp_aggregate': AGGREGATES[0],
  655         'total_capacity_gb': 3.3,
  656         'free_capacity_gb': 1.1,
  657         'allocated_capacity_gb': 2.2,
  658         'qos': 'False',
  659         'reserved_percentage': 5,
  660         'dedupe': [True, False],
  661         'compression': [True, False],
  662         'thin_provisioning': [True, False],
  663         'netapp_flexvol_encryption': True,
  664         'netapp_raid_type': 'raid4',
  665         'netapp_disk_type': 'FCAL',
  666         'netapp_hybrid_aggregate': 'false',
  667         'utilization': 30.0,
  668         'filter_function': 'filter',
  669         'goodness_function': 'goodness',
  670         'snapshot_support': True,
  671         'create_share_from_snapshot_support': True,
  672         'revert_to_snapshot_support': True,
  673         'qos': True,
  674     },
  675     {
  676         'pool_name': AGGREGATES[1],
  677         'netapp_aggregate': AGGREGATES[1],
  678         'total_capacity_gb': 6.0,
  679         'free_capacity_gb': 2.0,
  680         'allocated_capacity_gb': 4.0,
  681         'qos': 'False',
  682         'reserved_percentage': 5,
  683         'dedupe': [True, False],
  684         'compression': [True, False],
  685         'thin_provisioning': [True, False],
  686         'netapp_flexvol_encryption': True,
  687         'netapp_raid_type': 'raid_dp',
  688         'netapp_disk_type': ['SATA', 'SSD'],
  689         'netapp_hybrid_aggregate': 'true',
  690         'utilization': 42.0,
  691         'filter_function': 'filter',
  692         'goodness_function': 'goodness',
  693         'snapshot_support': True,
  694         'create_share_from_snapshot_support': True,
  695         'revert_to_snapshot_support': True,
  696         'qos': True,
  697     },
  698 ]
  699 
  700 POOLS_VSERVER_CREDS = [
  701     {
  702         'pool_name': AGGREGATES[0],
  703         'netapp_aggregate': AGGREGATES[0],
  704         'total_capacity_gb': 'unknown',
  705         'free_capacity_gb': 1.1,
  706         'allocated_capacity_gb': 0.0,
  707         'qos': 'False',
  708         'reserved_percentage': 5,
  709         'dedupe': [True, False],
  710         'compression': [True, False],
  711         'thin_provisioning': [True, False],
  712         'netapp_flexvol_encryption': True,
  713         'utilization': 50.0,
  714         'filter_function': None,
  715         'goodness_function': None,
  716         'snapshot_support': True,
  717         'create_share_from_snapshot_support': True,
  718         'revert_to_snapshot_support': True,
  719         'qos': False,
  720     },
  721     {
  722         'pool_name': AGGREGATES[1],
  723         'netapp_aggregate': AGGREGATES[1],
  724         'total_capacity_gb': 'unknown',
  725         'free_capacity_gb': 2.0,
  726         'allocated_capacity_gb': 0.0,
  727         'qos': 'False',
  728         'reserved_percentage': 5,
  729         'dedupe': [True, False],
  730         'compression': [True, False],
  731         'thin_provisioning': [True, False],
  732         'netapp_flexvol_encryption': True,
  733         'utilization': 50.0,
  734         'filter_function': None,
  735         'goodness_function': None,
  736         'snapshot_support': True,
  737         'create_share_from_snapshot_support': True,
  738         'revert_to_snapshot_support': True,
  739         'qos': False,
  740     },
  741 ]
  742 
  743 SSC_AGGREGATES = [
  744     {
  745         'name': AGGREGATES[0],
  746         'raid-type': 'raid4',
  747         'is-hybrid': False,
  748     },
  749     {
  750         'name': AGGREGATES[1],
  751         'raid-type': 'raid_dp',
  752         'is-hybrid': True,
  753     },
  754 ]
  755 
  756 CLUSTER_INFO = {
  757     'nodes': CLUSTER_NODES,
  758     'nve_support': True,
  759 }
  760 
  761 SSC_DISK_TYPES = ['FCAL', ['SATA', 'SSD']]
  762 
  763 NODE = 'cluster1-01'
  764 
  765 COUNTERS_T1 = [
  766     {
  767         'node-name': 'cluster1-01',
  768         'instance-uuid': 'cluster1-01:kernel:system',
  769         'avg_processor_busy': '29078861388',
  770         'instance-name': 'system',
  771         'timestamp': '1453573776',
  772     }, {
  773         'node-name': 'cluster1-01',
  774         'instance-uuid': 'cluster1-01:kernel:system',
  775         'cpu_elapsed_time': '1063283283681',
  776         'instance-name': 'system',
  777         'timestamp': '1453573776',
  778     }, {
  779         'node-name': 'cluster1-01',
  780         'instance-uuid': 'cluster1-01:kernel:system',
  781         'cpu_elapsed_time1': '1063283283681',
  782         'instance-name': 'system',
  783         'timestamp': '1453573776',
  784     }, {
  785         'cp_phase_times:p2a_snap': '714',
  786         'cp_phase_times:p4_finish': '14897',
  787         'cp_phase_times:setup': '581',
  788         'cp_phase_times:p2a_dlog1': '6019',
  789         'cp_phase_times:p2a_dlog2': '2328',
  790         'cp_phase_times:p2v_cont': '2479',
  791         'cp_phase_times:p2v_volinfo': '1138',
  792         'cp_phase_times:p2v_bm': '3484',
  793         'cp_phase_times:p2v_fsinfo': '2031',
  794         'cp_phase_times:p2a_inofile': '356',
  795         'cp_phase_times': '581,5007,1840,9832,498,0,839,799,1336,2031,0,377,'
  796                           '427,1058,354,3484,5135,1460,1138,2479,356,1373'
  797                           ',6019,9,2328,2257,229,493,1275,0,6059,714,530215,'
  798                           '21603833,0,0,3286,11075940,22001,14897,36',
  799         'cp_phase_times:p2v_dlog2': '377',
  800         'instance-name': 'wafl',
  801         'cp_phase_times:p3_wait': '0',
  802         'cp_phase_times:p2a_bm': '6059',
  803         'cp_phase_times:p1_quota': '498',
  804         'cp_phase_times:p2v_inofile': '839',
  805         'cp_phase_times:p2a_refcount': '493',
  806         'cp_phase_times:p2a_fsinfo': '2257',
  807         'cp_phase_times:p2a_hyabc': '0',
  808         'cp_phase_times:p2a_volinfo': '530215',
  809         'cp_phase_times:pre_p0': '5007',
  810         'cp_phase_times:p2a_hya': '9',
  811         'cp_phase_times:p0_snap_del': '1840',
  812         'cp_phase_times:p2a_ino': '1373',
  813         'cp_phase_times:p2v_df_scores_sub': '354',
  814         'cp_phase_times:p2v_ino_pub': '799',
  815         'cp_phase_times:p2a_ipu_bitmap_grow': '229',
  816         'cp_phase_times:p2v_refcount': '427',
  817         'timestamp': '1453573776',
  818         'cp_phase_times:p2v_dlog1': '0',
  819         'cp_phase_times:p2_finish': '0',
  820         'cp_phase_times:p1_clean': '9832',
  821         'node-name': 'cluster1-01',
  822         'instance-uuid': 'cluster1-01:kernel:wafl',
  823         'cp_phase_times:p3a_volinfo': '11075940',
  824         'cp_phase_times:p2a_topaa': '1275',
  825         'cp_phase_times:p2_flush': '21603833',
  826         'cp_phase_times:p2v_df_scores': '1460',
  827         'cp_phase_times:ipu_disk_add': '0',
  828         'cp_phase_times:p2v_snap': '5135',
  829         'cp_phase_times:p5_finish': '36',
  830         'cp_phase_times:p2v_ino_pri': '1336',
  831         'cp_phase_times:p3v_volinfo': '3286',
  832         'cp_phase_times:p2v_topaa': '1058',
  833         'cp_phase_times:p3_finish': '22001',
  834     }, {
  835         'node-name': 'cluster1-01',
  836         'instance-uuid': 'cluster1-01:kernel:wafl',
  837         'total_cp_msecs': '33309624',
  838         'instance-name': 'wafl',
  839         'timestamp': '1453573776',
  840     }, {
  841         'domain_busy:kahuna': '2712467226',
  842         'timestamp': '1453573777',
  843         'domain_busy:cifs': '434036',
  844         'domain_busy:raid_exempt': '28',
  845         'node-name': 'cluster1-01',
  846         'instance-uuid': 'cluster1-01:kernel:processor0',
  847         'domain_busy:target': '6460782',
  848         'domain_busy:nwk_exempt': '20',
  849         'domain_busy:raid': '722094140',
  850         'domain_busy:storage': '2253156562',
  851         'instance-name': 'processor0',
  852         'domain_busy:cluster': '34',
  853         'domain_busy:wafl_xcleaner': '51275254',
  854         'domain_busy:wafl_exempt': '1243553699',
  855         'domain_busy:protocol': '54',
  856         'domain_busy': '1028851855595,2712467226,2253156562,5688808118,'
  857                        '722094140,28,6460782,59,434036,1243553699,51275254,'
  858                        '61237441,34,54,11,20,5254181873,13656398235,452215',
  859         'domain_busy:nwk_legacy': '5254181873',
  860         'domain_busy:dnscache': '59',
  861         'domain_busy:exempt': '5688808118',
  862         'domain_busy:hostos': '13656398235',
  863         'domain_busy:sm_exempt': '61237441',
  864         'domain_busy:nwk_exclusive': '11',
  865         'domain_busy:idle': '1028851855595',
  866         'domain_busy:ssan_exempt': '452215',
  867     }, {
  868         'node-name': 'cluster1-01',
  869         'instance-uuid': 'cluster1-01:kernel:processor0',
  870         'processor_elapsed_time': '1063283843318',
  871         'instance-name': 'processor0',
  872         'timestamp': '1453573777',
  873     }, {
  874         'domain_busy:kahuna': '1978024846',
  875         'timestamp': '1453573777',
  876         'domain_busy:cifs': '318584',
  877         'domain_busy:raid_exempt': '0',
  878         'node-name': 'cluster1-01',
  879         'instance-uuid': 'cluster1-01:kernel:processor1',
  880         'domain_busy:target': '3330956',
  881         'domain_busy:nwk_exempt': '0',
  882         'domain_busy:raid': '722235930',
  883         'domain_busy:storage': '1498890708',
  884         'instance-name': 'processor1',
  885         'domain_busy:cluster': '0',
  886         'domain_busy:wafl_xcleaner': '50122685',
  887         'domain_busy:wafl_exempt': '1265921369',
  888         'domain_busy:protocol': '0',
  889         'domain_busy': '1039557880852,1978024846,1498890708,3734060289,'
  890                        '722235930,0,3330956,0,318584,1265921369,50122685,'
  891                        '36417362,0,0,0,0,2815252976,10274810484,393451',
  892         'domain_busy:nwk_legacy': '2815252976',
  893         'domain_busy:dnscache': '0',
  894         'domain_busy:exempt': '3734060289',
  895         'domain_busy:hostos': '10274810484',
  896         'domain_busy:sm_exempt': '36417362',
  897         'domain_busy:nwk_exclusive': '0',
  898         'domain_busy:idle': '1039557880852',
  899         'domain_busy:ssan_exempt': '393451',
  900     }, {
  901         'node-name': 'cluster1-01',
  902         'instance-uuid': 'cluster1-01:kernel:processor1',
  903         'processor_elapsed_time': '1063283843321',
  904         'instance-name': 'processor1',
  905         'timestamp': '1453573777',
  906     }
  907 ]
  908 
  909 COUNTERS_T2 = [
  910     {
  911         'node-name': 'cluster1-01',
  912         'instance-uuid': 'cluster1-01:kernel:system',
  913         'avg_processor_busy': '29081228905',
  914         'instance-name': 'system',
  915         'timestamp': '1453573834',
  916     }, {
  917         'node-name': 'cluster1-01',
  918         'instance-uuid': 'cluster1-01:kernel:system',
  919         'cpu_elapsed_time': '1063340792148',
  920         'instance-name': 'system',
  921         'timestamp': '1453573834',
  922     }, {
  923         'node-name': 'cluster1-01',
  924         'instance-uuid': 'cluster1-01:kernel:system',
  925         'cpu_elapsed_time1': '1063340792148',
  926         'instance-name': 'system',
  927         'timestamp': '1453573834',
  928     }, {
  929         'cp_phase_times:p2a_snap': '714',
  930         'cp_phase_times:p4_finish': '14897',
  931         'cp_phase_times:setup': '581',
  932         'cp_phase_times:p2a_dlog1': '6019',
  933         'cp_phase_times:p2a_dlog2': '2328',
  934         'cp_phase_times:p2v_cont': '2479',
  935         'cp_phase_times:p2v_volinfo': '1138',
  936         'cp_phase_times:p2v_bm': '3484',
  937         'cp_phase_times:p2v_fsinfo': '2031',
  938         'cp_phase_times:p2a_inofile': '356',
  939         'cp_phase_times': '581,5007,1840,9832,498,0,839,799,1336,2031,0,377,'
  940                           '427,1058,354,3484,5135,1460,1138,2479,356,1373,'
  941                           '6019,9,2328,2257,229,493,1275,0,6059,714,530215,'
  942                           '21604863,0,0,3286,11076392,22001,14897,36',
  943         'cp_phase_times:p2v_dlog2': '377',
  944         'instance-name': 'wafl',
  945         'cp_phase_times:p3_wait': '0',
  946         'cp_phase_times:p2a_bm': '6059',
  947         'cp_phase_times:p1_quota': '498',
  948         'cp_phase_times:p2v_inofile': '839',
  949         'cp_phase_times:p2a_refcount': '493',
  950         'cp_phase_times:p2a_fsinfo': '2257',
  951         'cp_phase_times:p2a_hyabc': '0',
  952         'cp_phase_times:p2a_volinfo': '530215',
  953         'cp_phase_times:pre_p0': '5007',
  954         'cp_phase_times:p2a_hya': '9',
  955         'cp_phase_times:p0_snap_del': '1840',
  956         'cp_phase_times:p2a_ino': '1373',
  957         'cp_phase_times:p2v_df_scores_sub': '354',
  958         'cp_phase_times:p2v_ino_pub': '799',
  959         'cp_phase_times:p2a_ipu_bitmap_grow': '229',
  960         'cp_phase_times:p2v_refcount': '427',
  961         'timestamp': '1453573834',
  962         'cp_phase_times:p2v_dlog1': '0',
  963         'cp_phase_times:p2_finish': '0',
  964         'cp_phase_times:p1_clean': '9832',
  965         'node-name': 'cluster1-01',
  966         'instance-uuid': 'cluster1-01:kernel:wafl',
  967         'cp_phase_times:p3a_volinfo': '11076392',
  968         'cp_phase_times:p2a_topaa': '1275',
  969         'cp_phase_times:p2_flush': '21604863',
  970         'cp_phase_times:p2v_df_scores': '1460',
  971         'cp_phase_times:ipu_disk_add': '0',
  972         'cp_phase_times:p2v_snap': '5135',
  973         'cp_phase_times:p5_finish': '36',
  974         'cp_phase_times:p2v_ino_pri': '1336',
  975         'cp_phase_times:p3v_volinfo': '3286',
  976         'cp_phase_times:p2v_topaa': '1058',
  977         'cp_phase_times:p3_finish': '22001',
  978     }, {
  979         'node-name': 'cluster1-01',
  980         'instance-uuid': 'cluster1-01:kernel:wafl',
  981         'total_cp_msecs': '33311106',
  982         'instance-name': 'wafl',
  983         'timestamp': '1453573834',
  984     }, {
  985         'domain_busy:kahuna': '2712629374',
  986         'timestamp': '1453573834',
  987         'domain_busy:cifs': '434036',
  988         'domain_busy:raid_exempt': '28',
  989         'node-name': 'cluster1-01',
  990         'instance-uuid': 'cluster1-01:kernel:processor0',
  991         'domain_busy:target': '6461082',
  992         'domain_busy:nwk_exempt': '20',
  993         'domain_busy:raid': '722136824',
  994         'domain_busy:storage': '2253260824',
  995         'instance-name': 'processor0',
  996         'domain_busy:cluster': '34',
  997         'domain_busy:wafl_xcleaner': '51277506',
  998         'domain_busy:wafl_exempt': '1243637154',
  999         'domain_busy:protocol': '54',
 1000         'domain_busy': '1028906640232,2712629374,2253260824,5689093500,'
 1001                        '722136824,28,6461082,59,434036,1243637154,51277506,'
 1002                        '61240335,34,54,11,20,5254491236,13657992139,452215',
 1003         'domain_busy:nwk_legacy': '5254491236',
 1004         'domain_busy:dnscache': '59',
 1005         'domain_busy:exempt': '5689093500',
 1006         'domain_busy:hostos': '13657992139',
 1007         'domain_busy:sm_exempt': '61240335',
 1008         'domain_busy:nwk_exclusive': '11',
 1009         'domain_busy:idle': '1028906640232',
 1010         'domain_busy:ssan_exempt': '452215',
 1011     }, {
 1012         'node-name': 'cluster1-01',
 1013         'instance-uuid': 'cluster1-01:kernel:processor0',
 1014         'processor_elapsed_time': '1063341351916',
 1015         'instance-name': 'processor0',
 1016         'timestamp': '1453573834',
 1017     }, {
 1018         'domain_busy:kahuna': '1978217049',
 1019         'timestamp': '1453573834',
 1020         'domain_busy:cifs': '318584',
 1021         'domain_busy:raid_exempt': '0',
 1022         'node-name': 'cluster1-01',
 1023         'instance-uuid': 'cluster1-01:kernel:processor1',
 1024         'domain_busy:target': '3331147',
 1025         'domain_busy:nwk_exempt': '0',
 1026         'domain_busy:raid': '722276805',
 1027         'domain_busy:storage': '1498984059',
 1028         'instance-name': 'processor1',
 1029         'domain_busy:cluster': '0',
 1030         'domain_busy:wafl_xcleaner': '50126176',
 1031         'domain_busy:wafl_exempt': '1266039846',
 1032         'domain_busy:protocol': '0',
 1033         'domain_busy': '1039613222253,1978217049,1498984059,3734279672,'
 1034                        '722276805,0,3331147,0,318584,1266039846,50126176,'
 1035                        '36419297,0,0,0,0,2815435865,10276068104,393451',
 1036         'domain_busy:nwk_legacy': '2815435865',
 1037         'domain_busy:dnscache': '0',
 1038         'domain_busy:exempt': '3734279672',
 1039         'domain_busy:hostos': '10276068104',
 1040         'domain_busy:sm_exempt': '36419297',
 1041         'domain_busy:nwk_exclusive': '0',
 1042         'domain_busy:idle': '1039613222253',
 1043         'domain_busy:ssan_exempt': '393451',
 1044     }, {
 1045         'node-name': 'cluster1-01',
 1046         'instance-uuid': 'cluster1-01:kernel:processor1',
 1047         'processor_elapsed_time': '1063341351919',
 1048         'instance-name': 'processor1',
 1049         'timestamp': '1453573834',
 1050     },
 1051 ]
 1052 
 1053 SYSTEM_INSTANCE_UUIDS = ['cluster1-01:kernel:system']
 1054 SYSTEM_INSTANCE_NAMES = ['system']
 1055 
 1056 SYSTEM_COUNTERS = [
 1057     {
 1058         'node-name': 'cluster1-01',
 1059         'instance-uuid': 'cluster1-01:kernel:system',
 1060         'avg_processor_busy': '27877641199',
 1061         'instance-name': 'system',
 1062         'timestamp': '1453524928',
 1063     }, {
 1064         'node-name': 'cluster1-01',
 1065         'instance-uuid': 'cluster1-01:kernel:system',
 1066         'cpu_elapsed_time': '1014438541279',
 1067         'instance-name': 'system',
 1068         'timestamp': '1453524928',
 1069     }, {
 1070         'node-name': 'cluster1-01',
 1071         'instance-uuid': 'cluster1-01:kernel:system',
 1072         'cpu_elapsed_time1': '1014438541279',
 1073         'instance-name': 'system',
 1074         'timestamp': '1453524928',
 1075     },
 1076 ]
 1077 
 1078 
 1079 WAFL_INSTANCE_UUIDS = ['cluster1-01:kernel:wafl']
 1080 WAFL_INSTANCE_NAMES = ['wafl']
 1081 
 1082 WAFL_COUNTERS = [
 1083     {
 1084         'cp_phase_times': '563,4844,1731,9676,469,0,821,763,1282,1937,0,359,'
 1085                           '418,1048,344,3344,4867,1397,1101,2380,356,1318,'
 1086                           '5954,9,2236,2190,228,476,1221,0,5838,696,515588,'
 1087                           '20542954,0,0,3122,10567367,20696,13982,36',
 1088         'node-name': 'cluster1-01',
 1089         'instance-uuid': 'cluster1-01:kernel:wafl',
 1090         'instance-name': 'wafl',
 1091         'timestamp': '1453523339',
 1092     }, {
 1093         'node-name': 'cluster1-01',
 1094         'instance-uuid': 'cluster1-01:kernel:wafl',
 1095         'total_cp_msecs': '31721222',
 1096         'instance-name': 'wafl',
 1097         'timestamp': '1453523339',
 1098     },
 1099 ]
 1100 
 1101 WAFL_CP_PHASE_TIMES_COUNTER_INFO = {
 1102     'labels': [
 1103         'SETUP', 'PRE_P0', 'P0_SNAP_DEL', 'P1_CLEAN', 'P1_QUOTA',
 1104         'IPU_DISK_ADD', 'P2V_INOFILE', 'P2V_INO_PUB', 'P2V_INO_PRI',
 1105         'P2V_FSINFO', 'P2V_DLOG1', 'P2V_DLOG2', 'P2V_REFCOUNT',
 1106         'P2V_TOPAA', 'P2V_DF_SCORES_SUB', 'P2V_BM', 'P2V_SNAP',
 1107         'P2V_DF_SCORES', 'P2V_VOLINFO', 'P2V_CONT', 'P2A_INOFILE',
 1108         'P2A_INO', 'P2A_DLOG1', 'P2A_HYA', 'P2A_DLOG2', 'P2A_FSINFO',
 1109         'P2A_IPU_BITMAP_GROW', 'P2A_REFCOUNT', 'P2A_TOPAA',
 1110         'P2A_HYABC', 'P2A_BM', 'P2A_SNAP', 'P2A_VOLINFO', 'P2_FLUSH',
 1111         'P2_FINISH', 'P3_WAIT', 'P3V_VOLINFO', 'P3A_VOLINFO',
 1112         'P3_FINISH', 'P4_FINISH', 'P5_FINISH',
 1113     ],
 1114     'name': 'cp_phase_times',
 1115 }
 1116 
 1117 EXPANDED_WAFL_COUNTERS = [
 1118     {
 1119         'cp_phase_times:p2a_snap': '696',
 1120         'cp_phase_times:p4_finish': '13982',
 1121         'cp_phase_times:setup': '563',
 1122         'cp_phase_times:p2a_dlog1': '5954',
 1123         'cp_phase_times:p2a_dlog2': '2236',
 1124         'cp_phase_times:p2v_cont': '2380',
 1125         'cp_phase_times:p2v_volinfo': '1101',
 1126         'cp_phase_times:p2v_bm': '3344',
 1127         'cp_phase_times:p2v_fsinfo': '1937',
 1128         'cp_phase_times:p2a_inofile': '356',
 1129         'cp_phase_times': '563,4844,1731,9676,469,0,821,763,1282,1937,0,359,'
 1130                           '418,1048,344,3344,4867,1397,1101,2380,356,1318,'
 1131                           '5954,9,2236,2190,228,476,1221,0,5838,696,515588,'
 1132                           '20542954,0,0,3122,10567367,20696,13982,36',
 1133         'cp_phase_times:p2v_dlog2': '359',
 1134         'instance-name': 'wafl',
 1135         'cp_phase_times:p3_wait': '0',
 1136         'cp_phase_times:p2a_bm': '5838',
 1137         'cp_phase_times:p1_quota': '469',
 1138         'cp_phase_times:p2v_inofile': '821',
 1139         'cp_phase_times:p2a_refcount': '476',
 1140         'cp_phase_times:p2a_fsinfo': '2190',
 1141         'cp_phase_times:p2a_hyabc': '0',
 1142         'cp_phase_times:p2a_volinfo': '515588',
 1143         'cp_phase_times:pre_p0': '4844',
 1144         'cp_phase_times:p2a_hya': '9',
 1145         'cp_phase_times:p0_snap_del': '1731',
 1146         'cp_phase_times:p2a_ino': '1318',
 1147         'cp_phase_times:p2v_df_scores_sub': '344',
 1148         'cp_phase_times:p2v_ino_pub': '763',
 1149         'cp_phase_times:p2a_ipu_bitmap_grow': '228',
 1150         'cp_phase_times:p2v_refcount': '418',
 1151         'timestamp': '1453523339',
 1152         'cp_phase_times:p2v_dlog1': '0',
 1153         'cp_phase_times:p2_finish': '0',
 1154         'cp_phase_times:p1_clean': '9676',
 1155         'node-name': 'cluster1-01',
 1156         'instance-uuid': 'cluster1-01:kernel:wafl',
 1157         'cp_phase_times:p3a_volinfo': '10567367',
 1158         'cp_phase_times:p2a_topaa': '1221',
 1159         'cp_phase_times:p2_flush': '20542954',
 1160         'cp_phase_times:p2v_df_scores': '1397',
 1161         'cp_phase_times:ipu_disk_add': '0',
 1162         'cp_phase_times:p2v_snap': '4867',
 1163         'cp_phase_times:p5_finish': '36',
 1164         'cp_phase_times:p2v_ino_pri': '1282',
 1165         'cp_phase_times:p3v_volinfo': '3122',
 1166         'cp_phase_times:p2v_topaa': '1048',
 1167         'cp_phase_times:p3_finish': '20696',
 1168     }, {
 1169         'node-name': 'cluster1-01',
 1170         'instance-uuid': 'cluster1-01:kernel:wafl',
 1171         'total_cp_msecs': '31721222',
 1172         'instance-name': 'wafl',
 1173         'timestamp': '1453523339',
 1174     },
 1175 ]
 1176 
 1177 PROCESSOR_INSTANCE_UUIDS = [
 1178     'cluster1-01:kernel:processor0',
 1179     'cluster1-01:kernel:processor1',
 1180 ]
 1181 PROCESSOR_INSTANCE_NAMES = ['processor0', 'processor1']
 1182 
 1183 PROCESSOR_COUNTERS = [
 1184     {
 1185         'node-name': 'cluster1-01',
 1186         'instance-uuid': 'cluster1-01:kernel:processor0',
 1187         'domain_busy': '980648687811,2597164534,2155400686,5443901498,'
 1188                        '690280568,28,6180773,59,413895,1190100947,48989575,'
 1189                        '58549809,34,54,11,20,5024141791,13136260754,452215',
 1190         'instance-name': 'processor0',
 1191         'timestamp': '1453524150',
 1192     }, {
 1193         'node-name': 'cluster1-01',
 1194         'instance-uuid': 'cluster1-01:kernel:processor0',
 1195         'processor_elapsed_time': '1013660714257',
 1196         'instance-name': 'processor0',
 1197         'timestamp': '1453524150',
 1198     }, {
 1199         'node-name': 'cluster1-01',
 1200         'instance-uuid': 'cluster1-01:kernel:processor1',
 1201         'domain_busy': '990957980543,1891766637,1433411516,3572427934,'
 1202                        '691372324,0,3188648,0,305947,1211235777,47954620,'
 1203                        '34832715,0,0,0,0,2692084482,9834648927,393451',
 1204         'instance-name': 'processor1',
 1205         'timestamp': '1453524150',
 1206     }, {
 1207         'node-name': 'cluster1-01',
 1208         'instance-uuid': 'cluster1-01:kernel:processor1',
 1209         'processor_elapsed_time': '1013660714261',
 1210         'instance-name': 'processor1',
 1211         'timestamp': '1453524150',
 1212     },
 1213 ]
 1214 
 1215 PROCESSOR_DOMAIN_BUSY_COUNTER_INFO = {
 1216     'labels': [
 1217         'idle', 'kahuna', 'storage', 'exempt', 'raid', 'raid_exempt',
 1218         'target', 'dnscache', 'cifs', 'wafl_exempt', 'wafl_xcleaner',
 1219         'sm_exempt', 'cluster', 'protocol', 'nwk_exclusive', 'nwk_exempt',
 1220         'nwk_legacy', 'hostOS', 'ssan_exempt',
 1221     ],
 1222     'name': 'domain_busy',
 1223 }
 1224 
 1225 EXPANDED_PROCESSOR_COUNTERS = [
 1226     {
 1227         'domain_busy:kahuna': '2597164534',
 1228         'timestamp': '1453524150',
 1229         'domain_busy:cifs': '413895',
 1230         'domain_busy:raid_exempt': '28',
 1231         'node-name': 'cluster1-01',
 1232         'instance-uuid': 'cluster1-01:kernel:processor0',
 1233         'domain_busy:target': '6180773',
 1234         'domain_busy:nwk_exempt': '20',
 1235         'domain_busy:raid': '690280568',
 1236         'domain_busy:storage': '2155400686',
 1237         'instance-name': 'processor0',
 1238         'domain_busy:cluster': '34',
 1239         'domain_busy:wafl_xcleaner': '48989575',
 1240         'domain_busy:wafl_exempt': '1190100947',
 1241         'domain_busy:protocol': '54',
 1242         'domain_busy': '980648687811,2597164534,2155400686,5443901498,'
 1243                        '690280568,28,6180773,59,413895,1190100947,48989575,'
 1244                        '58549809,34,54,11,20,5024141791,13136260754,452215',
 1245         'domain_busy:nwk_legacy': '5024141791',
 1246         'domain_busy:dnscache': '59',
 1247         'domain_busy:exempt': '5443901498',
 1248         'domain_busy:hostos': '13136260754',
 1249         'domain_busy:sm_exempt': '58549809',
 1250         'domain_busy:nwk_exclusive': '11',
 1251         'domain_busy:idle': '980648687811',
 1252         'domain_busy:ssan_exempt': '452215',
 1253     }, {
 1254         'node-name': 'cluster1-01',
 1255         'instance-uuid': 'cluster1-01:kernel:processor0',
 1256         'processor_elapsed_time': '1013660714257',
 1257         'instance-name': 'processor0',
 1258         'timestamp': '1453524150',
 1259     }, {
 1260         'domain_busy:kahuna': '1891766637',
 1261         'timestamp': '1453524150',
 1262         'domain_busy:cifs': '305947',
 1263         'domain_busy:raid_exempt': '0',
 1264         'node-name': 'cluster1-01',
 1265         'instance-uuid': 'cluster1-01:kernel:processor1',
 1266         'domain_busy:target': '3188648',
 1267         'domain_busy:nwk_exempt': '0',
 1268         'domain_busy:raid': '691372324',
 1269         'domain_busy:storage': '1433411516',
 1270         'instance-name': 'processor1',
 1271         'domain_busy:cluster': '0',
 1272         'domain_busy:wafl_xcleaner': '47954620',
 1273         'domain_busy:wafl_exempt': '1211235777',
 1274         'domain_busy:protocol': '0',
 1275         'domain_busy': '990957980543,1891766637,1433411516,3572427934,'
 1276                        '691372324,0,3188648,0,305947,1211235777,47954620,'
 1277                        '34832715,0,0,0,0,2692084482,9834648927,393451',
 1278         'domain_busy:nwk_legacy': '2692084482',
 1279         'domain_busy:dnscache': '0',
 1280         'domain_busy:exempt': '3572427934',
 1281         'domain_busy:hostos': '9834648927',
 1282         'domain_busy:sm_exempt': '34832715',
 1283         'domain_busy:nwk_exclusive': '0',
 1284         'domain_busy:idle': '990957980543',
 1285         'domain_busy:ssan_exempt': '393451',
 1286     }, {
 1287         'node-name': 'cluster1-01',
 1288         'instance-uuid': 'cluster1-01:kernel:processor1',
 1289         'processor_elapsed_time': '1013660714261',
 1290         'instance-name': 'processor1',
 1291         'timestamp': '1453524150',
 1292     },
 1293 ]
 1294 
 1295 
 1296 def get_config_cmode():
 1297     config = na_fakes.create_configuration_cmode()
 1298     config.local_conf.set_override('share_backend_name', BACKEND_NAME)
 1299     config.reserved_share_percentage = 5
 1300     config.netapp_login = CLIENT_KWARGS['username']
 1301     config.netapp_password = CLIENT_KWARGS['password']
 1302     config.netapp_server_hostname = CLIENT_KWARGS['hostname']
 1303     config.netapp_transport_type = CLIENT_KWARGS['transport_type']
 1304     config.netapp_server_port = CLIENT_KWARGS['port']
 1305     config.netapp_volume_name_template = VOLUME_NAME_TEMPLATE
 1306     config.netapp_aggregate_name_search_pattern = AGGREGATE_NAME_SEARCH_PATTERN
 1307     config.netapp_vserver_name_template = VSERVER_NAME_TEMPLATE
 1308     config.netapp_root_volume_aggregate = ROOT_VOLUME_AGGREGATE
 1309     config.netapp_root_volume = ROOT_VOLUME
 1310     config.netapp_lif_name_template = LIF_NAME_TEMPLATE
 1311     config.netapp_volume_snapshot_reserve_percent = 8
 1312     config.netapp_vserver = VSERVER1
 1313     return config
 1314 
 1315 
 1316 def get_network_info(user_network_allocation, admin_network_allocation):
 1317     net_info = copy.deepcopy(NETWORK_INFO)
 1318     net_info['network_allocations'] = user_network_allocation
 1319     net_info['admin_network_allocations'] = admin_network_allocation
 1320 
 1321     return net_info