Skip to content

Commit

Permalink
Generate test files with the new Ansible managed comment format
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Sep 22, 2021
1 parent 0372e73 commit 9c8abed
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
5 changes: 4 additions & 1 deletion tests/tests_basics_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,13 @@
__logging_file: "{{ __default_system_log }}"
include_tasks: tasks/test_logger.yml

- name: Generated a file to check severity_and_facility
- name: Generate a file to check severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand All @@ -365,6 +367,7 @@
}
mode: '0600'


- name: Check severity_and_facility
command: diff -B /tmp/__testfile__ '{{ __test_forwards_conf }}'
changed_when: false
Expand Down
32 changes: 24 additions & 8 deletions tests/tests_basics_forwards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@
- ca-certificates
include_tasks: tasks/check_packages.yml

- name: Generated a file to check severity_and_facility
- name: Generate a file to check severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand All @@ -131,11 +133,13 @@
command: diff -B /tmp/__testfile__ '{{ __test_forward_conf_s_f }}'
changed_when: false

- name: Generated a file to check facility_only
- name: Generate a file to check facility_only
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_facility_only") {
local2.* action(name="forwards_facility_only"
type="omfwd"
Expand All @@ -150,11 +154,13 @@
command: diff -B /tmp/__testfile__ '{{ __test_forward_conf_f }}'
changed_when: false

- name: Generated a file to check severity_only
- name: Generate a file to check severity_only
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_only") {
*.err action(name="forwards_severity_only"
type="omfwd"
Expand All @@ -169,11 +175,13 @@
command: diff -B /tmp/__testfile__ '{{ __test_forward_conf_s }}'
changed_when: false

- name: Generated a file to check no_severity_and_facility
- name: Generate a file to check no_severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_no_severity_and_facility") {
*.* action(name="forwards_no_severity_and_facility"
type="omfwd"
Expand All @@ -188,11 +196,13 @@
command: diff -B /tmp/__testfile__ '{{ __test_forward_conf_no }}'
changed_when: false

- name: Generated a file to check no_severity_and_facility_udp
- name: Generate a file to check no_severity_and_facility_udp
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_no_severity_and_facility_udp") {
*.* action(name="forwards_no_severity_and_facility_udp"
type="omfwd"
Expand All @@ -207,11 +217,13 @@
command: diff -B /tmp/__testfile__ '{{ __test_forward_conf_no_udp }}'
changed_when: false

- name: Generated a file to check no_severity_and_facility_protocol_port
- name: Generate a file to check no_severity_and_facility_protocol_port
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_no_severity_and_facility_protocol_port") {
*.* action(name="forwards_no_severity_and_facility_protocol_port"
type="omfwd"
Expand Down Expand Up @@ -371,11 +383,13 @@
- ca-certificates
include_tasks: tasks/check_packages.yml

- name: Generated a file to check severity_and_facility
- name: Generate a file to check severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down Expand Up @@ -497,11 +511,13 @@
- ca-certificates
include_tasks: tasks/check_packages.yml

- name: Generated a file to check severity_and_facility
- name: Generate a file to check severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down
8 changes: 6 additions & 2 deletions tests/tests_combination.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@
__logging_file: "{{ __default_system_log }}"
include_tasks: tasks/test_logger.yml

- name: Generated a file to check severity_and_facility
- name: Generate a file to check severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down Expand Up @@ -322,11 +324,13 @@
register: __result
failed_when: not __result.stat.exists

- name: Generated a file to check severity_and_facility
- name: Generate a file to check severity_and_facility
copy:
dest: /tmp/__testfile__
content: |
#
# Ansible managed
#
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down

0 comments on commit 9c8abed

Please sign in to comment.