asa_config/ios_config: diff strict does not work with multiple parents (#45150)

* multiple parents issues in diff

* Integration tests for missing functionality

* add testcase for other platforms. vnxos does not support qos so need to find a command chain on v-nxos for multiple parets. junos uses on-device diff so should not need this.

* Fix for issue when any candidate parent did not meet the exact line in running-config

* DCI runs eos_config without become flag
This commit is contained in:
Deepak Agrawal 2018-09-12 07:50:24 +05:30 committed by GitHub
commit 81214409cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 278 additions and 0 deletions

View file

@ -0,0 +1,67 @@
---
- debug: msg="START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
- name: setup
iosxr_config:
lines:
- class-map match-any c1
- match precedence 7
- policy-map p1
- class c1
- set precedence 2
before: ['no policy-map p1', 'no class-map match-any c1']
match: none
- name: configure sub level command using strict match
iosxr_config:
lines:
- set precedence 5
- police rate percent 10
parents: ['policy-map p1', 'class c1']
match: strict
register: result
- assert:
that:
- "result.changed == true"
- "'set precedence 5' in result.commands"
- "'police rate percent 10' in result.commands"
- name: change sub level command order and config with strict match
iosxr_config:
lines:
- police rate percent 10
- set precedence 5
parents: ['policy-map p1', 'class c1']
match: strict
register: result
- assert:
that:
- "result.changed == true"
- "'set precedence 5' in result.commands"
- "'police rate percent 10' in result.commands"
- name: Config sub level command with strict match (Idempotency)
iosxr_config:
lines:
#IOSxr does not change order of class action if reconfigured
#so we have to use old order for Idempotency
- set precedence 5
- police rate percent 10
parents: ['policy-map p1', 'class c1']
match: strict
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
iosxr_config:
lines:
- no policy-map p1
- no class-map match-any c1
match: none
- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"