ansible/test/integration/targets/nxos_ntp/tests/common/sanity.yaml

122 lines
2.3 KiB
YAML
Raw Normal View History

---
- debug: msg="START connection={{ ansible_connection }} nxos_ntp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: Setup - Remove ntp if configured
nxos_ntp: &remove
server: 1.2.3.4
key_id: 32
prefer: disabled
vrf_name: management
source_addr: 5.5.5.5
state: absent
provider: "{{ connection }}"
ignore_errors: yes
- block:
- name: Configure ntp
nxos_ntp: &config
server: 1.2.3.4
key_id: 32
prefer: enabled
vrf_name: management
source_addr: 5.5.5.5
state: present
provider: "{{ connection }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: Idempotence Check
nxos_ntp: *config
register: result
- assert: &false
that:
- "result.changed == false"
nxos bugfixes stable-2.5 (#39719) * Handle nxos_feature issue where json isn't supported (#39150) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 9eff1f1d74f20b31b69ecb3d9aa7278626562725) * Integration Tests only: nxos_snmp_contact (#39318) * add integration test cases for snmp_contact * removing unnecessary files (cherry picked from commit bdb75cd82c81c641e40703ed1e2088a5153ce051) * fix nxos_ntp issues (#39178) * fix nxos_ntp issues * review comments * fix idempotent fail case (cherry picked from commit 2f99a1785629758cf78ce2532515f045637d2e7a) * nxos_interface: AttributeError: 'NoneType' object has no attribute 'group' (#38544) This fixes an issue we recently encounteredi with nxos_interface: ``` Traceback (most recent call last): File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 777, in main have = map_config_to_obj(want, module) File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 606, in map_config_to_obj obj['speed'] = re.search(r'speed (\d+)', body).group(1) AttributeError: 'NoneType' object has no attribute 'group' ``` (cherry picked from commit dca6e2d94dd97bc82c696d42ebb7c6e635340cd8) * fix nxos_snmp_community issues (#39258) (cherry picked from commit 1afec5a48e3335e7d5fe794639442dbc38e125a9) * Add aggregate example in nxos_l2_interface module doc (#39275) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 86817cdd52f9595dcb77ba2cc449726586714af3) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … (#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,... (cherry picked from commit 80d7e22f5e34574e4383cea2baef00098d0ebdf7) * Fix for nxos_snmp_host issues (#39642) * fix snmp_host issues * source files * fix shippable * remove defaults to match arg spec (cherry picked from commit f99bae1776cdc87e0a3f190b76c41d77fb7dd94b) * fix nxos_snmp_traps issues (#39444) * fix snmp_traps code * add IT cases * fix shippable * fix shippable without ignore (cherry picked from commit 99748cbfa473bababb297c855e57c09c995a219b) * changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-04 09:55:55 +00:00
- name: Configure ntp with some defaults
nxos_ntp: &config1
peer: 1.2.3.4
key_id: default
prefer: enabled
vrf_name: default
source_addr: default
state: present
provider: "{{ connection }}"
register: result
- assert: *true
- name: Idempotence Check
nxos_ntp: *config1
register: result
- assert: *false
- name: Remove ntp config
nxos_ntp: *remove
register: result
- assert: *true
- name: Remove Idempotence Check
nxos_ntp: *remove
register: result
- assert: *false
nxos bugfixes stable-2.5 (#39719) * Handle nxos_feature issue where json isn't supported (#39150) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 9eff1f1d74f20b31b69ecb3d9aa7278626562725) * Integration Tests only: nxos_snmp_contact (#39318) * add integration test cases for snmp_contact * removing unnecessary files (cherry picked from commit bdb75cd82c81c641e40703ed1e2088a5153ce051) * fix nxos_ntp issues (#39178) * fix nxos_ntp issues * review comments * fix idempotent fail case (cherry picked from commit 2f99a1785629758cf78ce2532515f045637d2e7a) * nxos_interface: AttributeError: 'NoneType' object has no attribute 'group' (#38544) This fixes an issue we recently encounteredi with nxos_interface: ``` Traceback (most recent call last): File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 777, in main have = map_config_to_obj(want, module) File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 606, in map_config_to_obj obj['speed'] = re.search(r'speed (\d+)', body).group(1) AttributeError: 'NoneType' object has no attribute 'group' ``` (cherry picked from commit dca6e2d94dd97bc82c696d42ebb7c6e635340cd8) * fix nxos_snmp_community issues (#39258) (cherry picked from commit 1afec5a48e3335e7d5fe794639442dbc38e125a9) * Add aggregate example in nxos_l2_interface module doc (#39275) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 86817cdd52f9595dcb77ba2cc449726586714af3) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … (#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,... (cherry picked from commit 80d7e22f5e34574e4383cea2baef00098d0ebdf7) * Fix for nxos_snmp_host issues (#39642) * fix snmp_host issues * source files * fix shippable * remove defaults to match arg spec (cherry picked from commit f99bae1776cdc87e0a3f190b76c41d77fb7dd94b) * fix nxos_snmp_traps issues (#39444) * fix snmp_traps code * add IT cases * fix shippable * fix shippable without ignore (cherry picked from commit 99748cbfa473bababb297c855e57c09c995a219b) * changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-04 09:55:55 +00:00
- name: Configure ntp again
nxos_ntp: &config2
source_int: Ethernet1/3
peer: 1.2.3.4
prefer: enabled
state: present
provider: "{{ connection }}"
register: result
- assert: *true
- name: Idempotence Check
nxos_ntp: *config2
register: result
- assert: *false
- name: Remove source interface
nxos_ntp: &config3
source_int: default
state: present
provider: "{{ connection }}"
register: result
- assert: *true
- name: Idempotence Check
nxos_ntp: *config3
register: result
- assert: *false
- name: Remove ntp
nxos_ntp: *remove
register: result
- assert: *true
- name: Remove Idempotence Check
nxos_ntp: *remove
register: result
- assert: *false
always:
- name: Remove ntp config
nxos_ntp: *remove
- debug: msg="END connection={{ ansible_connection }} nxos_ntp sanity test"