diff options
author | saichint <saichint@cisco.com> | 2018-05-03 09:04:25 -0700 |
---|---|---|
committer | Trishna Guha <trishnaguha17@gmail.com> | 2018-05-03 21:34:25 +0530 |
commit | 99748cbfa473bababb297c855e57c09c995a219b (patch) | |
tree | e5887cb4890f15ece4a62cb7cd81d32c50cf1b0d /test/integration/targets/nxos_snmp_traps/tests | |
parent | d49a09d05e666562344c8f5c1d8a47ffb756f83e (diff) | |
download | ansible-99748cbfa473bababb297c855e57c09c995a219b.tar.gz |
fix nxos_snmp_traps issues (#39444)
* fix snmp_traps code
* add IT cases
* fix shippable
* fix shippable without ignore
Diffstat (limited to 'test/integration/targets/nxos_snmp_traps/tests')
-rw-r--r-- | test/integration/targets/nxos_snmp_traps/tests/common/sanity.yaml | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/test/integration/targets/nxos_snmp_traps/tests/common/sanity.yaml b/test/integration/targets/nxos_snmp_traps/tests/common/sanity.yaml new file mode 100644 index 0000000000..4286813c86 --- /dev/null +++ b/test/integration/targets/nxos_snmp_traps/tests/common/sanity.yaml @@ -0,0 +1,84 @@ +--- +- debug: msg="START connection={{ ansible_connection }} nxos_snmp_traps sanity test" +- debug: msg="Using provider={{ connection.transport }}" + when: ansible_connection == "local" + +- name: Setup - Remove snmp_traps if configured + nxos_snmp_traps: &remove + group: all + state: disabled + provider: "{{ connection }}" + +- block: + - name: Configure one snmp trap group + nxos_snmp_traps: &config + group: bridge + state: enabled + provider: "{{ connection }}" + register: result + + - assert: &true + that: + - "result.changed == true" + + - name: Idempotence Check + nxos_snmp_traps: *config + register: result + + - assert: &false + that: + - "result.changed == false" + + - name: Remove snmp trap group + nxos_snmp_traps: &rem1 + group: bridge + state: disabled + provider: "{{ connection }}" + register: result + + - assert: *true + + - name: Idempotence Check + nxos_snmp_traps: *rem1 + register: result + + - assert: *false + + - name: Configure all snmp trap groups + nxos_snmp_traps: &config1 + group: all + state: enabled + provider: "{{ connection }}" + register: result + + - assert: *true + + - block: + # On I2, link command does not work properly + # On D1, callhome command does not work properly + # skip for these older platforms + - name: Idempotence Check + nxos_snmp_traps: *config1 + register: result + when: imagetag is not search("I2|D1") + + - assert: *false + when: imagetag is not search("I2|D1") + + - name: Cleanup + nxos_snmp_traps: *remove + register: result + + - assert: *true + + - name: Cleanup Idempotence + nxos_snmp_traps: *remove + register: result + + - assert: *false + + always: + - name: Cleanup + nxos_snmp_traps: *remove + + - debug: msg="END connection={{ ansible_connection }} nxos_snmp_traps sanity test" |