mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix imports, part 2 (#42)
* Recover missing netapp.ontap module doc fragments from ansible/ansible@pre-ansible-base. * Fix PEP8 issues. * Remove netbox empty files, and test which shouldn't be here. * Add forgotten file for kubevirt tests. * Fix unit test imports. * ansible/ansible#68415 has been fixed. * Clean up/rearrange imports. * Update ignore.txt, fix boilerplate. * Netapp docs fragment: fix spacing * Forgot to adjust kubevirt tests.
This commit is contained in:
parent
25394eeafb
commit
07ecfc940c
118 changed files with 486 additions and 423 deletions
114
plugins/doc_fragments/netapp.py
Normal file
114
plugins/doc_fragments/netapp.py
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright: (c) 2018, Sumit Kumar <sumit4@netapp.com>, chris Archibald <carchi@netapp.com>
|
||||||
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
|
class ModuleDocFragment(object):
|
||||||
|
|
||||||
|
DOCUMENTATION = r'''
|
||||||
|
options:
|
||||||
|
- See respective platform section for more details
|
||||||
|
requirements:
|
||||||
|
- See respective platform section for more details
|
||||||
|
notes:
|
||||||
|
- Ansible modules are available for the following NetApp Storage Platforms: E-Series, ONTAP, SolidFire
|
||||||
|
'''
|
||||||
|
|
||||||
|
# Documentation fragment for ONTAP (na_cdot)
|
||||||
|
ONTAP = r'''
|
||||||
|
options:
|
||||||
|
hostname:
|
||||||
|
required: true
|
||||||
|
description:
|
||||||
|
- The hostname or IP address of the ONTAP instance.
|
||||||
|
username:
|
||||||
|
required: true
|
||||||
|
description:
|
||||||
|
- This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required.
|
||||||
|
For more information, please read the documentation U(https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/).
|
||||||
|
aliases: ['user']
|
||||||
|
password:
|
||||||
|
required: true
|
||||||
|
description:
|
||||||
|
- Password for the specified user.
|
||||||
|
aliases: ['pass']
|
||||||
|
requirements:
|
||||||
|
- A physical or virtual clustered Data ONTAP system. The modules were developed with Clustered Data ONTAP 8.3
|
||||||
|
- Ansible 2.2
|
||||||
|
- netapp-lib (2015.9.25). Install using 'pip install netapp-lib'
|
||||||
|
|
||||||
|
notes:
|
||||||
|
- The modules prefixed with na\\_cdot are built to support the ONTAP storage platform.
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
# Documentation fragment for SolidFire
|
||||||
|
SOLIDFIRE = r'''
|
||||||
|
options:
|
||||||
|
hostname:
|
||||||
|
required: true
|
||||||
|
description:
|
||||||
|
- The hostname or IP address of the SolidFire cluster.
|
||||||
|
username:
|
||||||
|
required: true
|
||||||
|
description:
|
||||||
|
- Please ensure that the user has the adequate permissions. For more information, please read the official documentation
|
||||||
|
U(https://mysupport.netapp.com/documentation/docweb/index.html?productID=62636&language=en-US).
|
||||||
|
aliases: ['user']
|
||||||
|
password:
|
||||||
|
required: true
|
||||||
|
description:
|
||||||
|
- Password for the specified user.
|
||||||
|
aliases: ['pass']
|
||||||
|
|
||||||
|
requirements:
|
||||||
|
- The modules were developed with SolidFire 10.1
|
||||||
|
- solidfire-sdk-python (1.1.0.92) or greater. Install using 'pip install solidfire-sdk-python'
|
||||||
|
|
||||||
|
notes:
|
||||||
|
- The modules prefixed with na\\_elementsw are built to support the SolidFire storage platform.
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
# Documentation fragment for E-Series
|
||||||
|
ESERIES = r'''
|
||||||
|
options:
|
||||||
|
api_username:
|
||||||
|
required: true
|
||||||
|
type: str
|
||||||
|
description:
|
||||||
|
- The username to authenticate with the SANtricity Web Services Proxy or Embedded Web Services API.
|
||||||
|
api_password:
|
||||||
|
required: true
|
||||||
|
type: str
|
||||||
|
description:
|
||||||
|
- The password to authenticate with the SANtricity Web Services Proxy or Embedded Web Services API.
|
||||||
|
api_url:
|
||||||
|
required: true
|
||||||
|
type: str
|
||||||
|
description:
|
||||||
|
- The url to the SANtricity Web Services Proxy or Embedded Web Services API.
|
||||||
|
Example https://prod-1.wahoo.acme.com/devmgr/v2
|
||||||
|
validate_certs:
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
description:
|
||||||
|
- Should https certificates be validated?
|
||||||
|
type: bool
|
||||||
|
ssid:
|
||||||
|
required: false
|
||||||
|
type: str
|
||||||
|
default: 1
|
||||||
|
description:
|
||||||
|
- The ID of the array to manage. This value must be unique for each array.
|
||||||
|
|
||||||
|
notes:
|
||||||
|
- The E-Series Ansible modules require either an instance of the Web Services Proxy (WSP), to be available to manage
|
||||||
|
the storage-system, or an E-Series storage-system that supports the Embedded Web Services API.
|
||||||
|
- Embedded Web Services is currently available on the E2800, E5700, EF570, and newer hardware models.
|
||||||
|
- M(netapp_e_storage_system) may be utilized for configuring the systems managed by a WSP instance.
|
||||||
|
'''
|
|
@ -443,9 +443,9 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.common.network import is_mac
|
from ansible.module_utils.common.network import is_mac
|
||||||
from ansible.module_utils import six
|
from ansible.module_utils import six
|
||||||
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref,
|
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref,
|
||||||
gather_vm_params, gather_vm_facts, set_vm_power_state, wait_for_vm_ip_address,
|
gather_vm_params, gather_vm_facts, set_vm_power_state,
|
||||||
is_valid_ip_addr, is_valid_ip_netmask, is_valid_ip_prefix,
|
wait_for_vm_ip_address, is_valid_ip_addr, is_valid_ip_netmask,
|
||||||
ip_prefix_to_netmask, ip_netmask_to_prefix,
|
is_valid_ip_prefix, ip_prefix_to_netmask, ip_netmask_to_prefix,
|
||||||
is_valid_ip6_addr, is_valid_ip6_prefix)
|
is_valid_ip6_addr, is_valid_ip6_prefix)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,8 @@ except ImportError:
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref,
|
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref,
|
||||||
gather_vm_params, gather_vm_facts, set_vm_power_state, wait_for_vm_ip_address)
|
gather_vm_params, gather_vm_facts, set_vm_power_state,
|
||||||
|
wait_for_vm_ip_address)
|
||||||
|
|
||||||
|
|
||||||
class XenServerVM(XenServerObject):
|
class XenServerVM(XenServerObject):
|
||||||
|
|
|
@ -96,8 +96,8 @@ content:
|
||||||
'''
|
'''
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure, axapi_get_port_protocol,
|
from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure,
|
||||||
axapi_enabled_disabled, AXAPI_PORT_PROTOCOLS)
|
axapi_get_port_protocol, axapi_enabled_disabled, AXAPI_PORT_PROTOCOLS)
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.urls import url_argument_spec
|
from ansible.module_utils.urls import url_argument_spec
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,8 @@ content:
|
||||||
'''
|
'''
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure, axapi_enabled_disabled)
|
from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate,
|
||||||
|
axapi_failure, axapi_enabled_disabled)
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.urls import url_argument_spec
|
from ansible.module_utils.urls import url_argument_spec
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,8 @@ content:
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure,
|
from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure,
|
||||||
axapi_enabled_disabled, axapi_get_vport_protocol, AXAPI_VPORT_PROTOCOLS)
|
axapi_enabled_disabled, axapi_get_vport_protocol,
|
||||||
|
AXAPI_VPORT_PROTOCOLS)
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.urls import url_argument_spec
|
from ansible.module_utils.urls import url_argument_spec
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,8 @@ diff:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, ensure_feature_is_enabled
|
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments,
|
||||||
|
log, loglines, ensure_feature_is_enabled)
|
||||||
try:
|
try:
|
||||||
from nssrc.com.citrix.netscaler.nitro.resource.config.cs.cspolicy import cspolicy
|
from nssrc.com.citrix.netscaler.nitro.resource.config.cs.cspolicy import cspolicy
|
||||||
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_exception
|
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_exception
|
||||||
|
|
|
@ -158,8 +158,10 @@ except ImportError as e:
|
||||||
PYTHON_SDK_IMPORTED = False
|
PYTHON_SDK_IMPORTED = False
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, \
|
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client,
|
||||||
get_immutables_intersection
|
netscaler_common_arguments,
|
||||||
|
log, loglines,
|
||||||
|
get_immutables_intersection)
|
||||||
|
|
||||||
|
|
||||||
def server_exists(client, module):
|
def server_exists(client, module):
|
||||||
|
|
|
@ -427,8 +427,8 @@ except ImportError as e:
|
||||||
PYTHON_SDK_IMPORTED = False
|
PYTHON_SDK_IMPORTED = False
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines,
|
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments,
|
||||||
get_immutables_intersection)
|
log, loglines, get_immutables_intersection)
|
||||||
|
|
||||||
|
|
||||||
def service_exists(client, module):
|
def service_exists(client, module):
|
||||||
|
|
|
@ -398,8 +398,8 @@ diff:
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, \
|
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments,
|
||||||
loglines, get_immutables_intersection
|
log, loglines, get_immutables_intersection)
|
||||||
try:
|
try:
|
||||||
from nssrc.com.citrix.netscaler.nitro.resource.config.basic.servicegroup import servicegroup
|
from nssrc.com.citrix.netscaler.nitro.resource.config.basic.servicegroup import servicegroup
|
||||||
from nssrc.com.citrix.netscaler.nitro.resource.config.basic.servicegroup_servicegroupmember_binding import servicegroup_servicegroupmember_binding
|
from nssrc.com.citrix.netscaler.nitro.resource.config.basic.servicegroup_servicegroupmember_binding import servicegroup_servicegroupmember_binding
|
||||||
|
|
|
@ -152,8 +152,8 @@ except ImportError as e:
|
||||||
PYTHON_SDK_IMPORTED = False
|
PYTHON_SDK_IMPORTED = False
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, \
|
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments,
|
||||||
get_immutables_intersection
|
log, loglines, get_immutables_intersection)
|
||||||
|
|
||||||
|
|
||||||
def key_exists(client, module):
|
def key_exists(client, module):
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_aggregate
|
||||||
|
|
||||||
short_description: Manage NetApp cDOT aggregates.
|
short_description: Manage NetApp cDOT aggregates.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_license
|
||||||
|
|
||||||
short_description: Manage NetApp cDOT protocol and feature licenses
|
short_description: Manage NetApp cDOT protocol and feature licenses
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_lun
|
||||||
|
|
||||||
short_description: Manage NetApp cDOT luns
|
short_description: Manage NetApp cDOT luns
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_qtree
|
||||||
|
|
||||||
short_description: Manage qtrees
|
short_description: Manage qtrees
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_svm
|
||||||
|
|
||||||
short_description: Manage NetApp cDOT svm
|
short_description: Manage NetApp cDOT svm
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_user
|
||||||
|
|
||||||
short_description: useradmin configuration and management
|
short_description: useradmin configuration and management
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_user_role
|
||||||
|
|
||||||
short_description: useradmin configuration and management
|
short_description: useradmin configuration and management
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ module: na_cdot_volume
|
||||||
|
|
||||||
short_description: Manage NetApp cDOT volumes
|
short_description: Manage NetApp cDOT volumes
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.na_ontap
|
- community.general.netapp.ontap
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ description:
|
||||||
- This module will allow the owner of the system to specify email recipients for these messages.
|
- This module will allow the owner of the system to specify email recipients for these messages.
|
||||||
author: Michael Price (@lmprice)
|
author: Michael Price (@lmprice)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Allows for the creation, removal and updating of Asynchronous Mirror Groups for NetApp E-series storage arrays
|
- Allows for the creation, removal and updating of Asynchronous Mirror Groups for NetApp E-series storage arrays
|
||||||
author: Kevin Hulquest (@hulquest)
|
author: Kevin Hulquest (@hulquest)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Allow the auto-support settings to be configured for an individual E-Series storage-system
|
- Allow the auto-support settings to be configured for an individual E-Series storage-system
|
||||||
author: Michael Price (@lmprice)
|
author: Michael Price (@lmprice)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- This module allows an e-series storage system owner to set audit-log configuration parameters.
|
- This module allows an e-series storage system owner to set audit-log configuration parameters.
|
||||||
author: Nathan Swartz (@ndswartz)
|
author: Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
max_records:
|
max_records:
|
||||||
|
|
|
@ -20,7 +20,7 @@ description:
|
||||||
author:
|
author:
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
firmware:
|
firmware:
|
||||||
|
|
|
@ -20,7 +20,7 @@ author:
|
||||||
- Kevin Hulquest (@hulquest)
|
- Kevin Hulquest (@hulquest)
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ description:
|
||||||
author:
|
author:
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
nvsram:
|
nvsram:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Allow the user to configure several of the global settings associated with an E-Series storage-system
|
- Allow the user to configure several of the global settings associated with an E-Series storage-system
|
||||||
author: Michael Price (@lmprice)
|
author: Michael Price (@lmprice)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
|
|
|
@ -20,7 +20,7 @@ author:
|
||||||
- Kevin Hulquest (@hulquest)
|
- Kevin Hulquest (@hulquest)
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
|
|
|
@ -22,7 +22,7 @@ author:
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
description: Create, update or destroy host groups on a NetApp E-Series storage array.
|
description: Create, update or destroy host groups on a NetApp E-Series storage array.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Configure settings of an E-Series iSCSI interface
|
- Configure settings of an E-Series iSCSI interface
|
||||||
author: Michael Price (@lmprice)
|
author: Michael Price (@lmprice)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
controller:
|
controller:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Configure the settings of an E-Series iSCSI target
|
- Configure the settings of an E-Series iSCSI target
|
||||||
author: Michael Price (@lmprice)
|
author: Michael Price (@lmprice)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Configure an E-Series system to allow authentication via an LDAP server
|
- Configure an E-Series system to allow authentication via an LDAP server
|
||||||
author: Michael Price (@lmprice)
|
author: Michael Price (@lmprice)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -21,7 +21,7 @@ short_description: NetApp E-Series create, delete, or modify lun mappings
|
||||||
description:
|
description:
|
||||||
- Create, delete, or modify mappings between a volume and a targeted host/host+ group.
|
- Create, delete, or modify mappings between a volume and a targeted host/host+ group.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -21,7 +21,7 @@ author:
|
||||||
- Michael Price (@lmprice)
|
- Michael Price (@lmprice)
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -20,7 +20,7 @@ author:
|
||||||
- Kevin Hulquest (@hulquest)
|
- Kevin Hulquest (@hulquest)
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -19,7 +19,7 @@ description:
|
||||||
- Allow the syslog settings to be configured for an individual E-Series storage-system
|
- Allow the syslog settings to be configured for an individual E-Series storage-system
|
||||||
author: Nathan Swartz (@ndswartz)
|
author: Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -21,7 +21,7 @@ author:
|
||||||
- Kevin Hulquest (@hulquest)
|
- Kevin Hulquest (@hulquest)
|
||||||
- Nathan Swartz (@ndswartz)
|
- Nathan Swartz (@ndswartz)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
|
|
@ -20,7 +20,7 @@ description:
|
||||||
- Create and delete snapshots images on volume groups for NetApp E-series storage arrays.
|
- Create and delete snapshots images on volume groups for NetApp E-series storage arrays.
|
||||||
author: Kevin Hulquest (@hulquest)
|
author: Kevin Hulquest (@hulquest)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.eseries
|
- community.general.netapp.eseries
|
||||||
|
|
||||||
options:
|
options:
|
||||||
api_username:
|
api_username:
|
||||||
|
|
|
@ -21,7 +21,7 @@ deprecated:
|
||||||
alternative: please use M(na_elementsw_account)
|
alternative: please use M(na_elementsw_account)
|
||||||
short_description: Manage SolidFire accounts
|
short_description: Manage SolidFire accounts
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.solidfire
|
- community.general.netapp.solidfire
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -21,7 +21,7 @@ deprecated:
|
||||||
alternative: please use M(na_elementsw_check_connections)
|
alternative: please use M(na_elementsw_check_connections)
|
||||||
short_description: Check connectivity to MVIP and SVIP.
|
short_description: Check connectivity to MVIP and SVIP.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.solidfire
|
- community.general.netapp.solidfire
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -20,7 +20,7 @@ deprecated:
|
||||||
alternative: please use M(na_elementsw_snapshot_schedule)
|
alternative: please use M(na_elementsw_snapshot_schedule)
|
||||||
short_description: Manage SolidFire snapshot schedules
|
short_description: Manage SolidFire snapshot schedules
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.solidfire
|
- community.general.netapp.solidfire
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -21,7 +21,7 @@ deprecated:
|
||||||
alternative: please use M(na_elementsw_access_group)
|
alternative: please use M(na_elementsw_access_group)
|
||||||
short_description: Manage SolidFire Volume Access Groups
|
short_description: Manage SolidFire Volume Access Groups
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.solidfire
|
- community.general.netapp.solidfire
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -21,7 +21,7 @@ deprecated:
|
||||||
alternative: please use M(na_elementsw_volume)
|
alternative: please use M(na_elementsw_volume)
|
||||||
short_description: Manage SolidFire volumes
|
short_description: Manage SolidFire volumes
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.ontap.netapp.solidfire
|
- community.general.netapp.solidfire
|
||||||
|
|
||||||
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
author: Sumit Kumar (@timuster) <sumit4@netapp.com>
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -3502,8 +3502,6 @@ tests/unit/module_utils/hwc/test_dict_comparison.py future-import-boilerplate
|
||||||
tests/unit/module_utils/hwc/test_dict_comparison.py metaclass-boilerplate
|
tests/unit/module_utils/hwc/test_dict_comparison.py metaclass-boilerplate
|
||||||
tests/unit/module_utils/hwc/test_hwc_utils.py future-import-boilerplate
|
tests/unit/module_utils/hwc/test_hwc_utils.py future-import-boilerplate
|
||||||
tests/unit/module_utils/hwc/test_hwc_utils.py metaclass-boilerplate
|
tests/unit/module_utils/hwc/test_hwc_utils.py metaclass-boilerplate
|
||||||
tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py future-import-boilerplate
|
|
||||||
tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py metaclass-boilerplate
|
|
||||||
tests/unit/module_utils/network/avi/test_avi_api_utils.py future-import-boilerplate
|
tests/unit/module_utils/network/avi/test_avi_api_utils.py future-import-boilerplate
|
||||||
tests/unit/module_utils/network/avi/test_avi_api_utils.py metaclass-boilerplate
|
tests/unit/module_utils/network/avi/test_avi_api_utils.py metaclass-boilerplate
|
||||||
tests/unit/module_utils/network/ftd/test_common.py future-import-boilerplate
|
tests/unit/module_utils/network/ftd/test_common.py future-import-boilerplate
|
||||||
|
|
|
@ -3539,8 +3539,6 @@ tests/unit/module_utils/hwc/test_dict_comparison.py future-import-boilerplate
|
||||||
tests/unit/module_utils/hwc/test_dict_comparison.py metaclass-boilerplate
|
tests/unit/module_utils/hwc/test_dict_comparison.py metaclass-boilerplate
|
||||||
tests/unit/module_utils/hwc/test_hwc_utils.py future-import-boilerplate
|
tests/unit/module_utils/hwc/test_hwc_utils.py future-import-boilerplate
|
||||||
tests/unit/module_utils/hwc/test_hwc_utils.py metaclass-boilerplate
|
tests/unit/module_utils/hwc/test_hwc_utils.py metaclass-boilerplate
|
||||||
tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py future-import-boilerplate
|
|
||||||
tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py metaclass-boilerplate
|
|
||||||
tests/unit/module_utils/network/avi/test_avi_api_utils.py future-import-boilerplate
|
tests/unit/module_utils/network/avi/test_avi_api_utils.py future-import-boilerplate
|
||||||
tests/unit/module_utils/network/avi/test_avi_api_utils.py metaclass-boilerplate
|
tests/unit/module_utils/network/avi/test_avi_api_utils.py metaclass-boilerplate
|
||||||
tests/unit/module_utils/network/ftd/test_common.py future-import-boilerplate
|
tests/unit/module_utils/network/ftd/test_common.py future-import-boilerplate
|
||||||
|
|
|
@ -1,152 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright: (c) 2019, Bruno Inec (@sweenu) <bruno@inec.fr>
|
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from ansible_collections.netbox.netbox.plugins.module_utils.net_tools.netbox.netbox_utils import (
|
|
||||||
QUERY_TYPES,
|
|
||||||
_build_diff,
|
|
||||||
create_netbox_object,
|
|
||||||
delete_netbox_object,
|
|
||||||
update_netbox_object,
|
|
||||||
normalize_data,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_normalize_data():
|
|
||||||
assert "name" not in QUERY_TYPES
|
|
||||||
assert QUERY_TYPES.get("rack") == "slug"
|
|
||||||
assert QUERY_TYPES.get("primary_ip") != "slug"
|
|
||||||
|
|
||||||
raw_data = {
|
|
||||||
"name": "Some name",
|
|
||||||
"primary_ip": "10.3.72.74/31",
|
|
||||||
"rack": "Some rack",
|
|
||||||
}
|
|
||||||
normalized_data = raw_data.copy()
|
|
||||||
normalized_data["rack"] = "some-rack"
|
|
||||||
|
|
||||||
assert normalize_data(raw_data) == normalized_data
|
|
||||||
|
|
||||||
|
|
||||||
def test_build_diff():
|
|
||||||
before = "The state before"
|
|
||||||
after = {"A": "more", "complicated": "state"}
|
|
||||||
diff = _build_diff(before=before, after=after)
|
|
||||||
assert diff == {"before": before, "after": after}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def nb_obj_mock(mocker):
|
|
||||||
serialized_object = {"The serialized": "object"}
|
|
||||||
nb_obj = mocker.Mock(name="nb_obj_mock")
|
|
||||||
nb_obj.delete.return_value = True
|
|
||||||
nb_obj.update.return_value = True
|
|
||||||
nb_obj.update.side_effect = serialized_object.update
|
|
||||||
nb_obj.serialize.return_value = serialized_object
|
|
||||||
|
|
||||||
return nb_obj
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def endpoint_mock(mocker, nb_obj_mock):
|
|
||||||
endpoint = mocker.Mock(name="endpoint_mock")
|
|
||||||
endpoint.create.return_value = nb_obj_mock
|
|
||||||
|
|
||||||
return endpoint
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def on_creation_diff():
|
|
||||||
return _build_diff(before={"state": "absent"}, after={"state": "present"})
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def on_deletion_diff():
|
|
||||||
return _build_diff(before={"state": "present"}, after={"state": "absent"})
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def data():
|
|
||||||
return {"name": "Some Netbox object name"}
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_netbox_object(endpoint_mock, data, on_creation_diff):
|
|
||||||
return_value = endpoint_mock.create().serialize()
|
|
||||||
|
|
||||||
serialized_obj, diff = create_netbox_object(
|
|
||||||
endpoint_mock, data, check_mode=False
|
|
||||||
)
|
|
||||||
assert endpoint_mock.create.called_once_with(data)
|
|
||||||
assert serialized_obj == return_value
|
|
||||||
assert diff == on_creation_diff
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_netbox_object_in_check_mode(endpoint_mock, data, on_creation_diff):
|
|
||||||
serialized_obj, diff = create_netbox_object(
|
|
||||||
endpoint_mock, data, check_mode=True
|
|
||||||
)
|
|
||||||
assert endpoint_mock.create.not_called()
|
|
||||||
assert serialized_obj == data
|
|
||||||
assert diff == on_creation_diff
|
|
||||||
|
|
||||||
|
|
||||||
def test_delete_netbox_object(nb_obj_mock, on_deletion_diff):
|
|
||||||
serialized_obj, diff = delete_netbox_object(nb_obj_mock, check_mode=False)
|
|
||||||
assert nb_obj_mock.delete.called_once()
|
|
||||||
assert serialized_obj == nb_obj_mock.serialize()
|
|
||||||
assert diff == on_deletion_diff
|
|
||||||
|
|
||||||
|
|
||||||
def test_delete_netbox_object_in_check_mode(nb_obj_mock, on_deletion_diff):
|
|
||||||
serialized_obj, diff = delete_netbox_object(nb_obj_mock, check_mode=True)
|
|
||||||
assert nb_obj_mock.delete.not_called()
|
|
||||||
assert serialized_obj == nb_obj_mock.serialize()
|
|
||||||
assert diff == on_deletion_diff
|
|
||||||
|
|
||||||
|
|
||||||
def test_update_netbox_object_no_changes(nb_obj_mock):
|
|
||||||
unchanged_data = nb_obj_mock.serialize()
|
|
||||||
serialized_obj, diff = update_netbox_object(nb_obj_mock, unchanged_data, check_mode=True)
|
|
||||||
assert nb_obj_mock.update.not_called()
|
|
||||||
assert serialized_obj == unchanged_data
|
|
||||||
assert diff is None
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def changed_serialized_obj(nb_obj_mock):
|
|
||||||
changed_serialized_obj = nb_obj_mock.serialize().copy()
|
|
||||||
changed_serialized_obj[list(changed_serialized_obj.keys())[0]] += " (modified)"
|
|
||||||
|
|
||||||
return changed_serialized_obj
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def on_update_diff(nb_obj_mock, changed_serialized_obj):
|
|
||||||
return _build_diff(before=nb_obj_mock.serialize().copy(), after=changed_serialized_obj)
|
|
||||||
|
|
||||||
|
|
||||||
def test_update_netbox_object_with_changes(
|
|
||||||
nb_obj_mock, changed_serialized_obj, on_update_diff
|
|
||||||
):
|
|
||||||
serialized_obj, diff = update_netbox_object(
|
|
||||||
nb_obj_mock, changed_serialized_obj, check_mode=False
|
|
||||||
)
|
|
||||||
assert nb_obj_mock.update.called_once_with(changed_serialized_obj)
|
|
||||||
assert serialized_obj == nb_obj_mock.serialize()
|
|
||||||
assert diff == on_update_diff
|
|
||||||
|
|
||||||
|
|
||||||
def test_update_netbox_object_with_changes_in_check_mode(
|
|
||||||
nb_obj_mock, changed_serialized_obj, on_update_diff
|
|
||||||
):
|
|
||||||
updated_serialized_obj = nb_obj_mock.serialize().copy()
|
|
||||||
updated_serialized_obj.update(changed_serialized_obj)
|
|
||||||
|
|
||||||
serialized_obj, diff = update_netbox_object(
|
|
||||||
nb_obj_mock, changed_serialized_obj, check_mode=True
|
|
||||||
)
|
|
||||||
assert nb_obj_mock.update.not_called()
|
|
||||||
|
|
||||||
assert serialized_obj == updated_serialized_obj
|
|
||||||
assert diff == on_update_diff
|
|
|
@ -9,7 +9,7 @@ __metaclass__ = type
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from ansible_collections.community.general.tests.unit.compat import unittest
|
from ansible_collections.community.general.tests.unit.compat import unittest
|
||||||
from ansible_collections.cisco.aci.plugins.module_utils.network.aci.aci import ACIModule
|
from ansible_collections.cisco.aci.plugins.module_utils.aci import ACIModule
|
||||||
from ansible.module_utils.six import PY2
|
from ansible.module_utils.six import PY2
|
||||||
from ansible.module_utils._text import to_native
|
from ansible.module_utils._text import to_native
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ from ansible_collections.community.general.tests.unit.compat import unittest
|
||||||
from ansible_collections.community.general.tests.unit.compat.mock import Mock
|
from ansible_collections.community.general.tests.unit.compat.mock import Mock
|
||||||
|
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_immutables_intersection, ensure_feature_is_enabled, log, loglines
|
from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_immutables_intersection,
|
||||||
|
ensure_feature_is_enabled, log, loglines)
|
||||||
|
|
||||||
|
|
||||||
class TestNetscalerConfigProxy(unittest.TestCase):
|
class TestNetscalerConfigProxy(unittest.TestCase):
|
||||||
|
|
73
tests/unit/modules/cloud/kubevirt/kubevirt_fixtures.py
Normal file
73
tests/unit/modules/cloud/kubevirt/kubevirt_fixtures.py
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from ansible_collections.community.general.tests.unit.compat.mock import MagicMock
|
||||||
|
|
||||||
|
from ansible_collections.community.kubernetes.plugins.module_utils.common import K8sAnsibleMixin
|
||||||
|
from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule
|
||||||
|
from ansible_collections.community.general.plugins.module_utils.kubevirt import KubeVirtRawModule
|
||||||
|
|
||||||
|
import openshift.dynamic
|
||||||
|
|
||||||
|
RESOURCE_DEFAULT_ARGS = {'api_version': 'v1alpha3', 'group': 'kubevirt.io',
|
||||||
|
'prefix': 'apis', 'namespaced': True}
|
||||||
|
|
||||||
|
|
||||||
|
class AnsibleExitJson(Exception):
|
||||||
|
"""Exception class to be raised by module.exit_json and caught
|
||||||
|
by the test case"""
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
for k in kwargs:
|
||||||
|
setattr(self, k, kwargs[k])
|
||||||
|
|
||||||
|
def __getitem__(self, attr):
|
||||||
|
return getattr(self, attr)
|
||||||
|
|
||||||
|
|
||||||
|
class AnsibleFailJson(Exception):
|
||||||
|
"""Exception class to be raised by module.fail_json and caught
|
||||||
|
by the test case"""
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
for k in kwargs:
|
||||||
|
setattr(self, k, kwargs[k])
|
||||||
|
|
||||||
|
def __getitem__(self, attr):
|
||||||
|
return getattr(self, attr)
|
||||||
|
|
||||||
|
|
||||||
|
def exit_json(*args, **kwargs):
|
||||||
|
kwargs['success'] = True
|
||||||
|
if 'changed' not in kwargs:
|
||||||
|
kwargs['changed'] = False
|
||||||
|
raise AnsibleExitJson(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def fail_json(*args, **kwargs):
|
||||||
|
kwargs['success'] = False
|
||||||
|
raise AnsibleFailJson(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def base_fixture(monkeypatch):
|
||||||
|
monkeypatch.setattr(
|
||||||
|
KubernetesRawModule, "exit_json", exit_json)
|
||||||
|
monkeypatch.setattr(
|
||||||
|
KubernetesRawModule, "fail_json", fail_json)
|
||||||
|
# Create mock methods in Resource directly, otherwise dyn client
|
||||||
|
# tries binding those to corresponding methods in DynamicClient
|
||||||
|
# (with partial()), which is more problematic to intercept
|
||||||
|
openshift.dynamic.Resource.get = MagicMock()
|
||||||
|
openshift.dynamic.Resource.create = MagicMock()
|
||||||
|
openshift.dynamic.Resource.delete = MagicMock()
|
||||||
|
openshift.dynamic.Resource.patch = MagicMock()
|
||||||
|
openshift.dynamic.Resource.search = MagicMock()
|
||||||
|
openshift.dynamic.Resource.watch = MagicMock()
|
||||||
|
# Globally mock some methods, since all tests will use this
|
||||||
|
KubernetesRawModule.patch_resource = MagicMock()
|
||||||
|
KubernetesRawModule.patch_resource.return_value = ({}, None)
|
||||||
|
K8sAnsibleMixin.get_api_client = MagicMock()
|
||||||
|
K8sAnsibleMixin.get_api_client.return_value = None
|
||||||
|
K8sAnsibleMixin.find_resource = MagicMock()
|
||||||
|
KubeVirtRawModule.find_supported_resource = MagicMock()
|
|
@ -3,9 +3,9 @@ import pytest
|
||||||
openshiftdynamic = pytest.importorskip("openshift.dynamic")
|
openshiftdynamic = pytest.importorskip("openshift.dynamic")
|
||||||
|
|
||||||
from ansible_collections.community.general.tests.unit.modules.utils import set_module_args
|
from ansible_collections.community.general.tests.unit.modules.utils import set_module_args
|
||||||
from ansible_collections.community.general.tests.unit.utils.kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson
|
from .kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson
|
||||||
|
|
||||||
from ansible_collections.community.kubernetes.plugins.module_utils.k8s.raw import KubernetesRawModule
|
from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule
|
||||||
from ansible_collections.community.general.plugins.modules.cloud.kubevirt import kubevirt_rs as mymodule
|
from ansible_collections.community.general.plugins.modules.cloud.kubevirt import kubevirt_rs as mymodule
|
||||||
|
|
||||||
KIND = 'VirtualMachineInstanceReplicaSet'
|
KIND = 'VirtualMachineInstanceReplicaSet'
|
||||||
|
|
|
@ -3,7 +3,7 @@ import pytest
|
||||||
openshiftdynamic = pytest.importorskip("openshift.dynamic")
|
openshiftdynamic = pytest.importorskip("openshift.dynamic")
|
||||||
|
|
||||||
from ansible_collections.community.general.tests.unit.modules.utils import set_module_args
|
from ansible_collections.community.general.tests.unit.modules.utils import set_module_args
|
||||||
from ansible_collections.community.general.tests.unit.utils.kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson
|
from .kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.kubevirt import KubeVirtRawModule
|
from ansible_collections.community.general.plugins.module_utils.kubevirt import KubeVirtRawModule
|
||||||
from ansible_collections.community.general.plugins.modules.cloud.kubevirt import kubevirt_vm as mymodule
|
from ansible_collections.community.general.plugins.modules.cloud.kubevirt import kubevirt_vm as mymodule
|
||||||
|
|
|
@ -130,9 +130,12 @@ testcase_module_params_wait = {
|
||||||
@pytest.mark.parametrize('power_state', testcase_set_powerstate['params'], ids=testcase_set_powerstate['ids'])
|
@pytest.mark.parametrize('power_state', testcase_set_powerstate['params'], ids=testcase_set_powerstate['ids'])
|
||||||
def test_xenserver_guest_powerstate_set_power_state(mocker, fake_ansible_module, XenAPI, xenserver_guest_powerstate, power_state):
|
def test_xenserver_guest_powerstate_set_power_state(mocker, fake_ansible_module, XenAPI, xenserver_guest_powerstate, power_state):
|
||||||
"""Tests power state change handling."""
|
"""Tests power state change handling."""
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM'))
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref',
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={"power_state": "Someoldstate"})
|
return_value=fake_xenapi_ref('VM'))
|
||||||
mocked_set_vm_power_state = mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state',
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params',
|
||||||
|
return_value={"power_state": "Someoldstate"})
|
||||||
|
mocked_set_vm_power_state = mocker.patch(
|
||||||
|
'ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state',
|
||||||
return_value=power_state)
|
return_value=power_state)
|
||||||
|
|
||||||
mocked_xenapi = mocker.patch.object(XenAPI.Session, 'xenapi', create=True)
|
mocked_xenapi = mocker.patch.object(XenAPI.Session, 'xenapi', create=True)
|
||||||
|
@ -171,12 +174,16 @@ def test_xenserver_guest_powerstate_present(mocker, patch_ansible_module, capfd,
|
||||||
"""
|
"""
|
||||||
fake_vm_facts = {"fake-vm-fact": True}
|
fake_vm_facts = {"fake-vm-fact": True}
|
||||||
|
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM'))
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref',
|
||||||
|
return_value=fake_xenapi_ref('VM'))
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={})
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={})
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts)
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts',
|
||||||
mocked_set_vm_power_state = mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state',
|
return_value=fake_vm_facts)
|
||||||
|
mocked_set_vm_power_state = mocker.patch(
|
||||||
|
'ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state',
|
||||||
return_value=(True, "somenewstate"))
|
return_value=(True, "somenewstate"))
|
||||||
mocked_wait_for_vm_ip_address = mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.wait_for_vm_ip_address',
|
mocked_wait_for_vm_ip_address = mocker.patch(
|
||||||
|
'ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.wait_for_vm_ip_address',
|
||||||
return_value={})
|
return_value={})
|
||||||
|
|
||||||
mocked_xenapi = mocker.patch.object(XenAPI.Session, 'xenapi', create=True)
|
mocked_xenapi = mocker.patch.object(XenAPI.Session, 'xenapi', create=True)
|
||||||
|
@ -214,7 +221,8 @@ def test_xenserver_guest_powerstate_other(mocker, patch_ansible_module, capfd, X
|
||||||
"""
|
"""
|
||||||
fake_vm_facts = {"fake-vm-fact": True}
|
fake_vm_facts = {"fake-vm-fact": True}
|
||||||
|
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM'))
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref',
|
||||||
|
return_value=fake_xenapi_ref('VM'))
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={})
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={})
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts)
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts)
|
||||||
mocked_set_vm_power_state = mocker.patch(
|
mocked_set_vm_power_state = mocker.patch(
|
||||||
|
@ -258,7 +266,8 @@ def test_xenserver_guest_powerstate_wait(mocker, patch_ansible_module, capfd, Xe
|
||||||
"""
|
"""
|
||||||
fake_vm_facts = {"fake-vm-fact": True}
|
fake_vm_facts = {"fake-vm-fact": True}
|
||||||
|
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM'))
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref',
|
||||||
|
return_value=fake_xenapi_ref('VM'))
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={})
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={})
|
||||||
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts)
|
mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts)
|
||||||
mocked_set_vm_power_state = mocker.patch(
|
mocked_set_vm_power_state = mocker.patch(
|
||||||
|
|
|
@ -39,7 +39,8 @@ class TestExosFactsModule(TestExosModule):
|
||||||
self.mock_run_commands = patch('ansible_collections.community.general.plugins.module_utils.network.exos.facts.legacy.base.run_commands')
|
self.mock_run_commands = patch('ansible_collections.community.general.plugins.module_utils.network.exos.facts.legacy.base.run_commands')
|
||||||
self.run_commands = self.mock_run_commands.start()
|
self.run_commands = self.mock_run_commands.start()
|
||||||
|
|
||||||
self.mock_get_resource_connection = patch('ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection')
|
self.mock_get_resource_connection = patch('ansible_collections.ansible.netcommon.plugins.module_utils.network.'
|
||||||
|
'common.facts.facts.get_resource_connection')
|
||||||
self.get_resource_connection = self.mock_get_resource_connection.start()
|
self.get_resource_connection = self.mock_get_resource_connection.start()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_discover_device(fixture_data, mocker):
|
def test_discover_device(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ def test_discover_device(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_add_device(fixture_data, mocker):
|
def test_add_device(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ def test_add_device(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_delete_device(fixture_data, mocker):
|
def test_delete_device(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ def test_delete_device(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_get_device(fixture_data, mocker):
|
def test_get_device(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_update_device_hostname(fixture_data, mocker):
|
def test_update_device_hostname(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ def test_update_device_hostname(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_update_device_interface(fixture_data, mocker):
|
def test_update_device_interface(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ def test_update_device_interface(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_exec_config(fixture_data, mocker):
|
def test_exec_config(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_add_device_group(fixture_data, mocker):
|
def test_add_device_group(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ def test_add_device_group(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_delete_device_group(fixture_data, mocker):
|
def test_delete_device_group(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ def test_delete_device_group(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_add_group_member(fixture_data, mocker):
|
def test_add_group_member(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ def test_add_group_member(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_delete_group_member(fixture_data, mocker):
|
def test_delete_group_member(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -63,7 +63,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_get_devprof(fixture_data, mocker):
|
def test_get_devprof(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -771,7 +771,7 @@ def test_get_devprof(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof(fixture_data, mocker):
|
def test_set_devprof(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -849,7 +849,7 @@ def test_set_devprof(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_scope(fixture_data, mocker):
|
def test_set_devprof_scope(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -927,7 +927,7 @@ def test_set_devprof_scope(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_snmp(fixture_data, mocker):
|
def test_set_devprof_snmp(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1145,7 +1145,7 @@ def test_set_devprof_snmp(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_snmp_v2c(fixture_data, mocker):
|
def test_set_devprof_snmp_v2c(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1223,7 +1223,7 @@ def test_set_devprof_snmp_v2c(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_snmp_v3(fixture_data, mocker):
|
def test_set_devprof_snmp_v3(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1301,7 +1301,7 @@ def test_set_devprof_snmp_v3(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_syslog(fixture_data, mocker):
|
def test_set_devprof_syslog(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1379,7 +1379,7 @@ def test_set_devprof_syslog(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_ntp(fixture_data, mocker):
|
def test_set_devprof_ntp(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1527,7 +1527,7 @@ def test_set_devprof_ntp(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_admin(fixture_data, mocker):
|
def test_set_devprof_admin(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1605,7 +1605,7 @@ def test_set_devprof_admin(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_smtp(fixture_data, mocker):
|
def test_set_devprof_smtp(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -1683,7 +1683,7 @@ def test_set_devprof_smtp(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_set_devprof_dns(fixture_data, mocker):
|
def test_set_devprof_dns(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_ipv4(fixture_data, mocker):
|
def test_fmgr_fwobj_ipv4(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
@ -121,7 +121,7 @@ def test_fmgr_fwobj_ipv4(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_ipv6(fixture_data, mocker):
|
def test_fmgr_fwobj_ipv6(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
@ -142,7 +142,7 @@ def test_fmgr_fwobj_ipv6(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_multicast(fixture_data, mocker):
|
def test_fmgr_fwobj_multicast(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_ippool_modify(fixture_data, mocker):
|
def test_fmgr_fwobj_ippool_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_ippool6_modify(fixture_data, mocker):
|
def test_fmgr_fwobj_ippool6_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_service_custom(fixture_data, mocker):
|
def test_fmgr_fwobj_service_custom(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
@ -103,7 +103,7 @@ def test_fmgr_fwobj_service_custom(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_service_group(fixture_data, mocker):
|
def test_fmgr_fwobj_service_group(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
@ -115,7 +115,7 @@ def test_fmgr_fwobj_service_group(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwobj_service_category(fixture_data, mocker):
|
def test_fmgr_fwobj_service_category(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_firewall_vip_modify(fixture_data, mocker):
|
def test_fmgr_firewall_vip_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_firewall_policy_modify(fixture_data, mocker):
|
def test_fmgr_firewall_policy_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -62,7 +62,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwpol_package(fixture_data, mocker):
|
def test_fmgr_fwpol_package(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
@ -80,7 +80,7 @@ def test_fmgr_fwpol_package(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_fwpol_package_folder(fixture_data, mocker):
|
def test_fmgr_fwpol_package_folder(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_set_ha_mode(fixture_data, mocker):
|
def test_fmgr_set_ha_mode(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ def test_fmgr_set_ha_mode(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_get_ha_peer_list(fixture_data, mocker):
|
def test_fmgr_get_ha_peer_list(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ def test_fmgr_get_ha_peer_list(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_set_ha_peer(fixture_data, mocker):
|
def test_fmgr_set_ha_peer(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_get_custom(fixture_data, mocker):
|
def test_fmgr_get_custom(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ def test_fmgr_get_custom(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_get_task_status(fixture_data, mocker):
|
def test_fmgr_get_task_status(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_set_script(fixture_data, mocker):
|
def test_set_script(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ def test_set_script(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_delete_script(fixture_data, mocker):
|
def test_delete_script(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ def test_delete_script(fixture_data, mocker):
|
||||||
|
|
||||||
|
|
||||||
def test_execute_script(fixture_data, mocker):
|
def test_execute_script(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_application_list_modify(fixture_data, mocker):
|
def test_fmgr_application_list_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_antivirus_profile_modify(fixture_data, mocker):
|
def test_fmgr_antivirus_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_dnsfilter_profile_modify(fixture_data, mocker):
|
def test_fmgr_dnsfilter_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_ips_sensor_modify(fixture_data, mocker):
|
def test_fmgr_ips_sensor_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_firewall_profile_group_modify(fixture_data, mocker):
|
def test_fmgr_firewall_profile_group_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
# Fixture sets used:###########################
|
# Fixture sets used:###########################
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_web_proxy_profile_modify(fixture_data, mocker):
|
def test_fmgr_web_proxy_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_spamfilter_profile_modify(fixture_data, mocker):
|
def test_fmgr_spamfilter_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_firewall_ssl_ssh_profile_modify(fixture_data, mocker):
|
def test_fmgr_firewall_ssl_ssh_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
output = fmgr_secprof_ssl_ssh.fmgr_firewall_ssl_ssh_profile_modify(fmg_instance, fixture_data[0]['paramgram_used'])
|
output = fmgr_secprof_ssl_ssh.fmgr_firewall_ssl_ssh_profile_modify(fmg_instance, fixture_data[0]['paramgram_used'])
|
||||||
assert output['raw_response']['status']['code'] == 0
|
assert output['raw_response']['status']['code'] == 0
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_voip_profile_modify(fixture_data, mocker):
|
def test_fmgr_voip_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_waf_profile_modify(fixture_data, mocker):
|
def test_fmgr_waf_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
output = fmgr_secprof_waf.fmgr_waf_profile_modify(fmg_instance, fixture_data[0]['paramgram_used'])
|
output = fmgr_secprof_waf.fmgr_waf_profile_modify(fmg_instance, fixture_data[0]['paramgram_used'])
|
||||||
assert output['raw_response']['status']['code'] == 0
|
assert output['raw_response']['status']['code'] == 0
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_wanopt_profile_modify(fixture_data, mocker):
|
def test_fmgr_wanopt_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
|
|
||||||
# Test using fixture 1 #
|
# Test using fixture 1 #
|
||||||
|
|
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler
|
from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock)
|
||||||
|
|
||||||
|
|
||||||
def test_fmgr_webfilter_profile_modify(fixture_data, mocker):
|
def test_fmgr_webfilter_profile_modify(fixture_data, mocker):
|
||||||
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request',
|
||||||
side_effect=fixture_data)
|
side_effect=fixture_data)
|
||||||
output = fmgr_secprof_web.fmgr_webfilter_profile_modify(fmg_instance, fixture_data[0]['paramgram_used'])
|
output = fmgr_secprof_web.fmgr_webfilter_profile_modify(fmg_instance, fixture_data[0]['paramgram_used'])
|
||||||
assert output['raw_response']['status']['code'] == 0
|
assert output['raw_response']['status']['code'] == 0
|
||||||
|
|
|
@ -215,7 +215,8 @@ class TestNetscalerNitroRequestModule(TestModule):
|
||||||
nitro_auth_token='##DDASKLFDJ',
|
nitro_auth_token='##DDASKLFDJ',
|
||||||
))
|
))
|
||||||
module_mock = Mock(params=args, from_json=json.loads)
|
module_mock = Mock(params=args, from_json=json.loads)
|
||||||
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)):
|
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule',
|
||||||
|
Mock(return_value=module_mock)):
|
||||||
with tempfile.TemporaryFile() as r:
|
with tempfile.TemporaryFile() as r:
|
||||||
actual_body = {
|
actual_body = {
|
||||||
'errorcode': 258,
|
'errorcode': 258,
|
||||||
|
@ -252,7 +253,8 @@ class TestNetscalerNitroRequestModule(TestModule):
|
||||||
nitro_auth_token='##DDASKLFDJ',
|
nitro_auth_token='##DDASKLFDJ',
|
||||||
))
|
))
|
||||||
module_mock = Mock(params=args, from_json=json.loads)
|
module_mock = Mock(params=args, from_json=json.loads)
|
||||||
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)):
|
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule',
|
||||||
|
Mock(return_value=module_mock)):
|
||||||
with tempfile.TemporaryFile() as r:
|
with tempfile.TemporaryFile() as r:
|
||||||
actual_body = {}
|
actual_body = {}
|
||||||
r.write(codecs.encode(json.dumps(actual_body), 'utf-8'))
|
r.write(codecs.encode(json.dumps(actual_body), 'utf-8'))
|
||||||
|
@ -283,7 +285,8 @@ class TestNetscalerNitroRequestModule(TestModule):
|
||||||
nitro_pass='nsroot',
|
nitro_pass='nsroot',
|
||||||
))
|
))
|
||||||
module_mock = Mock(params=args, from_json=json.loads)
|
module_mock = Mock(params=args, from_json=json.loads)
|
||||||
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)):
|
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule',
|
||||||
|
Mock(return_value=module_mock)):
|
||||||
body = {
|
body = {
|
||||||
'errorcode': 258,
|
'errorcode': 258,
|
||||||
'message': 'Numerical error 258',
|
'message': 'Numerical error 258',
|
||||||
|
@ -324,7 +327,8 @@ class TestNetscalerNitroRequestModule(TestModule):
|
||||||
'property2': 'value2',
|
'property2': 'value2',
|
||||||
}
|
}
|
||||||
module_mock = Mock(params=args, from_json=json.loads)
|
module_mock = Mock(params=args, from_json=json.loads)
|
||||||
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)):
|
with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule',
|
||||||
|
Mock(return_value=module_mock)):
|
||||||
instance = netscaler_nitro_request.NitroAPICaller()
|
instance = netscaler_nitro_request.NitroAPICaller()
|
||||||
|
|
||||||
data = {resource: resource_data}
|
data = {resource: resource_data}
|
||||||
|
|
|
@ -49,13 +49,17 @@ class TestOmeDeviceInfo(object):
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def get_device_identifier_map_mock(self, mocker):
|
def get_device_identifier_map_mock(self, mocker):
|
||||||
response_class_mock = mocker.patch('ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_identifier_map')
|
response_class_mock = mocker.patch(
|
||||||
|
'ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_identifier_map'
|
||||||
|
)
|
||||||
response_class_mock.return_value = resource_detailed_inventory
|
response_class_mock.return_value = resource_detailed_inventory
|
||||||
return response_class_mock.return_value
|
return response_class_mock.return_value
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def get_resource_parameters_mock(self, mocker):
|
def get_resource_parameters_mock(self, mocker):
|
||||||
response_class_mock = mocker.patch('ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_resource_parameters')
|
response_class_mock = mocker.patch(
|
||||||
|
'ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_resource_parameters'
|
||||||
|
)
|
||||||
return response_class_mock
|
return response_class_mock
|
||||||
|
|
||||||
def test_main_basic_inventory_success_case(self, module_mock, validate_inputs_mock, connection_mock, get_resource_parameters_mock, response_mock):
|
def test_main_basic_inventory_success_case(self, module_mock, validate_inputs_mock, connection_mock, get_resource_parameters_mock, response_mock):
|
||||||
|
@ -143,7 +147,9 @@ class TestOmeDeviceInfo(object):
|
||||||
|
|
||||||
@pytest.mark.parametrize("module_params", params)
|
@pytest.mark.parametrize("module_params", params)
|
||||||
def test_get_device_identifier_map(self, module_params, connection_mock, mocker):
|
def test_get_device_identifier_map(self, module_params, connection_mock, mocker):
|
||||||
get_device_id_from_service_tags_mock = mocker.patch('ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_id_from_service_tags')
|
get_device_id_from_service_tags_mock = mocker.patch(
|
||||||
|
'ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_id_from_service_tags'
|
||||||
|
)
|
||||||
get_device_id_from_service_tags_mock.return_value = None
|
get_device_id_from_service_tags_mock.return_value = None
|
||||||
res = self.module._get_device_identifier_map(module_params, connection_mock)
|
res = self.module._get_device_identifier_map(module_params, connection_mock)
|
||||||
assert isinstance(res, dict)
|
assert isinstance(res, dict)
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
from ansible_collections.community.general.tests.unit.compat import unittest
|
from ansible_collections.community.general.tests.unit.compat import unittest
|
||||||
from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_logical_interconnect_group_info import LogicalInterconnectGroupInfoModule
|
from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_logical_interconnect_group_info import (
|
||||||
|
LogicalInterconnectGroupInfoModule
|
||||||
|
)
|
||||||
from .hpe_test_utils import FactsParamsTestCase
|
from .hpe_test_utils import FactsParamsTestCase
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,8 @@ class TestInterfacesFileModule(unittest.TestCase):
|
||||||
fail_json_iterations = []
|
fail_json_iterations = []
|
||||||
for i, options in enumerate(options_list):
|
for i, options in enumerate(options_list):
|
||||||
try:
|
try:
|
||||||
dummy, lines = interfaces_file.setInterfaceOption(module, lines, options['iface'], options['option'], options['value'], options['state'])
|
dummy, lines = interfaces_file.setInterfaceOption(module, lines, options['iface'], options['option'],
|
||||||
|
options['value'], options['state'])
|
||||||
except AnsibleFailJson as e:
|
except AnsibleFailJson as e:
|
||||||
fail_json_iterations.append("[%d] fail_json message: %s\noptions:\n%s" %
|
fail_json_iterations.append("[%d] fail_json message: %s\noptions:\n%s" %
|
||||||
(i, str(e), json.dumps(options, sort_keys=True, indent=4, separators=(',', ': '))))
|
(i, str(e), json.dumps(options, sort_keys=True, indent=4, separators=(',', ': '))))
|
||||||
|
|
|
@ -41,21 +41,27 @@ class TestDockerConnectionClass(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', return_value=('false', 'garbage', '', 1))
|
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version',
|
||||||
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', return_value=('docker version', '1.2.3', '', 0))
|
return_value=('false', 'garbage', '', 1))
|
||||||
|
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version',
|
||||||
|
return_value=('docker version', '1.2.3', '', 0))
|
||||||
def test_docker_connection_module_too_old(self, mock_new_docker_verison, mock_old_docker_version):
|
def test_docker_connection_module_too_old(self, mock_new_docker_verison, mock_old_docker_version):
|
||||||
self.assertRaisesRegexp(AnsibleError, '^docker connection type requires docker 1.3 or higher$',
|
self.assertRaisesRegexp(AnsibleError, '^docker connection type requires docker 1.3 or higher$',
|
||||||
DockerConnection, self.play_context, self.in_stream, docker_command='/fake/docker')
|
DockerConnection, self.play_context, self.in_stream, docker_command='/fake/docker')
|
||||||
|
|
||||||
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', return_value=('false', 'garbage', '', 1))
|
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version',
|
||||||
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', return_value=('docker version', '1.3.4', '', 0))
|
return_value=('false', 'garbage', '', 1))
|
||||||
|
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version',
|
||||||
|
return_value=('docker version', '1.3.4', '', 0))
|
||||||
def test_docker_connection_module(self, mock_new_docker_verison, mock_old_docker_version):
|
def test_docker_connection_module(self, mock_new_docker_verison, mock_old_docker_version):
|
||||||
self.assertIsInstance(DockerConnection(self.play_context, self.in_stream, docker_command='/fake/docker'),
|
self.assertIsInstance(DockerConnection(self.play_context, self.in_stream, docker_command='/fake/docker'),
|
||||||
DockerConnection)
|
DockerConnection)
|
||||||
|
|
||||||
# old version and new version fail
|
# old version and new version fail
|
||||||
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', return_value=('false', 'garbage', '', 1))
|
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version',
|
||||||
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', return_value=('false', 'garbage', '', 1))
|
return_value=('false', 'garbage', '', 1))
|
||||||
|
@mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version',
|
||||||
|
return_value=('false', 'garbage', '', 1))
|
||||||
def test_docker_connection_module_wrong_cmd(self, mock_new_docker_version, mock_old_docker_version):
|
def test_docker_connection_module_wrong_cmd(self, mock_new_docker_version, mock_old_docker_version):
|
||||||
self.assertRaisesRegexp(AnsibleError, '^Docker version check (.*?) failed: ',
|
self.assertRaisesRegexp(AnsibleError, '^Docker version check (.*?) failed: ',
|
||||||
DockerConnection, self.play_context, self.in_stream, docker_command='/fake/docker')
|
DockerConnection, self.play_context, self.in_stream, docker_command='/fake/docker')
|
||||||
|
|
|
@ -43,24 +43,20 @@ ansible-galaxy -vvv collection install ansible.posix
|
||||||
ansible-galaxy -vvv collection install community.crypto
|
ansible-galaxy -vvv collection install community.crypto
|
||||||
ansible-galaxy -vvv collection install ansible.netcommon
|
ansible-galaxy -vvv collection install ansible.netcommon
|
||||||
ansible-galaxy -vvv collection install ovirt.ovirt_collection
|
ansible-galaxy -vvv collection install ovirt.ovirt_collection
|
||||||
|
|
||||||
# unit tests
|
|
||||||
ansible-galaxy -vvv collection install community.kubernetes
|
|
||||||
ansible-galaxy -vvv collection install netbox.netbox
|
|
||||||
ansible-galaxy -vvv collection install netapp.ontap
|
|
||||||
ansible-galaxy -vvv collection install cisco.mso
|
ansible-galaxy -vvv collection install cisco.mso
|
||||||
ansible-galaxy -vvv collection install cisco.meraki
|
|
||||||
ansible-galaxy -vvv collection install cisco.intersight
|
ansible-galaxy -vvv collection install cisco.intersight
|
||||||
ansible-galaxy -vvv collection install fortinet.fortios
|
ansible-galaxy -vvv collection install check_point.mgmt
|
||||||
ansible-galaxy -vvv collection install junipernetworks.junos
|
|
||||||
ansible-galaxy -vvv collection install cisco.aci
|
|
||||||
ansible-galaxy -vvv collection install google.cloud
|
|
||||||
ansible-galaxy -vvv collection install community.kubernetes
|
ansible-galaxy -vvv collection install community.kubernetes
|
||||||
ansible-galaxy -vvv collection install f5networks.f5_modules
|
ansible-galaxy -vvv collection install f5networks.f5_modules
|
||||||
ansible-galaxy -vvv collection install check_point.mgmt
|
ansible-galaxy -vvv collection install fortinet.fortios
|
||||||
|
ansible-galaxy -vvv collection install cisco.aci
|
||||||
|
ansible-galaxy -vvv collection install google.cloud
|
||||||
|
ansible-galaxy -vvv collection install netapp.ontap
|
||||||
|
|
||||||
|
# unit tests
|
||||||
|
ansible-galaxy -vvv collection install cisco.meraki
|
||||||
|
ansible-galaxy -vvv collection install junipernetworks.junos
|
||||||
|
|
||||||
# Needed until https://github.com/ansible/ansible/issues/68415 is fixed:
|
|
||||||
chmod -R a+rX "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections"
|
|
||||||
# END: HACK
|
# END: HACK
|
||||||
|
|
||||||
export PYTHONIOENCODING='utf-8'
|
export PYTHONIOENCODING='utf-8'
|
||||||
|
|
Loading…
Reference in a new issue