Commit Graph

32 Commits

Author SHA1 Message Date
Erik Johnson
93ee5ee2b0
Fix all Sphinx warnings
Well, all but one, which we expect to see
2018-05-31 15:28:25 -05:00
Nicole Thomas
6c80d90bb6
Merge pull request #46693 from dwoz/test_smtp_return
File and Pillar roots are dictionaries
2018-03-26 11:15:37 -04:00
Daniel A. Wozniak
5bf850c67f
File and Pillar roots are dictionaries
Fixes test_smtp_return test cases.
2018-03-23 11:42:14 -07:00
twangboy
8d93156604
Fix unit.returners.test_local_cache for Windows
time.time is only precise to 3 decimal places in Windows. This adds a
sleep for .25 seconds to allow the test to pass
Also fixes a lint error
2018-03-21 16:00:52 +00:00
Daniel Wallace
d18f1a55a7
fix pylint 2018-03-09 08:23:17 -07:00
Daniel Wallace
9e2c3f7991
split return key value correctly 2018-03-08 13:38:52 -07:00
twangboy
9b61533b09 Get more accurate currnet time in local_cache 2017-07-05 12:19:20 -06:00
twangboy
844e3f65bc Fix unit tests for Windows 2017-07-05 12:03:13 -06:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
8031ac0209
Move mixins to tests.support.mixins.
The adapted config mixin get config methods are not static methods
2017-04-04 17:29:34 +01:00
Pedro Algarvio
e2a5b1bf54
Use a temporary configuration instead 2017-04-01 18:56:46 +01:00
Pedro Algarvio
d05028e88c
These are not integration tests 2017-04-01 14:22:51 +01:00
Pedro Algarvio
8560d8a6d3
Proper mocking. Tests are not destructive. 2017-03-28 19:04:03 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
e7768705f9
Allow passing different loader_module_globals per loader_module 2017-03-28 19:02:51 +01:00
Pedro Algarvio
9b1e55aa85
Import the full module namespace to avoid import shadowing.
https://github.com/saltstack/salt/pull/39996#issuecomment-287857698
2017-03-28 19:02:47 +01:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Nicole Thomas
336fbb03bc [develop] Merge forward from 2016.3 to develop (#33408)
* Fix master hanging after a request from minion with removed key. (#33333)

* ZMQ monitor for MWorker connections.

* Reauth minion if the key was removed on the master side.

* Allow concurrency mode in state runs if using sudo (#33325)

Closes #30130

* Disambiguate non-exact matches when checking if sysv service is enabled (#33324)

Fixes #33323

* remove redundant, incorrect sudo_runas config documentation (#33318)

* remove sudo_runas documentation

`sudo_runas` was renamed to `sudo_user` and the documentation was not
updated accordingly.

* conf/minion: update sudo_user description

The description from sudo_runas was better.

* import ps from psutil_compat in beacons (#33334)

* beacons.network_info: import gate psutil

* beacons.ps: import gate psutil

* Add docs for mine_functions config var (#33326)

* Add docs for mine_functions config var

* Note that mine_enabled essentially just doesn't add the mine
update function to the scheduler.

* Bp 28467 calm mine (#33327)

* make minion mine update behavior more configurable

* Add docs for mine_functions config var

* Remove config dup from mine config options

Refs #28467

* 2015.8 does not have _DFLT_MULTIPROCESSING_MODE

* This won't be in until 2015.8.10.

* Fix network.managed for windows (#33312)

* Fix some link errors in the test writing tutorial (#33347)

* Describes parameters in register_instances function (#33339)

* Fix UnboundLocalError in git.latest (#33340)

Resolves #32260.

* Expanded documentation for boto_elb state and module (#33341)

* Describes what happens when the CNAME parameter is given.

* Describes what the recognized attributes are for for ELBs.

* Properly detect newer Linux Mint distros (#33359)

* Properly detect newer Linux Mint distros

LMDE 2 and Linux Mint 17.3 changed the DISTRIB_ID in /etc/lsb-release to
``LinuxMint``, breaking OS detection for these distros.

This commit fixes that by adding an entry to the OS_NAME_MAP in the core
grains.

* Remove LinuxMint os_family from aptpkg.py

It is no longer necessary as the distro is now detected properly, which
will lead to an os_family of Debian.

* 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

* Remove mentions of windows not supporting pkgs param (#33361)

Fixes #33313

* Updates docs version to 2015.8.9
Adds note regarding the os grain on Mint Linux
Adds an FAQ regarding grains that change due to upstream changes

* revved 2015.8 branch to .9 in version selector

* Add initscripts, SystemD service units and environment files for Debian (#32857)

* Add note to docs about api settings for Hipchat API v2 (#33365)

Fixes #27779

* Add win_pkg to list of modules that support "version" in pkg.installed (#33362)

Fixes #32913

* Add note about name parameter in git_pillar docs (#33369)

Fixes #27737

* Better YAML syntax error handling (#33375)

Closes #26574

* Improve doc clarity for disable_modules documentation (#33379)

* Improve doc clarity for disable_modules documentation

* Additional clarification on blacklisted name

* maintain the fallabck because I am totally sick of this crap

* blast, put the try/except int he right place

* restore whitespace

* Fix traceback in logging for config validation (#33386)

* 2015.8.10 release notes

* Sync pillarstack to latest upstream version (#33391)

* Don't lay down all available opts (#33385)

* Don't lay down all available opts

* We need at least one opt in there

* Condense defaults

* Put the default hash type back
2016-05-20 13:48:40 -07:00
Dmitry Kuzmenko
17b03e9d8b Allow to blacklist/whitelist renderers. (#33358)
* Allow to blacklist/whitelist renderers.

* Fix tests.

* Unit test for renderer blacklisting.

* Minor tests fixes
2016-05-20 10:41:51 -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