Commit Graph

12 Commits

Author SHA1 Message Date
Nicole Thomas
4fdb097c01 Update job_cache and keep_jobs docs to be more specific to their behavior (#33328)
* Update job_cache and keep_jobs docs to be more specific to their behavior

Also fixed a bug discovered when investigating job_cache/keep_jobs functionality
where the jid directory and files were removed by the cache cleaner, but not the
original jid clash detection directory created in /var/cache/salt/master/jobs/.

Fixes #29286

* Add testcase for the changes in the local_cache.clean_old_jobs func

* Mark tests as destructive

* Put destructive test decorator in correct location
2016-05-19 09:32:32 -07:00
Erik Johnson
855bed36c1 Check rendered YAML for invalid keys (#33213)
* Check rendered YAML for invalid keys

PyYAML will for some reason allow improper YAML, specifically double
curly-braces like ``{{ }}``, to be formed into an unhashable dict (that
is, one with a dict as a key). This commit will change the YAML renderer
such that the rendered data is recursively checked for keys that are
dicts, and raises an SaltRenderError if such a key is encountered.

Resolves #33073.

* Fix smtp returner test

This test was using jinja placeholders but was not passing the template
through the jinja renderer. This commit adds the use of the jinja
renderer to this test to fix the failure caused by the addition of
verification of the loaded YAML inthe previous commit.
2016-05-13 09:22:43 -07:00
Justin Findlay
0d8f865c9f update smtp returner unit tests 2015-05-11 00:23:28 -06:00
Pedro Algarvio
60f215f191 Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
Gareth J. Greenaway
c87d91ee82 Consolidating the _get_options function from all the returners that were using it into the config module. Additionally some cleanup and ability to pass defaults to the get_returner_options function.
fixing lint issues

moving the get_options function into a utils.py under returners.  previous attempt at using a call to the salt config module doesn't work if the returner is called from the scheduler.

adding missing docstring

Unit tests were failing for SMTP returner because __opts__ was not available.  Ensuring it's available, empty, if it doesn't already exist.

removing the check and population with an empty dict for __salt__ and __opts__.  Adding an empty __opts__ to the smtp returner unit tests.
2014-09-03 13:56:48 -07:00
Mike Place
11e6ddf33c Fix SMTP test
Magic or ugly hack? You decide.
2014-05-29 16:38:59 -06:00
Mike Place
0e53190996 Fix broken tests
Thanks to @rallytime for pointing out that several unit tests
were not working correctly when run locally.

I have fixed the perm_test to no longer use relative paths. I have
also disabled this tests since, at some point at least, perms changed
to be 0664 instead of 0644 in a number of places. This warrents further
discussion.

I have fixed pydsl_test to no longer throw errors to stdout about
missing SLS files. (Yay!!)

I have fixed the smtp_return tests so that it will without errors
on hosts with gnupg installed.
2014-05-29 15:04:11 -06:00
Pedro Algarvio
4d7ca91424 Remove unnecessary ©️ and :license: from file headers 2014-05-26 19:26:15 +01:00
Pedro Algarvio
e66432f593 Allow standalone test execution 2014-03-31 03:04:05 +01:00
Pedro Algarvio
cfff985043 Remove unused imports 2014-02-08 08:09:48 +00:00
Thomas S Hatch
aa4bdc043b Fix pylint errors in tests 2013-11-27 10:50:55 -07:00
Mike Place
4108fb72a2 Unit-test SMTP returner. 2013-11-27 10:10:51 -07:00