ansible/test/integration/targets/iosxr_logging/tests/cli/basic.yaml
Ganesh Nalawade 9ab9945cf3 iosxr modules aggregate check and other minor refactor (#28360)
*  iosxr aggregate validation
*  vyos_user, junos_user minor changes
*  Aggregated documentation
2017-08-18 09:50:35 +05:30

130 lines
2.8 KiB
YAML

---
# Remove old logging entries so that they don't conflict with tests
- name: Remove host logging
iosxr_logging:
dest: hostnameprefix
name: 172.16.0.1
state: absent
provider: "{{ cli }}"
- name: Remove console logging
iosxr_logging:
dest: console
level: warning
state: absent
provider: "{{ cli }}"
register: result
- name: Remove buffer
iosxr_logging:
dest: buffered
size: 4800000
state: absent
provider: "{{ cli }}"
register: result
# Start tests
- name: Set up host logging
iosxr_logging:
dest: hostnameprefix
name: 172.16.0.1
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging hostnameprefix 172.16.0.1" in result.commands'
- '"logging facility local7" in result.commands'
- name: Set up host logging again (idempotent)
iosxr_logging:
dest: hostnameprefix
name: 172.16.0.1
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: Delete/disable host logging
iosxr_logging:
dest: hostnameprefix
name: 172.16.0.1
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"no logging hostnameprefix 172.16.0.1" in result.commands'
- name: Delete/disable host logging (idempotent)
iosxr_logging:
dest: hostnameprefix
name: 172.16.0.1
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: Console logging with level warning
iosxr_logging:
dest: console
level: warning
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging console warning" in result.commands'
- name: Configure Buffer size
iosxr_logging:
dest: buffered
size: 4800000
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging buffered 4800000" in result.commands'
- name: Change logging parameters using aggregate
iosxr_logging:
aggregate:
- { dest: console, level: notifications }
- { dest: buffered, size: 4700000 }
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"logging buffered 4700000" in result.commands'
- '"logging console notifications" in result.commands'
- name: remove logging as collection tearDown
iosxr_logging:
aggregate:
- { dest: console, level: notifications }
- { dest: buffered, size: 4700000 }
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"no logging console" in result.commands'
- '"no logging buffered" in result.commands'