summaryrefslogtreecommitdiff
path: root/test/integration/targets/eos_logging
diff options
context:
space:
mode:
authorNilashish Chakraborty <nilashishchakraborty8@gmail.com>2018-05-30 18:21:54 +0530
committerGitHub <noreply@github.com>2018-05-30 18:21:54 +0530
commitb9ea6468398d23c4b9c39f0c91cd79bf0b61af5d (patch)
treec69a677e5b1170e0c3e5cec4687dae5839486ed3 /test/integration/targets/eos_logging
parent2272b6155c4245057cb0c617fedeb6a07335302e (diff)
downloadansible-b9ea6468398d23c4b9c39f0c91cd79bf0b61af5d.tar.gz
Fixes eos_logging idempotence issue #31862 (#40604)
* eos_logging idempotence fix * fixed eos_logging idempotence issue * Fixed pylint and pep8 errors * Added tests for eos_logging & minor fix * Removed q statements
Diffstat (limited to 'test/integration/targets/eos_logging')
-rw-r--r--test/integration/targets/eos_logging/tests/cli/basic.yaml35
1 files changed, 34 insertions, 1 deletions
diff --git a/test/integration/targets/eos_logging/tests/cli/basic.yaml b/test/integration/targets/eos_logging/tests/cli/basic.yaml
index 302cc55464..638a9d5e8a 100644
--- a/test/integration/targets/eos_logging/tests/cli/basic.yaml
+++ b/test/integration/targets/eos_logging/tests/cli/basic.yaml
@@ -64,6 +64,7 @@
- 'result.changed == true'
- '"logging console warnings" in result.commands'
+
- name: Configure buffer size
eos_logging:
dest: buffered
@@ -76,11 +77,42 @@
- 'result.changed == true'
- '"logging buffered 480000" in result.commands'
+- name: Set up logging destination and facility at the same time
+ eos_logging:
+ dest: buffered
+ size: 4096
+ facility: local7
+ level: informational
+ state: present
+ become: yes
+ register: result
+
+- assert:
+ that:
+ - 'result.changed == true'
+ - '"logging buffered 4096 informational" in result.commands'
+ - '"logging facility local7" in result.commands'
+
+- name: Set up logging destination and facility at the same time again (idempotent)
+ eos_logging:
+ dest: buffered
+ size: 4096
+ facility: local7
+ level: informational
+ state: present
+ become: yes
+ register: result
+
+- assert:
+ that:
+ - 'result.changed == false'
+
- name: remove logging as collection tearDown
eos_logging:
aggregate:
- { dest: console, level: warnings, state: absent }
- - { dest: buffered, size: 480000, state: absent }
+ - { dest: buffered, level: informational, size: 4096, state: absent }
+ - { facility: local7, state: absent }
become: yes
register: result
@@ -89,3 +121,4 @@
- 'result.changed == true'
- '"no logging console" in result.commands'
- '"no logging buffered" in result.commands'
+ - '"no logging facility local7" in result.commands'