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

pull/32698/head
Ganesh Nalawade 7 years ago committed by GitHub
parent 9d98452032
commit 6aa95ce5fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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'

@ -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"

Loading…
Cancel
Save