d283126c31
* 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
101 lines
2.7 KiB
YAML
101 lines
2.7 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start eos_acls round trip integration tests ansible_connection={{ ansible_connection }}"
|
|
|
|
|
|
- block:
|
|
- name: merge attributes of given acls(apply base config).
|
|
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: base_config
|
|
|
|
- eos_facts:
|
|
gather_network_resources: acls
|
|
become: yes
|
|
|
|
- assert:
|
|
that:
|
|
- "base_config.commands|length == 8"
|
|
- "base_config.changed == true"
|
|
- "ansible_facts.network_resources.acls|symmetric_difference(base_config.after) == []"
|
|
|
|
- name: Apply the provided configuration (config to be reverted)
|
|
eos_acls:
|
|
config:
|
|
- afi: "ipv4"
|
|
acls:
|
|
- name: test3
|
|
aces:
|
|
- sequence: 100
|
|
grant: "permit"
|
|
protocol: "icmp"
|
|
source:
|
|
any: true
|
|
destination:
|
|
any: true
|
|
log: true
|
|
become: yes
|
|
register: result
|
|
|
|
- name: Assert that changes were applied
|
|
assert:
|
|
that:
|
|
- "{{ round_trip['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
|
|
|
|
- name: Revert back to base config using facts round trip
|
|
eos_acls:
|
|
config: "{{ ansible_facts['network_resources']['acls'] }}"
|
|
state: overridden
|
|
become: yes
|
|
register: revert
|
|
|
|
- name: Assert that config was reverted
|
|
assert:
|
|
that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}"
|
|
|
|
always:
|
|
- include_tasks: _remove_config.yaml
|