meraki_mr_l3_firewall - Integration test fix (#45366)

* Fix integration test as wrong module was called

* Create block section for failures on integration test for mr_l3_firewall integration test
This commit is contained in:
Kevin Breit 2018-09-07 20:44:50 -05:00 committed by Dag Wieers
parent 1463c2e4a8
commit 6c67674eab

View file

@ -3,84 +3,89 @@
# 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)
--- ---
- name: Create wireless network - block:
meraki_network: - name: Create wireless network
auth_key: '{{ auth_key }}' meraki_network:
state: present auth_key: '{{ auth_key }}'
org_name: '{{test_org_name}}' state: present
net_name: TestNetWireless org_name: '{{test_org_name}}'
type: wireless net_name: TestNetWireless
delegate_to: localhost type: wireless
register: new_net delegate_to: localhost
register: new_net
- set_fact: - set_fact:
net: '{{new_net.data.id}}' net: '{{new_net.data.id}}'
- name: Create single firewall rule - name: Create single firewall rule
meraki_mr_l3_firewall: meraki_mr_l3_firewall:
auth_key: '{{ auth_key }}' auth_key: '{{ auth_key }}'
state: present state: present
org_name: '{{test_org_name}}' org_name: '{{test_org_name}}'
net_id: '{{net}}' net_id: '{{net}}'
number: 1 number: 1
rules: rules:
- comment: Integration test rule - comment: Integration test rule
policy: allow policy: allow
protocol: tcp protocol: tcp
dest_port: 80 dest_port: 80
dest_cidr: 192.0.2.0/24 dest_cidr: 192.0.2.0/24
allow_lan_access: no allow_lan_access: no
delegate_to: localhost delegate_to: localhost
register: create_one register: create_one
- debug: - debug:
msg: '{{create_one}}' msg: '{{create_one}}'
- assert: - assert:
that: that:
- create_one.data.0.comment == 'Integration test rule' - create_one.data.0.comment == 'Integration test rule'
- create_one.data.1.policy == 'deny' - create_one.data.1.policy == 'deny'
- name: Enable local LAN access - name: Enable local LAN access
meraki_mr_l3_firewall: meraki_mr_l3_firewall:
auth_key: '{{ auth_key }}' auth_key: '{{ auth_key }}'
state: present state: present
org_name: '{{test_org_name}}' org_name: '{{test_org_name}}'
net_id: '{{net}}' net_id: '{{net}}'
number: 1 number: 1
rules: rules:
allow_lan_access: yes allow_lan_access: yes
delegate_to: localhost delegate_to: localhost
register: enable_lan register: enable_lan
- assert: - assert:
that: that:
- enable_lan.data.1.policy == 'allow' - enable_lan.data.1.policy == 'allow'
- name: Query firewall rules - name: Query firewall rules
meraki_mr_l3_firewall: meraki_mr_l3_firewall:
auth_key: '{{ auth_key }}' auth_key: '{{ auth_key }}'
state: query state: query
org_name: '{{test_org_name}}' org_name: '{{test_org_name}}'
net_id: '{{net}}' net_id: '{{net}}'
number: 1 number: 1
delegate_to: localhost delegate_to: localhost
register: query register: query
- debug: - debug:
msg: '{{query}}' msg: '{{query}}'
- assert: - assert:
that: that:
- query.data.1.comment == 'Wireless clients accessing LAN' - query.data.1.comment == 'Wireless clients accessing LAN'
- query.data.2.comment == 'Default rule' - query.data.2.comment == 'Default rule'
- query.changed == False - query.changed == False
- name: Delete wireless network ############################################################################
meraki_network: # Tear down starts here
auth_key: '{{ auth_key }}' ############################################################################
state: absent always:
org_name: '{{test_org_name}}' - name: Delete wireless network
net_id: '{{net}}' meraki_ssid:
number: 1 auth_key: '{{ auth_key }}'
delegate_to: localhost state: absent
org_name: '{{test_org_name}}'
net_id: '{{net}}'
number: 1
delegate_to: localhost