mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Check sysctl no name (#25041)
* add integration tests for no name on sysctl * better error validation, add test for no value
This commit is contained in:
parent
c51b73d800
commit
1267567556
1 changed files with 28 additions and 0 deletions
|
@ -89,3 +89,31 @@
|
||||||
- 'sysctl_test2.changed is defined'
|
- 'sysctl_test2.changed is defined'
|
||||||
- 'sysctl_test2.changed'
|
- 'sysctl_test2.changed'
|
||||||
- 'sysctl_check2.stdout_lines == ["net.ipv4.ip_forward = 1"]'
|
- 'sysctl_check2.stdout_lines == ["net.ipv4.ip_forward = 1"]'
|
||||||
|
|
||||||
|
- name: Try sysctl with no name
|
||||||
|
sysctl:
|
||||||
|
name:
|
||||||
|
value: 1
|
||||||
|
sysctl_set: yes
|
||||||
|
ignore_errors: True
|
||||||
|
register: sysctl_no_name
|
||||||
|
|
||||||
|
- name: validate nameless results
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "sysctl_no_name|failed"
|
||||||
|
- "sysctl_no_name.msg == 'name can not be None'"
|
||||||
|
|
||||||
|
- name: Try sysctl with no value
|
||||||
|
sysctl:
|
||||||
|
name: Foo
|
||||||
|
value:
|
||||||
|
sysctl_set: yes
|
||||||
|
ignore_errors: True
|
||||||
|
register: sysctl_no_value
|
||||||
|
|
||||||
|
- name: validate nameless results
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "sysctl_no_value|failed"
|
||||||
|
- "sysctl_no_value.msg == 'value can not be None'"
|
Loading…
Add table
Add a link
Reference in a new issue