Fortinet FortiManager IPv4 Policy Module (#47638)

* Needs unit test fix -- the "delete" calls a GET command and another function to get policy ID of a firewall policy before deleting it. Nested functions like this, where a GET occurs to determine a new call, breaks the unitTestGen output. Need to figure out what's going on, and adjust the generator.

* PR Candidate

* PR Candidate (fixes)

* Reverting

* Fixing Edits.

* Fixing Authors - Fixing Requested Changes
This commit is contained in:
ftntcorecse 2018-11-20 22:44:47 -07:00 committed by Nilashish Chakraborty
parent 1f1c1a0a16
commit 37e932c4ee
3 changed files with 3231 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,877 @@
{
"fmgr_firewall_policy_addsetdelete": [
{
"url": "/pm/config/adom/ansible/pkg/default/firewall/policy",
"paramgram_used": {
"wanopt-passive-opt": null,
"package_name": "default",
"wanopt-detection": null,
"scan-botnet-connections": null,
"profile-group": null,
"wanopt-peer": null,
"dscp-match": null,
"replacemsg-override-group": null,
"internet-service-negate": null,
"np-acceleration": null,
"learning-mode": null,
"session-ttl": null,
"ntlm-guest": null,
"ips-sensor": null,
"diffservcode-rev": null,
"match-vip": null,
"natip": null,
"dlp-sensor": null,
"traffic-shaper": null,
"groups": null,
"schedule-timeout": null,
"name": "Basic_IPv4_Policy",
"tcp-session-without-syn": null,
"ntlm": null,
"permit-stun-host": null,
"diffservcode-forward": null,
"internet-service-src-custom": null,
"mode": "set",
"disclaimer": null,
"rtp-nat": null,
"auth-cert": null,
"timeout-send-rst": null,
"auth-redirect-addr": null,
"ssl-mirror-intf": null,
"identity-based-route": null,
"natoutbound": null,
"wanopt-profile": null,
"per-ip-shaper": null,
"profile-protocol-options": null,
"diffserv-forward": null,
"poolname": null,
"comments": "Created by Ansible",
"label": null,
"global-label": null,
"firewall-session-dirty": null,
"wanopt": null,
"schedule": "always",
"internet-service-id": null,
"auth-path": null,
"vlan-cos-fwd": null,
"custom-log-fields": null,
"dstintf": "any",
"srcintf": "any",
"block-notification": null,
"internet-service-src-id": null,
"redirect-url": null,
"waf-profile": null,
"ntlm-enabled-browsers": null,
"dscp-negate": null,
"action": "accept",
"fsso-agent-for-ntlm": null,
"logtraffic": "utm",
"vlan-filter": null,
"policyid": null,
"logtraffic-start": null,
"webcache-https": null,
"webfilter-profile": null,
"internet-service-src": null,
"webcache": null,
"utm-status": null,
"vpn_src_node": {
"subnet": null,
"host": null,
"seq": null
},
"ippool": null,
"service": "ALL",
"wccp": null,
"auto-asic-offload": null,
"dscp-value": null,
"url-category": null,
"capture-packet": null,
"adom": "ansible",
"inbound": null,
"internet-service": null,
"profile-type": null,
"ssl-mirror": null,
"srcaddr-negate": null,
"gtp-profile": null,
"mms-profile": null,
"send-deny-packet": null,
"devices": null,
"permit-any-host": null,
"av-profile": null,
"internet-service-src-negate": null,
"service-negate": null,
"rsso": null,
"app-group": null,
"tcp-mss-sender": null,
"natinbound": null,
"fixedport": null,
"ssl-ssh-profile": null,
"outbound": null,
"spamfilter-profile": null,
"application-list": null,
"application": null,
"dnsfilter-profile": null,
"nat": null,
"fsso": null,
"vlan-cos-rev": null,
"status": null,
"dsri": null,
"users": null,
"voip-profile": null,
"dstaddr-negate": null,
"traffic-shaper-reverse": null,
"internet-service-custom": null,
"diffserv-reverse": null,
"srcaddr": "all",
"ssh-filter-profile": null,
"delay-tcp-npu-session": null,
"icap-profile": null,
"captive-portal-exempt": null,
"vpn_dst_node": {
"subnet": null,
"host": null,
"seq": null
},
"app-category": null,
"rtp-addr": null,
"wsso": null,
"tcp-mss-receiver": null,
"dstaddr": "all",
"radius-mac-auth-bypass": null,
"vpntunnel": null
},
"raw_response": {
"policyid": 25
},
"post_method": "set"
},
{
"url": "/pm/config/adom/ansible/pkg/default/firewall/policy",
"raw_response": {
"policyid": 26
},
"paramgram_used": {
"package_name": "default",
"wanopt-detection": null,
"scan-botnet-connections": null,
"profile-group": null,
"dlp-sensor": null,
"dscp-match": null,
"replacemsg-override-group": null,
"internet-service-negate": null,
"np-acceleration": null,
"learning-mode": null,
"session-ttl": null,
"ntlm-guest": null,
"ips-sensor": null,
"diffservcode-rev": null,
"match-vip": null,
"natip": null,
"wanopt-peer": null,
"traffic-shaper": null,
"groups": null,
"schedule-timeout": null,
"name": "Basic_IPv4_Policy_2",
"tcp-session-without-syn": null,
"rtp-nat": null,
"permit-stun-host": null,
"natoutbound": null,
"internet-service-src-custom": null,
"mode": "set",
"logtraffic": "utm",
"ntlm": null,
"auth-cert": null,
"timeout-send-rst": null,
"auth-redirect-addr": null,
"ssl-mirror-intf": null,
"identity-based-route": null,
"diffservcode-forward": null,
"wanopt-profile": null,
"per-ip-shaper": null,
"users": null,
"diffserv-forward": null,
"poolname": null,
"comments": "Created by Ansible",
"label": null,
"global-label": null,
"firewall-session-dirty": null,
"wanopt": null,
"schedule": "always",
"internet-service-id": null,
"auth-path": null,
"vlan-cos-fwd": null,
"custom-log-fields": null,
"dstintf": "any",
"srcintf": "any",
"block-notification": null,
"internet-service-src-id": null,
"redirect-url": null,
"waf-profile": null,
"ntlm-enabled-browsers": null,
"dscp-negate": null,
"action": "accept",
"fsso-agent-for-ntlm": null,
"disclaimer": null,
"vlan-filter": null,
"dstaddr-negate": null,
"logtraffic-start": null,
"webcache-https": null,
"webfilter-profile": null,
"internet-service-src": null,
"webcache": null,
"utm-status": null,
"vpn_src_node": {
"subnet": null,
"host": null,
"seq": null
},
"ippool": null,
"service": "HTTP, HTTPS",
"wccp": null,
"auto-asic-offload": null,
"dscp-value": null,
"url-category": null,
"capture-packet": null,
"adom": "ansible",
"inbound": null,
"internet-service": null,
"profile-type": null,
"ssl-mirror": null,
"srcaddr-negate": null,
"gtp-profile": null,
"mms-profile": null,
"send-deny-packet": null,
"devices": null,
"permit-any-host": null,
"av-profile": null,
"internet-service-src-negate": null,
"service-negate": null,
"rsso": null,
"application-list": null,
"app-group": null,
"tcp-mss-sender": null,
"natinbound": null,
"fixedport": null,
"ssl-ssh-profile": null,
"outbound": null,
"spamfilter-profile": null,
"wanopt-passive-opt": null,
"application": null,
"dnsfilter-profile": null,
"nat": "enable",
"fsso": null,
"vlan-cos-rev": null,
"status": null,
"dsri": null,
"profile-protocol-options": null,
"voip-profile": null,
"policyid": null,
"traffic-shaper-reverse": null,
"internet-service-custom": null,
"diffserv-reverse": null,
"srcaddr": "all",
"dstaddr": "google-play",
"delay-tcp-npu-session": null,
"icap-profile": null,
"captive-portal-exempt": null,
"vpn_dst_node": {
"subnet": null,
"host": null,
"seq": null
},
"app-category": null,
"rtp-addr": null,
"wsso": null,
"tcp-mss-receiver": null,
"ssh-filter-profile": null,
"radius-mac-auth-bypass": null,
"vpntunnel": null
},
"post_method": "set"
},
{
"url": "/pm/config/adom/ansible/pkg/default/firewall/policy",
"paramgram_used": {
"wanopt-passive-opt": null,
"package_name": "default",
"wanopt-detection": null,
"scan-botnet-connections": null,
"profile-group": null,
"wanopt-peer": null,
"dscp-match": null,
"replacemsg-override-group": null,
"internet-service-negate": null,
"np-acceleration": null,
"learning-mode": null,
"session-ttl": null,
"ntlm-guest": null,
"ips-sensor": "default",
"diffservcode-rev": null,
"match-vip": null,
"natip": null,
"dlp-sensor": null,
"traffic-shaper": null,
"groups": null,
"schedule-timeout": null,
"name": "Basic_IPv4_Policy_3",
"tcp-session-without-syn": null,
"ntlm": null,
"permit-stun-host": null,
"diffservcode-forward": null,
"internet-service-src-custom": null,
"mode": "set",
"disclaimer": null,
"rtp-nat": null,
"auth-cert": null,
"timeout-send-rst": null,
"auth-redirect-addr": null,
"ssl-mirror-intf": null,
"identity-based-route": null,
"natoutbound": null,
"wanopt-profile": null,
"per-ip-shaper": null,
"profile-protocol-options": null,
"diffserv-forward": null,
"poolname": null,
"comments": "Created by Ansible",
"label": null,
"global-label": null,
"firewall-session-dirty": null,
"wanopt": null,
"schedule": "always",
"internet-service-id": null,
"auth-path": null,
"vlan-cos-fwd": null,
"custom-log-fields": null,
"dstintf": "zone_wan1, zone_wan2",
"srcintf": "zone_int1",
"block-notification": null,
"internet-service-src-id": null,
"redirect-url": null,
"waf-profile": null,
"ntlm-enabled-browsers": null,
"dscp-negate": null,
"action": "accept",
"fsso-agent-for-ntlm": null,
"logtraffic": "utm",
"vlan-filter": null,
"policyid": null,
"logtraffic-start": null,
"webcache-https": null,
"webfilter-profile": null,
"internet-service-src": null,
"webcache": null,
"utm-status": null,
"vpn_src_node": {
"subnet": null,
"host": null,
"seq": null
},
"ippool": null,
"service": "HTTP, HTTPS",
"wccp": null,
"auto-asic-offload": null,
"dscp-value": null,
"url-category": null,
"capture-packet": null,
"adom": "ansible",
"inbound": null,
"internet-service": null,
"profile-type": null,
"ssl-mirror": null,
"srcaddr-negate": null,
"gtp-profile": null,
"mms-profile": null,
"send-deny-packet": null,
"devices": null,
"permit-any-host": null,
"av-profile": "sniffer-profile",
"internet-service-src-negate": null,
"service-negate": null,
"rsso": null,
"app-group": null,
"tcp-mss-sender": null,
"natinbound": null,
"fixedport": null,
"ssl-ssh-profile": null,
"outbound": null,
"spamfilter-profile": null,
"application-list": null,
"application": null,
"dnsfilter-profile": null,
"nat": "enable",
"fsso": null,
"vlan-cos-rev": null,
"status": null,
"dsri": null,
"users": null,
"voip-profile": null,
"dstaddr-negate": null,
"traffic-shaper-reverse": null,
"internet-service-custom": null,
"diffserv-reverse": null,
"srcaddr": "corp_internal",
"ssh-filter-profile": null,
"delay-tcp-npu-session": null,
"icap-profile": null,
"captive-portal-exempt": null,
"vpn_dst_node": {
"subnet": null,
"host": null,
"seq": null
},
"app-category": null,
"rtp-addr": null,
"wsso": null,
"tcp-mss-receiver": null,
"dstaddr": "google-play, autoupdate.opera.com",
"radius-mac-auth-bypass": null,
"vpntunnel": null
},
"raw_response": {
"policyid": 27
},
"post_method": "set"
},
{
"raw_response": {
"status": {
"message": "OK",
"code": 0
},
"url": "/pm/config/adom/ansible/pkg/default/firewall/policy/25"
},
"paramgram_used": {
"package_name": "default",
"wanopt-detection": null,
"scan-botnet-connections": null,
"profile-group": null,
"dlp-sensor": null,
"dscp-match": null,
"replacemsg-override-group": null,
"internet-service-negate": null,
"np-acceleration": null,
"learning-mode": null,
"session-ttl": null,
"ntlm-guest": null,
"ips-sensor": null,
"diffservcode-rev": null,
"match-vip": null,
"natip": null,
"wanopt-peer": null,
"traffic-shaper": null,
"groups": null,
"schedule-timeout": null,
"name": "Basic_IPv4_Policy",
"tcp-session-without-syn": null,
"rtp-nat": null,
"permit-stun-host": null,
"natoutbound": null,
"internet-service-src-custom": null,
"mode": "delete",
"logtraffic": null,
"ntlm": null,
"auth-cert": null,
"timeout-send-rst": null,
"auth-redirect-addr": null,
"ssl-mirror-intf": null,
"identity-based-route": null,
"diffservcode-forward": null,
"wanopt-profile": null,
"per-ip-shaper": null,
"users": null,
"diffserv-forward": null,
"poolname": null,
"comments": null,
"label": null,
"global-label": null,
"firewall-session-dirty": null,
"wanopt": null,
"schedule": null,
"internet-service-id": null,
"auth-path": null,
"vlan-cos-fwd": null,
"custom-log-fields": null,
"dstintf": null,
"srcintf": null,
"block-notification": null,
"internet-service-src-id": null,
"redirect-url": null,
"waf-profile": null,
"ntlm-enabled-browsers": null,
"dscp-negate": null,
"action": null,
"fsso-agent-for-ntlm": null,
"disclaimer": null,
"vlan-filter": null,
"dstaddr-negate": null,
"logtraffic-start": null,
"webcache-https": null,
"webfilter-profile": null,
"internet-service-src": null,
"webcache": null,
"utm-status": null,
"vpn_src_node": {
"subnet": null,
"host": null,
"seq": null
},
"ippool": null,
"service": null,
"wccp": null,
"auto-asic-offload": null,
"dscp-value": null,
"url-category": null,
"capture-packet": null,
"adom": "ansible",
"inbound": null,
"internet-service": null,
"profile-type": null,
"ssl-mirror": null,
"srcaddr-negate": null,
"gtp-profile": null,
"mms-profile": null,
"send-deny-packet": null,
"devices": null,
"permit-any-host": null,
"av-profile": null,
"internet-service-src-negate": null,
"service-negate": null,
"rsso": null,
"application-list": null,
"app-group": null,
"tcp-mss-sender": null,
"natinbound": null,
"fixedport": null,
"ssl-ssh-profile": null,
"outbound": null,
"spamfilter-profile": null,
"wanopt-passive-opt": null,
"application": null,
"dnsfilter-profile": null,
"nat": null,
"fsso": null,
"vlan-cos-rev": null,
"status": null,
"dsri": null,
"profile-protocol-options": null,
"voip-profile": null,
"policyid": 25,
"traffic-shaper-reverse": null,
"internet-service-custom": null,
"diffserv-reverse": null,
"srcaddr": null,
"dstaddr": null,
"delay-tcp-npu-session": null,
"icap-profile": null,
"captive-portal-exempt": null,
"vpn_dst_node": {
"subnet": null,
"host": null,
"seq": null
},
"app-category": null,
"rtp-addr": null,
"wsso": null,
"tcp-mss-receiver": null,
"ssh-filter-profile": null,
"radius-mac-auth-bypass": null,
"vpntunnel": null
},
"post_method": "delete"
},
{
"paramgram_used": {
"wanopt-passive-opt": null,
"package_name": "default",
"wanopt-detection": null,
"scan-botnet-connections": null,
"profile-group": null,
"wanopt-peer": null,
"dscp-match": null,
"replacemsg-override-group": null,
"internet-service-negate": null,
"np-acceleration": null,
"learning-mode": null,
"session-ttl": null,
"ntlm-guest": null,
"ips-sensor": null,
"diffservcode-rev": null,
"match-vip": null,
"natip": null,
"dlp-sensor": null,
"traffic-shaper": null,
"groups": null,
"schedule-timeout": null,
"name": "Basic_IPv4_Policy_2",
"tcp-session-without-syn": null,
"ntlm": null,
"permit-stun-host": null,
"diffservcode-forward": null,
"internet-service-src-custom": null,
"mode": "delete",
"disclaimer": null,
"rtp-nat": null,
"auth-cert": null,
"timeout-send-rst": null,
"auth-redirect-addr": null,
"ssl-mirror-intf": null,
"identity-based-route": null,
"natoutbound": null,
"wanopt-profile": null,
"per-ip-shaper": null,
"profile-protocol-options": null,
"diffserv-forward": null,
"poolname": null,
"comments": null,
"label": null,
"global-label": null,
"firewall-session-dirty": null,
"wanopt": null,
"schedule": null,
"internet-service-id": null,
"auth-path": null,
"vlan-cos-fwd": null,
"custom-log-fields": null,
"dstintf": null,
"srcintf": null,
"block-notification": null,
"internet-service-src-id": null,
"redirect-url": null,
"waf-profile": null,
"ntlm-enabled-browsers": null,
"dscp-negate": null,
"action": null,
"fsso-agent-for-ntlm": null,
"logtraffic": null,
"vlan-filter": null,
"policyid": 26,
"logtraffic-start": null,
"webcache-https": null,
"webfilter-profile": null,
"internet-service-src": null,
"webcache": null,
"utm-status": null,
"vpn_src_node": {
"subnet": null,
"host": null,
"seq": null
},
"ippool": null,
"service": null,
"wccp": null,
"auto-asic-offload": null,
"dscp-value": null,
"url-category": null,
"capture-packet": null,
"adom": "ansible",
"inbound": null,
"internet-service": null,
"profile-type": null,
"ssl-mirror": null,
"srcaddr-negate": null,
"gtp-profile": null,
"mms-profile": null,
"send-deny-packet": null,
"devices": null,
"permit-any-host": null,
"av-profile": null,
"internet-service-src-negate": null,
"service-negate": null,
"rsso": null,
"app-group": null,
"tcp-mss-sender": null,
"natinbound": null,
"fixedport": null,
"ssl-ssh-profile": null,
"outbound": null,
"spamfilter-profile": null,
"application-list": null,
"application": null,
"dnsfilter-profile": null,
"nat": null,
"fsso": null,
"vlan-cos-rev": null,
"status": null,
"dsri": null,
"users": null,
"voip-profile": null,
"dstaddr-negate": null,
"traffic-shaper-reverse": null,
"internet-service-custom": null,
"diffserv-reverse": null,
"srcaddr": null,
"ssh-filter-profile": null,
"delay-tcp-npu-session": null,
"icap-profile": null,
"captive-portal-exempt": null,
"vpn_dst_node": {
"subnet": null,
"host": null,
"seq": null
},
"app-category": null,
"rtp-addr": null,
"wsso": null,
"tcp-mss-receiver": null,
"dstaddr": null,
"radius-mac-auth-bypass": null,
"vpntunnel": null
},
"raw_response": {
"status": {
"message": "OK",
"code": 0
},
"url": "/pm/config/adom/ansible/pkg/default/firewall/policy/26"
},
"post_method": "delete"
},
{
"raw_response": {
"status": {
"message": "OK",
"code": 0
},
"url": "/pm/config/adom/ansible/pkg/default/firewall/policy/27"
},
"paramgram_used": {
"package_name": "default",
"wanopt-detection": null,
"scan-botnet-connections": null,
"profile-group": null,
"dlp-sensor": null,
"dscp-match": null,
"replacemsg-override-group": null,
"internet-service-negate": null,
"np-acceleration": null,
"learning-mode": null,
"session-ttl": null,
"ntlm-guest": null,
"ips-sensor": null,
"diffservcode-rev": null,
"match-vip": null,
"natip": null,
"wanopt-peer": null,
"traffic-shaper": null,
"groups": null,
"schedule-timeout": null,
"name": "Basic_IPv4_Policy_3",
"tcp-session-without-syn": null,
"rtp-nat": null,
"permit-stun-host": null,
"natoutbound": null,
"internet-service-src-custom": null,
"mode": "delete",
"logtraffic": null,
"ntlm": null,
"auth-cert": null,
"timeout-send-rst": null,
"auth-redirect-addr": null,
"ssl-mirror-intf": null,
"identity-based-route": null,
"diffservcode-forward": null,
"wanopt-profile": null,
"per-ip-shaper": null,
"users": null,
"diffserv-forward": null,
"poolname": null,
"comments": null,
"label": null,
"global-label": null,
"firewall-session-dirty": null,
"wanopt": null,
"schedule": null,
"internet-service-id": null,
"auth-path": null,
"vlan-cos-fwd": null,
"custom-log-fields": null,
"dstintf": null,
"srcintf": null,
"block-notification": null,
"internet-service-src-id": null,
"redirect-url": null,
"waf-profile": null,
"ntlm-enabled-browsers": null,
"dscp-negate": null,
"action": null,
"fsso-agent-for-ntlm": null,
"disclaimer": null,
"vlan-filter": null,
"dstaddr-negate": null,
"logtraffic-start": null,
"webcache-https": null,
"webfilter-profile": null,
"internet-service-src": null,
"webcache": null,
"utm-status": null,
"vpn_src_node": {
"subnet": null,
"host": null,
"seq": null
},
"ippool": null,
"service": null,
"wccp": null,
"auto-asic-offload": null,
"dscp-value": null,
"url-category": null,
"capture-packet": null,
"adom": "ansible",
"internet-service": null,
"inbound": null,
"profile-type": null,
"ssl-mirror": null,
"srcaddr-negate": null,
"gtp-profile": null,
"mms-profile": null,
"send-deny-packet": null,
"devices": null,
"permit-any-host": null,
"av-profile": null,
"internet-service-src-negate": null,
"service-negate": null,
"rsso": null,
"application-list": null,
"app-group": null,
"tcp-mss-sender": null,
"natinbound": null,
"fixedport": null,
"ssl-ssh-profile": null,
"outbound": null,
"spamfilter-profile": null,
"wanopt-passive-opt": null,
"application": null,
"dnsfilter-profile": null,
"nat": null,
"fsso": null,
"vlan-cos-rev": null,
"status": null,
"dsri": null,
"profile-protocol-options": null,
"voip-profile": null,
"policyid": 27,
"traffic-shaper-reverse": null,
"internet-service-custom": null,
"diffserv-reverse": null,
"srcaddr": null,
"dstaddr": null,
"delay-tcp-npu-session": null,
"icap-profile": null,
"captive-portal-exempt": null,
"vpn_dst_node": {
"subnet": null,
"host": null,
"seq": null
},
"app-category": null,
"rtp-addr": null,
"wsso": null,
"tcp-mss-receiver": null,
"ssh-filter-profile": null,
"radius-mac-auth-bypass": null,
"vpntunnel": null
},
"post_method": "delete"
}
]
}

View file

@ -0,0 +1,846 @@
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <https://www.gnu.org/licenses/>.
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
from pyFMG.fortimgr import FortiManager
import pytest
try:
from ansible.modules.network.fortimanager import fmgr_fwpol_ipv4
except ImportError:
pytest.skip("Could not load required modules for testing", allow_module_level=True)
fmg_instance = FortiManager("1.1.1.1", "admin", "")
def load_fixtures():
fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') + "/{filename}.json".format(
filename=os.path.splitext(os.path.basename(__file__))[0])
try:
with open(fixture_path, "r") as fixture_file:
fixture_data = json.load(fixture_file)
except IOError:
return []
return [fixture_data]
@pytest.fixture(scope="function", params=load_fixtures())
def fixture_data(request):
func_name = request.function.__name__.replace("test_", "")
return request.param.get(func_name, None)
def test_fmgr_firewall_policy_addsetdelete(fixture_data, mocker):
mocker.patch("pyFMG.fortimgr.FortiManager._post_request", side_effect=fixture_data)
# Fixture sets used:###########################
##################################################
# wanopt-passive-opt: None
# package_name: default
# wanopt-detection: None
# scan-botnet-connections: None
# profile-group: None
# wanopt-peer: None
# dscp-match: None
# replacemsg-override-group: None
# internet-service-negate: None
# np-acceleration: None
# learning-mode: None
# session-ttl: None
# ntlm-guest: None
# ips-sensor: None
# diffservcode-rev: None
# match-vip: None
# natip: None
# dlp-sensor: None
# traffic-shaper: None
# groups: None
# schedule-timeout: None
# name: Basic_IPv4_Policy
# tcp-session-without-syn: None
# ntlm: None
# permit-stun-host: None
# diffservcode-forward: None
# internet-service-src-custom: None
# mode: set
# disclaimer: None
# rtp-nat: None
# auth-cert: None
# timeout-send-rst: None
# auth-redirect-addr: None
# ssl-mirror-intf: None
# identity-based-route: None
# natoutbound: None
# wanopt-profile: None
# per-ip-shaper: None
# profile-protocol-options: None
# diffserv-forward: None
# poolname: None
# comments: Created by Ansible
# label: None
# global-label: None
# firewall-session-dirty: None
# wanopt: None
# schedule: always
# internet-service-id: None
# auth-path: None
# vlan-cos-fwd: None
# custom-log-fields: None
# dstintf: any
# srcintf: any
# block-notification: None
# internet-service-src-id: None
# redirect-url: None
# waf-profile: None
# ntlm-enabled-browsers: None
# dscp-negate: None
# action: accept
# fsso-agent-for-ntlm: None
# logtraffic: utm
# vlan-filter: None
# policyid: None
# logtraffic-start: None
# webcache-https: None
# webfilter-profile: None
# internet-service-src: None
# webcache: None
# utm-status: None
# vpn_src_node: {'subnet': None, 'host': None, 'seq': None}
# ippool: None
# service: ALL
# wccp: None
# auto-asic-offload: None
# dscp-value: None
# url-category: None
# capture-packet: None
# adom: ansible
# inbound: None
# internet-service: None
# profile-type: None
# ssl-mirror: None
# srcaddr-negate: None
# gtp-profile: None
# mms-profile: None
# send-deny-packet: None
# devices: None
# permit-any-host: None
# av-profile: None
# internet-service-src-negate: None
# service-negate: None
# rsso: None
# app-group: None
# tcp-mss-sender: None
# natinbound: None
# fixedport: None
# ssl-ssh-profile: None
# outbound: None
# spamfilter-profile: None
# application-list: None
# application: None
# dnsfilter-profile: None
# nat: None
# fsso: None
# vlan-cos-rev: None
# status: None
# dsri: None
# users: None
# voip-profile: None
# dstaddr-negate: None
# traffic-shaper-reverse: None
# internet-service-custom: None
# diffserv-reverse: None
# srcaddr: all
# ssh-filter-profile: None
# delay-tcp-npu-session: None
# icap-profile: None
# captive-portal-exempt: None
# vpn_dst_node: {'subnet': None, 'host': None, 'seq': None}
# app-category: None
# rtp-addr: None
# wsso: None
# tcp-mss-receiver: None
# dstaddr: all
# radius-mac-auth-bypass: None
# vpntunnel: None
##################################################
##################################################
# package_name: default
# wanopt-detection: None
# scan-botnet-connections: None
# profile-group: None
# dlp-sensor: None
# dscp-match: None
# replacemsg-override-group: None
# internet-service-negate: None
# np-acceleration: None
# learning-mode: None
# session-ttl: None
# ntlm-guest: None
# ips-sensor: None
# diffservcode-rev: None
# match-vip: None
# natip: None
# wanopt-peer: None
# traffic-shaper: None
# groups: None
# schedule-timeout: None
# name: Basic_IPv4_Policy_2
# tcp-session-without-syn: None
# rtp-nat: None
# permit-stun-host: None
# natoutbound: None
# internet-service-src-custom: None
# mode: set
# logtraffic: utm
# ntlm: None
# auth-cert: None
# timeout-send-rst: None
# auth-redirect-addr: None
# ssl-mirror-intf: None
# identity-based-route: None
# diffservcode-forward: None
# wanopt-profile: None
# per-ip-shaper: None
# users: None
# diffserv-forward: None
# poolname: None
# comments: Created by Ansible
# label: None
# global-label: None
# firewall-session-dirty: None
# wanopt: None
# schedule: always
# internet-service-id: None
# auth-path: None
# vlan-cos-fwd: None
# custom-log-fields: None
# dstintf: any
# srcintf: any
# block-notification: None
# internet-service-src-id: None
# redirect-url: None
# waf-profile: None
# ntlm-enabled-browsers: None
# dscp-negate: None
# action: accept
# fsso-agent-for-ntlm: None
# disclaimer: None
# vlan-filter: None
# dstaddr-negate: None
# logtraffic-start: None
# webcache-https: None
# webfilter-profile: None
# internet-service-src: None
# webcache: None
# utm-status: None
# vpn_src_node: {'subnet': None, 'host': None, 'seq': None}
# ippool: None
# service: HTTP, HTTPS
# wccp: None
# auto-asic-offload: None
# dscp-value: None
# url-category: None
# capture-packet: None
# adom: ansible
# inbound: None
# internet-service: None
# profile-type: None
# ssl-mirror: None
# srcaddr-negate: None
# gtp-profile: None
# mms-profile: None
# send-deny-packet: None
# devices: None
# permit-any-host: None
# av-profile: None
# internet-service-src-negate: None
# service-negate: None
# rsso: None
# application-list: None
# app-group: None
# tcp-mss-sender: None
# natinbound: None
# fixedport: None
# ssl-ssh-profile: None
# outbound: None
# spamfilter-profile: None
# wanopt-passive-opt: None
# application: None
# dnsfilter-profile: None
# nat: enable
# fsso: None
# vlan-cos-rev: None
# status: None
# dsri: None
# profile-protocol-options: None
# voip-profile: None
# policyid: None
# traffic-shaper-reverse: None
# internet-service-custom: None
# diffserv-reverse: None
# srcaddr: all
# dstaddr: google-play
# delay-tcp-npu-session: None
# icap-profile: None
# captive-portal-exempt: None
# vpn_dst_node: {'subnet': None, 'host': None, 'seq': None}
# app-category: None
# rtp-addr: None
# wsso: None
# tcp-mss-receiver: None
# ssh-filter-profile: None
# radius-mac-auth-bypass: None
# vpntunnel: None
##################################################
##################################################
# wanopt-passive-opt: None
# package_name: default
# wanopt-detection: None
# scan-botnet-connections: None
# profile-group: None
# wanopt-peer: None
# dscp-match: None
# replacemsg-override-group: None
# internet-service-negate: None
# np-acceleration: None
# learning-mode: None
# session-ttl: None
# ntlm-guest: None
# ips-sensor: default
# diffservcode-rev: None
# match-vip: None
# natip: None
# dlp-sensor: None
# traffic-shaper: None
# groups: None
# schedule-timeout: None
# name: Basic_IPv4_Policy_3
# tcp-session-without-syn: None
# ntlm: None
# permit-stun-host: None
# diffservcode-forward: None
# internet-service-src-custom: None
# mode: set
# disclaimer: None
# rtp-nat: None
# auth-cert: None
# timeout-send-rst: None
# auth-redirect-addr: None
# ssl-mirror-intf: None
# identity-based-route: None
# natoutbound: None
# wanopt-profile: None
# per-ip-shaper: None
# profile-protocol-options: None
# diffserv-forward: None
# poolname: None
# comments: Created by Ansible
# label: None
# global-label: None
# firewall-session-dirty: None
# wanopt: None
# schedule: always
# internet-service-id: None
# auth-path: None
# vlan-cos-fwd: None
# custom-log-fields: None
# dstintf: zone_wan1, zone_wan2
# srcintf: zone_int1
# block-notification: None
# internet-service-src-id: None
# redirect-url: None
# waf-profile: None
# ntlm-enabled-browsers: None
# dscp-negate: None
# action: accept
# fsso-agent-for-ntlm: None
# logtraffic: utm
# vlan-filter: None
# policyid: None
# logtraffic-start: None
# webcache-https: None
# webfilter-profile: None
# internet-service-src: None
# webcache: None
# utm-status: None
# vpn_src_node: {'subnet': None, 'host': None, 'seq': None}
# ippool: None
# service: HTTP, HTTPS
# wccp: None
# auto-asic-offload: None
# dscp-value: None
# url-category: None
# capture-packet: None
# adom: ansible
# inbound: None
# internet-service: None
# profile-type: None
# ssl-mirror: None
# srcaddr-negate: None
# gtp-profile: None
# mms-profile: None
# send-deny-packet: None
# devices: None
# permit-any-host: None
# av-profile: sniffer-profile
# internet-service-src-negate: None
# service-negate: None
# rsso: None
# app-group: None
# tcp-mss-sender: None
# natinbound: None
# fixedport: None
# ssl-ssh-profile: None
# outbound: None
# spamfilter-profile: None
# application-list: None
# application: None
# dnsfilter-profile: None
# nat: enable
# fsso: None
# vlan-cos-rev: None
# status: None
# dsri: None
# users: None
# voip-profile: None
# dstaddr-negate: None
# traffic-shaper-reverse: None
# internet-service-custom: None
# diffserv-reverse: None
# srcaddr: corp_internal
# ssh-filter-profile: None
# delay-tcp-npu-session: None
# icap-profile: None
# captive-portal-exempt: None
# vpn_dst_node: {'subnet': None, 'host': None, 'seq': None}
# app-category: None
# rtp-addr: None
# wsso: None
# tcp-mss-receiver: None
# dstaddr: google-play, autoupdate.opera.com
# radius-mac-auth-bypass: None
# vpntunnel: None
##################################################
##################################################
# package_name: default
# wanopt-detection: None
# scan-botnet-connections: None
# profile-group: None
# dlp-sensor: None
# dscp-match: None
# replacemsg-override-group: None
# internet-service-negate: None
# np-acceleration: None
# learning-mode: None
# session-ttl: None
# ntlm-guest: None
# ips-sensor: None
# diffservcode-rev: None
# match-vip: None
# natip: None
# wanopt-peer: None
# traffic-shaper: None
# groups: None
# schedule-timeout: None
# name: Basic_IPv4_Policy
# tcp-session-without-syn: None
# rtp-nat: None
# permit-stun-host: None
# natoutbound: None
# internet-service-src-custom: None
# mode: delete
# logtraffic: None
# ntlm: None
# auth-cert: None
# timeout-send-rst: None
# auth-redirect-addr: None
# ssl-mirror-intf: None
# identity-based-route: None
# diffservcode-forward: None
# wanopt-profile: None
# per-ip-shaper: None
# users: None
# diffserv-forward: None
# poolname: None
# comments: None
# label: None
# global-label: None
# firewall-session-dirty: None
# wanopt: None
# schedule: None
# internet-service-id: None
# auth-path: None
# vlan-cos-fwd: None
# custom-log-fields: None
# dstintf: None
# srcintf: None
# block-notification: None
# internet-service-src-id: None
# redirect-url: None
# waf-profile: None
# ntlm-enabled-browsers: None
# dscp-negate: None
# action: None
# fsso-agent-for-ntlm: None
# disclaimer: None
# vlan-filter: None
# dstaddr-negate: None
# logtraffic-start: None
# webcache-https: None
# webfilter-profile: None
# internet-service-src: None
# webcache: None
# utm-status: None
# vpn_src_node: {'subnet': None, 'host': None, 'seq': None}
# ippool: None
# service: None
# wccp: None
# auto-asic-offload: None
# dscp-value: None
# url-category: None
# capture-packet: None
# adom: ansible
# inbound: None
# internet-service: None
# profile-type: None
# ssl-mirror: None
# srcaddr-negate: None
# gtp-profile: None
# mms-profile: None
# send-deny-packet: None
# devices: None
# permit-any-host: None
# av-profile: None
# internet-service-src-negate: None
# service-negate: None
# rsso: None
# application-list: None
# app-group: None
# tcp-mss-sender: None
# natinbound: None
# fixedport: None
# ssl-ssh-profile: None
# outbound: None
# spamfilter-profile: None
# wanopt-passive-opt: None
# application: None
# dnsfilter-profile: None
# nat: None
# fsso: None
# vlan-cos-rev: None
# status: None
# dsri: None
# profile-protocol-options: None
# voip-profile: None
# policyid: 25
# traffic-shaper-reverse: None
# internet-service-custom: None
# diffserv-reverse: None
# srcaddr: None
# dstaddr: None
# delay-tcp-npu-session: None
# icap-profile: None
# captive-portal-exempt: None
# vpn_dst_node: {'subnet': None, 'host': None, 'seq': None}
# app-category: None
# rtp-addr: None
# wsso: None
# tcp-mss-receiver: None
# ssh-filter-profile: None
# radius-mac-auth-bypass: None
# vpntunnel: None
##################################################
##################################################
# wanopt-passive-opt: None
# package_name: default
# wanopt-detection: None
# scan-botnet-connections: None
# profile-group: None
# wanopt-peer: None
# dscp-match: None
# replacemsg-override-group: None
# internet-service-negate: None
# np-acceleration: None
# learning-mode: None
# session-ttl: None
# ntlm-guest: None
# ips-sensor: None
# diffservcode-rev: None
# match-vip: None
# natip: None
# dlp-sensor: None
# traffic-shaper: None
# groups: None
# schedule-timeout: None
# name: Basic_IPv4_Policy_2
# tcp-session-without-syn: None
# ntlm: None
# permit-stun-host: None
# diffservcode-forward: None
# internet-service-src-custom: None
# mode: delete
# disclaimer: None
# rtp-nat: None
# auth-cert: None
# timeout-send-rst: None
# auth-redirect-addr: None
# ssl-mirror-intf: None
# identity-based-route: None
# natoutbound: None
# wanopt-profile: None
# per-ip-shaper: None
# profile-protocol-options: None
# diffserv-forward: None
# poolname: None
# comments: None
# label: None
# global-label: None
# firewall-session-dirty: None
# wanopt: None
# schedule: None
# internet-service-id: None
# auth-path: None
# vlan-cos-fwd: None
# custom-log-fields: None
# dstintf: None
# srcintf: None
# block-notification: None
# internet-service-src-id: None
# redirect-url: None
# waf-profile: None
# ntlm-enabled-browsers: None
# dscp-negate: None
# action: None
# fsso-agent-for-ntlm: None
# logtraffic: None
# vlan-filter: None
# policyid: 26
# logtraffic-start: None
# webcache-https: None
# webfilter-profile: None
# internet-service-src: None
# webcache: None
# utm-status: None
# vpn_src_node: {'subnet': None, 'host': None, 'seq': None}
# ippool: None
# service: None
# wccp: None
# auto-asic-offload: None
# dscp-value: None
# url-category: None
# capture-packet: None
# adom: ansible
# inbound: None
# internet-service: None
# profile-type: None
# ssl-mirror: None
# srcaddr-negate: None
# gtp-profile: None
# mms-profile: None
# send-deny-packet: None
# devices: None
# permit-any-host: None
# av-profile: None
# internet-service-src-negate: None
# service-negate: None
# rsso: None
# app-group: None
# tcp-mss-sender: None
# natinbound: None
# fixedport: None
# ssl-ssh-profile: None
# outbound: None
# spamfilter-profile: None
# application-list: None
# application: None
# dnsfilter-profile: None
# nat: None
# fsso: None
# vlan-cos-rev: None
# status: None
# dsri: None
# users: None
# voip-profile: None
# dstaddr-negate: None
# traffic-shaper-reverse: None
# internet-service-custom: None
# diffserv-reverse: None
# srcaddr: None
# ssh-filter-profile: None
# delay-tcp-npu-session: None
# icap-profile: None
# captive-portal-exempt: None
# vpn_dst_node: {'subnet': None, 'host': None, 'seq': None}
# app-category: None
# rtp-addr: None
# wsso: None
# tcp-mss-receiver: None
# dstaddr: None
# radius-mac-auth-bypass: None
# vpntunnel: None
##################################################
##################################################
# package_name: default
# wanopt-detection: None
# scan-botnet-connections: None
# profile-group: None
# dlp-sensor: None
# dscp-match: None
# replacemsg-override-group: None
# internet-service-negate: None
# np-acceleration: None
# learning-mode: None
# session-ttl: None
# ntlm-guest: None
# ips-sensor: None
# diffservcode-rev: None
# match-vip: None
# natip: None
# wanopt-peer: None
# traffic-shaper: None
# groups: None
# schedule-timeout: None
# name: Basic_IPv4_Policy_3
# tcp-session-without-syn: None
# rtp-nat: None
# permit-stun-host: None
# natoutbound: None
# internet-service-src-custom: None
# mode: delete
# logtraffic: None
# ntlm: None
# auth-cert: None
# timeout-send-rst: None
# auth-redirect-addr: None
# ssl-mirror-intf: None
# identity-based-route: None
# diffservcode-forward: None
# wanopt-profile: None
# per-ip-shaper: None
# users: None
# diffserv-forward: None
# poolname: None
# comments: None
# label: None
# global-label: None
# firewall-session-dirty: None
# wanopt: None
# schedule: None
# internet-service-id: None
# auth-path: None
# vlan-cos-fwd: None
# custom-log-fields: None
# dstintf: None
# srcintf: None
# block-notification: None
# internet-service-src-id: None
# redirect-url: None
# waf-profile: None
# ntlm-enabled-browsers: None
# dscp-negate: None
# action: None
# fsso-agent-for-ntlm: None
# disclaimer: None
# vlan-filter: None
# dstaddr-negate: None
# logtraffic-start: None
# webcache-https: None
# webfilter-profile: None
# internet-service-src: None
# webcache: None
# utm-status: None
# vpn_src_node: {'subnet': None, 'host': None, 'seq': None}
# ippool: None
# service: None
# wccp: None
# auto-asic-offload: None
# dscp-value: None
# url-category: None
# capture-packet: None
# adom: ansible
# internet-service: None
# inbound: None
# profile-type: None
# ssl-mirror: None
# srcaddr-negate: None
# gtp-profile: None
# mms-profile: None
# send-deny-packet: None
# devices: None
# permit-any-host: None
# av-profile: None
# internet-service-src-negate: None
# service-negate: None
# rsso: None
# application-list: None
# app-group: None
# tcp-mss-sender: None
# natinbound: None
# fixedport: None
# ssl-ssh-profile: None
# outbound: None
# spamfilter-profile: None
# wanopt-passive-opt: None
# application: None
# dnsfilter-profile: None
# nat: None
# fsso: None
# vlan-cos-rev: None
# status: None
# dsri: None
# profile-protocol-options: None
# voip-profile: None
# policyid: 27
# traffic-shaper-reverse: None
# internet-service-custom: None
# diffserv-reverse: None
# srcaddr: None
# dstaddr: None
# delay-tcp-npu-session: None
# icap-profile: None
# captive-portal-exempt: None
# vpn_dst_node: {'subnet': None, 'host': None, 'seq': None}
# app-category: None
# rtp-addr: None
# wsso: None
# tcp-mss-receiver: None
# ssh-filter-profile: None
# radius-mac-auth-bypass: None
# vpntunnel: None
##################################################
# Test using fixture 1 #
output = fmgr_fwpol_ipv4.fmgr_firewall_policy_addsetdelete(fmg_instance, fixture_data[0]['paramgram_used'])
assert isinstance(output['raw_response'], dict) is True
# Test using fixture 2 #
output = fmgr_fwpol_ipv4.fmgr_firewall_policy_addsetdelete(fmg_instance, fixture_data[1]['paramgram_used'])
assert isinstance(output['raw_response'], dict) is True
# Test using fixture 3 #
output = fmgr_fwpol_ipv4.fmgr_firewall_policy_addsetdelete(fmg_instance, fixture_data[2]['paramgram_used'])
assert isinstance(output['raw_response'], dict) is True
# Test using fixture 4 #
output = fmgr_fwpol_ipv4.fmgr_firewall_policy_addsetdelete(fmg_instance, fixture_data[3]['paramgram_used'])
assert output['raw_response']['status']['code'] == 0
# Test using fixture 5 #
output = fmgr_fwpol_ipv4.fmgr_firewall_policy_addsetdelete(fmg_instance, fixture_data[4]['paramgram_used'])
assert output['raw_response']['status']['code'] == 0
# Test using fixture 6 #
output = fmgr_fwpol_ipv4.fmgr_firewall_policy_addsetdelete(fmg_instance, fixture_data[5]['paramgram_used'])
assert output['raw_response']['status']['code'] == 0