1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix ios and vyos net integration test issue (#32692)

This commit is contained in:
Ganesh Nalawade 2017-11-08 21:39:21 +05:30 committed by GitHub
parent 9d98452032
commit 6aa95ce5fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 20 deletions

View file

@ -1,8 +1,32 @@
---
# ensure logging configs are empty
- name: Remove host logging
net_logging:
dest: host
name: 172.16.0.1
state: absent
authorize: yes
- name: Remove console
net_logging:
dest: console
level: warnings
state: absent
authorize: yes
- name: Remove buffer
net_logging:
dest: buffered
size: 8000
authorize: yes
state: absent
# start tests
- name: Set up host logging
net_logging:
dest: host
name: 172.16.0.1
facility: local7
state: present
authorize: yes
register: result
@ -63,23 +87,38 @@
- 'result.changed == true'
- '"logging console warnings" in result.commands'
- name: Configure monitor logging
- name: Configure Buffer size
net_logging:
dest: monitor
level: debugging
dest: buffered
size: 8000
authorize: yes
register: result
- assert:
that:
- 'result.changed == true'
- '"logging monitor debugging" in result.commands'
- '"logging buffered 8000" in result.commands'
- name: Change logging parameters using aggregate
net_logging:
aggregate:
- { dest: console, level: notifications }
- { dest: buffered, size: 9000 }
authorize: yes
register: result
- assert:
that:
- 'result.changed == true'
- '"logging buffered 9000" in result.commands'
- '"logging console notifications" in result.commands'
- name: remove logging as collection tearDown
net_logging:
aggregate:
- { dest: console, level: warnings, state: absent }
- { dest: monitor, level: debuggning, state: absent }
- { dest: console, level: notifications }
- { dest: buffered, size: 9000 }
state: absent
authorize: yes
register: result
@ -87,4 +126,4 @@
that:
- 'result.changed == true'
- '"no logging console" in result.commands'
- '"no logging monitor" in result.commands'
- '"no logging buffered" in result.commands'

View file

@ -4,12 +4,12 @@
- name: setup
vyos_config:
lines:
- no ip name-server 1.1.1.1
- no ip name-server 2.2.2.2
- no ip name-server 3.3.3.3
- delete system name-server 1.1.1.1
- delete system name-server 2.2.2.2
- delete system name-server 3.3.3.3
match: none
- name: configure name_servers
- name: configure name servers
net_system:
name_servers:
- 1.1.1.1
@ -21,9 +21,9 @@
that:
- result.changed == true
- result.commands|length == 3
- "'ip name-server 1.1.1.1' in result.commands"
- "'ip name-server 2.2.2.2' in result.commands"
- "'ip name-server 3.3.3.3' in result.commands"
- result.commands[0] | search("set system name-server '1.1.1.1'")
- result.commands[1] | search("set system name-server '2.2.2.2'")
- result.commands[2] | search("set system name-server '3.3.3.3'")
- name: verify name_servers
net_system:
@ -40,22 +40,22 @@
- name: remove one
net_system:
name_servers:
- 1.1.1.1
- 2.2.2.2
- 3.3.3.3
state: absent
register: result
- assert:
that:
- result.changed == true
- result.commands|length == 1
- "'no ip name-server 3.3.3.3' in result.commands"
- result.commands[0] | search("delete system name-server '3.3.3.3'")
- name: teardown
vyos_config:
lines:
- no ip lookup source-interface
- delete system name-server name-server 1.1.1.1
- delete system name-server name-server 2.2.2.2
- delete system name-server name-server 3.3.3.3
match: none
ignore_errors: yes
# FIXME Copied from iosxr, not sure what we need here
- debug: msg="END vyos/set_name_servers.yaml"