Skip to content

Commit

Permalink
test(pillar): ensure special is being tested as well
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Oct 15, 2019
1 parent 33f344c commit 951a959
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ script:
# yamllint disable rule:line-length
# Converge and verify the instance; `saltcheck` relies upon the `converge` as well
- bin/kitchen verify "${INSTANCE}"
# If a `develop` instance, get the appropriate version of `saltcheck.py` (temporary)
# If a `develop` instance, get the appropriate version of `saltcheck.py` &
# `cron.py` (temporary)
- if [ ! -z $(echo "${INSTANCE}" | grep \\-develop-) ]; then
bin/kitchen exec "${INSTANCE}" -c
"sudo curl -o \$(find /usr/lib/ -type d -name modules | grep packages/salt/modules)/saltcheck.py
https://raw.githubusercontent.com/myii/salt/fix/add-retcode/salt/modules/saltcheck.py";
bin/kitchen exec "${INSTANCE}" -c
"sudo curl -o \$(find /usr/lib/ -type d -name modules | grep packages/salt/modules)/cron.py
https://raw.githubusercontent.com/myii/salt/fix/add-retcode/salt/modules/cron.py";
fi
# If a `develop` instance, run all of the `saltcheck` tests
- if [ ! -z $(echo "${INSTANCE}" | grep \\-develop-) ]; then
Expand Down
3 changes: 2 additions & 1 deletion cron/saltcheck-tests/config.tst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ validate_cron.{{ task }}_exists:
assertion_section: identifier
expected-return: {{ task }}

{%- for section in ['minute', 'hour', 'daymonth', 'month', 'dayweek', 'comment', 'special'] %}
{#- Note: `special` is `spec` in the module #}
{%- for section in ['minute', 'hour', 'daymonth', 'month', 'dayweek', 'comment', 'spec'] %}
{%- if section in task_options %}
validate_cron.{{ task }}_{{ section }}:
module_and_function: cron.get_entry
Expand Down
2 changes: 1 addition & 1 deletion test/salt/pillar/cron.sls
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cron:
minute: random
hour: 1
task3:
type: absent
type: present
name: echo task3 > /tmp/test3
user: root
special: '@hourly'
Expand Down

0 comments on commit 951a959

Please sign in to comment.