Skip to content

Commit

Permalink
Fixing the file counting code in the tests.
Browse files Browse the repository at this point in the history
The logging test playbooks checks the generated rsyslog config file
count first to capture the failure at the early stage. The count
could be influenced by the other applications which put its config
file in /etc/rsyslog.d. The extra count was considered, but it
was not strict enough to reduce the error.

Since the config file name generated by the logging role starts
with '[0-9][0-9]-', thus adding it to the find patterns to make
the generated file count more accurate.
Note: Most additional config files do not start with '[0-9][0-9]-',
but there is an exception 21-cloudinit.conf.
  • Loading branch information
nhosoi committed Aug 20, 2020
1 parent 3cc3579 commit fe3f658
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/set_rsyslog_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
- name: Get file counts in /etc/rsyslog.d
find:
paths: /etc/rsyslog.d
patterns: '*.conf,*.template,*.remote,*.rulebase'
patterns: '[0-9][0-9]-*.conf,*.template,*.remote,*.rulebase'
register: rsyslog_d_file_count

0 comments on commit fe3f658

Please sign in to comment.