From 951a95980ab7fbf65475eb9619a595d51a4cfc29 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 15 Oct 2019 22:10:07 +0100 Subject: [PATCH] test(pillar): ensure `special` is being tested as well --- .travis.yml | 6 +++++- cron/saltcheck-tests/config.tst | 3 ++- test/salt/pillar/cron.sls | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27992af..f799d7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/cron/saltcheck-tests/config.tst b/cron/saltcheck-tests/config.tst index 5d6b8e1..2206f55 100644 --- a/cron/saltcheck-tests/config.tst +++ b/cron/saltcheck-tests/config.tst @@ -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 diff --git a/test/salt/pillar/cron.sls b/test/salt/pillar/cron.sls index bad5a78..1d3e2b4 100644 --- a/test/salt/pillar/cron.sls +++ b/test/salt/pillar/cron.sls @@ -21,7 +21,7 @@ cron: minute: random hour: 1 task3: - type: absent + type: present name: echo task3 > /tmp/test3 user: root special: '@hourly'