ansible/test/integration/targets/eos_acls/tests/common/merged.yaml
GomathiselviS d283126c31
eos_acls : Add eos acls resource module (#66308)
* Adding files for RM static_routes

* Added Integration tests

* Added Unit testcases

* Addressed review comments

* corrected lint errors

* corrected documentation errors

* Lint errors

* corrected test/sanity

* corrected documentation for deprecation

* corrected case sensitivity

* Again Documentation eroor

* Lint errors again

* corrected deprecated module in ignoretxt

* added new gethered,rendered,parsed state checks to unit test

* New code broke the old flow-fixed

* Lint errs

* Added check for running_config

* eos_acls resource module added

* Corrected errors

* corrected documentation errors

* corrected typo

* Testcases in progress

* Integration tests in progress

* Integration tests

* Added Intergration tcs

* Corrected pylint errors

* Resolving issues due to rebase

* Corrected Typo

* more pylint errors

* more pylint errors

* more pylint errors

* Documentation

* Documentation

* More lint errors

* Fixed Indentation

* Indentation issues - not getting fixed

* Indentation issues - not getting fixed

* Added rtt testcase

* Corrected whitespaces

* addressed review comments

* moved integration tests to common - to support eapi tests

* modification for merge update

* indentation errors

* added line key

* Fixing shippable errors

* fixing doc errors

* fixing doc errors

* fixing doc errors

* fixing doc errors

* fixing indentation

* modified replaced operation

* rebase issue fixed

* Corrected typo

* review comments and flake8 error fixed
2020-02-24 12:27:11 -05:00

152 lines
3.7 KiB
YAML

---
- debug:
msg: "Start eos_acls merged integration tests ansible_connection={{ ansible_connection }}"
- set_fact:
config:
- afi: "ipv4"
acls:
- name: test1
aces:
- sequence: 35
grant: "deny"
protocol: "tcp"
source:
subnet_address: 20.0.0.0/8
destination:
any: true
log: true
- remark: "Run by ansible"
sequence: 45
- grant: "permit"
sequence: 55
protocol: "tcp"
source:
any: true
destination:
any: true
- name: test4
aces:
- grant: "permit"
sequence: 10
source:
any: true
port_protocol:
eq: "smtp"
destination:
any: true
port_protocol:
eq: "www"
protocol: "tcp"
ttl:
eq: "55"
- afi: "ipv6"
acls:
- name: test2
standard: true
aces:
- grant: "permit"
sequence: 10
log: "true"
source:
any: true
- block:
- name: merge attributes of given acls.
eos_acls: &merged
config:
- afi: "ipv4"
acls:
- name: test1
aces:
- sequence: 35
grant: "deny"
protocol: "tcp"
source:
subnet_address: 20.0.0.0/8
destination:
any: true
log: true
- remark: "Run by ansible"
- grant: "permit"
protocol: "6"
source:
any: true
destination:
any: true
- name: test4
aces:
- grant: "permit"
source:
any: true
port_protocol:
eq: "25"
destination:
any: true
port_protocol:
eq: "www"
protocol: "tcp"
ttl:
eq: "55"
- afi: "ipv6"
acls:
- name: test2
standard: true
aces:
- grant: "permit"
log: "true"
source:
any: true
state: merged
become: yes
register: result
- eos_facts:
gather_network_resources: acls
become: yes
- assert:
that:
- "result.commands|length == 8"
- "result.changed == true"
become: yes
- name: Idempotency check
eos_acls: *merged
become: yes
register: result
- assert:
that:
- "result.changed == false"
- "result.commands|length == 0"
- "ansible_facts.network_resources.acls|symmetric_difference(result.before) == []"
- name: merge attributes with an existing ace
eos_acls:
config:
- afi: "ipv4"
acls:
- name: test1
aces:
- sequence: 35
log: true
ttl:
eq: 33
source:
any: true
state: merged
become: yes
register: result
- assert:
that:
- "result.changed == true"
- "result.commands|length == 3"
- "'no 35' in result.commands"
- "'35 deny tcp any any ttl eq 33 log' in result.commands"
always:
- include_tasks: _remove_config.yaml