Commit Graph

5863 Commits

Author SHA1 Message Date
Pedro Algarvio
d65742c066
Delete attributes 2017-04-28 13:36:44 +01:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
4b59c351e4
This branch no longer targets py 2.6 2017-04-28 13:33:37 +01:00
Pedro Algarvio
9a3f6d1350
Properly handle non native strings under py2 and py3 2017-04-28 13:33:36 +01:00
Pedro Algarvio
5ed3d8d98c
Don't error out because of bad file descriptor errors 2017-04-28 13:33:36 +01:00
Pedro Algarvio
102d63e238
Use self.addCleanup instead 2017-04-28 13:33:36 +01:00
Pedro Algarvio
ef3dbb10de
Lint fixes 2017-04-28 13:33:35 +01:00
Pedro Algarvio
9ffc79ca67
Use tornado HTTPClient directly. 2017-04-28 13:33:35 +01:00
Pedro Algarvio
80b80e5416
Fix cherrypy memory leakage
* Clean its event/signal bus since our tests don't rely on those.
* No test class level dictionaries
2017-04-28 13:33:35 +01:00
Pedro Algarvio
3bf84e2a4e
Rename classes in order not to be collected up by pytest 2017-04-28 13:33:34 +01:00
Pedro Algarvio
7480a8e5fb
Check status on setUp not on the module level @skipIf decorator 2017-04-28 13:33:34 +01:00
Pedro Algarvio
6eac0ee132
Call tearDown and not setUp
@cachedout with this change, the FD's still attached code will always
fail, so, for now, that's just commented out.
When you wrote this, did tornado eventually cleaned these FD's?
2017-04-28 13:33:34 +01:00
Pedro Algarvio
6364128ad3
Fix tornado test cases 2017-04-28 13:33:34 +01:00
Pedro Algarvio
701280ae18
Cleanup 2017-04-28 13:33:33 +01:00
Pedro Algarvio
75569c8e99
unittest.TestCase does not have a skip() method. It's skipTest. 2017-04-28 13:33:33 +01:00
Pedro Algarvio
1d8f02f635
Drop @patch usage. Py3 Compat. 2017-04-28 13:33:32 +01:00
twangboy
e8d440b543 Mock win32api instead of win32gui 2017-04-26 12:41:13 -06:00
rallytime
2f1998ac00 Pylint extra space 2017-04-25 16:41:39 -06:00
rallytime
ad9914353b Pylint fixes 2017-04-25 14:18:50 -06:00
rallytime
c3f4874c21 Pylint fixes and rework new test in dimensiondata cloud unit tests 2017-04-25 11:06:55 -06:00
rallytime
8e24b3a8b2 Pylint fixes for some cloud unit tests 2017-04-25 11:06:39 -06:00
twangboy
fa8f9b55d8 Fix unit test, still mocking SendMessageTimout 2017-04-25 10:13:55 -06:00
rallytime
7f14a6491e Rename nova and openstack unit tests to test_*.py 2017-04-25 09:27:11 -06:00
rallytime
5372f25fde Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/cloud/clouds/rackspace.py
  - tests/unit/cloud/clouds/test_dimensiondata.py
2017-04-24 15:35:28 -06:00
Bo Maryniuk
f71af0b625 Fix lint issues 2017-04-24 18:46:27 +02:00
Bo Maryniuk
0e6abb3e37 Add UT on set_hw_clock on Gentoo 2017-04-24 16:08:22 +02:00
Bo Maryniuk
a2b1d4638c Add UT for set_hwclock on Debian 2017-04-24 16:08:22 +02:00
Bo Maryniuk
88e8184702 Add UT set_hwclock on SUSE 2017-04-24 16:08:22 +02:00
Bo Maryniuk
0cd590f927 Fix UT names 2017-04-24 16:08:22 +02:00
Bo Maryniuk
bee94ade63 Add UT for set_hwclock on RedHat 2017-04-24 16:08:22 +02:00
Bo Maryniuk
dfe2610d05 Add UT for set_hwclock on Arch 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d000a8a6f5 Add UT for set_hwclock on solaris 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d2614aedaa Fix docstrings 2017-04-24 16:08:22 +02:00
Bo Maryniuk
6d782191dc Add UT for set_hwclock on AIX 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d303e0dd8a Add UT for AIX on get_hwclock 2017-04-24 16:08:22 +02:00
Bo Maryniuk
86f2d83781 Add UT on Solaris 2017-04-24 16:08:22 +02:00
Bo Maryniuk
c3cafed6d5 Add UT for Debian on get_hwclock 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d337c09357 Add UT for RedHat/SUSE platforms on get_hwclock 2017-04-24 16:08:22 +02:00
Bo Maryniuk
f25dc5c56c Add UT for get_hwclock on SUSE platform 2017-04-24 16:08:22 +02:00
Bo Maryniuk
08e00c865c Remove dead code 2017-04-24 16:08:22 +02:00
Bo Maryniuk
1216a0bf12 Add UT for get_hwclock on UTC/localtime 2017-04-24 16:08:22 +02:00
Bo Maryniuk
58676c568d Add UT for Debian on set_zone 2017-04-24 16:08:22 +02:00
Bo Maryniuk
1b9ce37b1b Add UT for gentoo on set_zone 2017-04-24 16:08:22 +02:00
Bo Maryniuk
6ed9be985e Adjust UT to use correct grain for SUSE series 2017-04-24 16:08:22 +02:00
Bo Maryniuk
ce4c836a60 Add UT for set_zone on SUSE series 2017-04-24 16:08:22 +02:00
Bo Maryniuk
155a498b49 Doc fix 2017-04-24 16:08:22 +02:00
Bo Maryniuk
a40876cdac Remove unnecessary mock patch 2017-04-24 16:08:22 +02:00
Bo Maryniuk
ffab2db213 Fix doc for RH UT 2017-04-24 16:08:22 +02:00
Bo Maryniuk
72388f7ae2 Add UT for RedHat's set_zone 2017-04-24 16:08:22 +02:00
Bo Maryniuk
11595d3a42 Refactor with setup/teardown 2017-04-24 16:08:22 +02:00
Bo Maryniuk
28072c9e41 Adjust the test so it is using the right grain for SUSE systems 2017-04-24 16:08:22 +02:00
Bo Maryniuk
7a0e4be4f8 Add unit test for get_zone and various platforms 2017-04-24 16:08:22 +02:00
Bo Maryniuk
116c96a4b7 Fix UT parameter changes 2017-04-22 10:08:20 +02:00
Bo Maryniuk
ed84420df0 Add unit test for node ip filtering 2017-04-22 10:08:20 +02:00
Bo Maryniuk
82582cff77 Skip test, if libcloud is not around 2017-04-22 10:08:20 +02:00
Bo Maryniuk
f005d53c56 Fix name error exception 2017-04-22 10:08:20 +02:00
Bo Maryniuk
5e574a24d9 Add unit test for nova connector 2017-04-22 10:08:19 +02:00
Bo Maryniuk
cd43805770 Add initial unit test for openstack cloud module 2017-04-22 10:08:19 +02:00
Bo Maryniuk
177f31446d Add fake preferred IP function for testing 2017-04-22 10:08:19 +02:00
rallytime
d5b1241972 Skip tsl unit test when we hit an error due to OpenSSL and junos-eznc packaging conflict
he pip junos-eznc package, when installed with PyOpenSSL version 0.14 causes
this test failure. If you either remove junos-eznc, or upgrade PyOpenSSL
(current is 0.17) the test is happy. So, we need to handle this case in the test.
2017-04-20 17:02:33 -06:00
rallytime
6493880bde Merge branch '2016.11' into 'nitrogen'
No conflicts.
2017-04-18 16:42:30 -06:00
Mike Place
2ab95b7dd5 Set minion test to use default opts 2017-04-18 08:34:57 -06:00
rallytime
292f55600b Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/fileserver/s3fs.py
  - tests/unit/test_fileclient.py
2017-04-17 13:32:56 -06:00
Nicole Thomas
77028a6c4e Merge pull request #40685 from Ch3LL/fix_mac_file
Fix errno code for filecache test for other operating systems.
2017-04-14 10:54:25 -06:00
rallytime
f552dd63f3 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - pkg/windows/installer/Salt-Minion-Setup.nsi
  - tests/unit/states/test_tomcat.py
2017-04-14 10:46:56 -06:00
Ch3LL
9ea6e8b456
remove io and change to EROFS 2017-04-13 18:10:44 -04:00
Ch3LL
688791ff60
remove try-except and change errno 2017-04-13 17:06:44 -04:00
Mike Place
ad4d6839fd Merge pull request #40675 from gtmanfred/2016.11
use loader for getting war version
2017-04-13 13:58:30 -06:00
rallytime
e440d2e8af Use self.setGrains as context manager in grains test 2017-04-13 13:39:11 -06:00
Ch3LL
e30afc4c01
add exception type 2017-04-13 15:06:12 -04:00
Ch3LL
acf333df08
change errno code for fileclient test 2017-04-13 14:56:45 -04:00
rallytime
3d6c983c69 Remove unused import for lint 2017-04-13 11:52:20 -06:00
Daniel Wallace
a61fc824c4 use loader for war extraction
Also set the version added in the docs
2017-04-13 11:51:22 -06:00
rallytime
17efc7341c Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/modules/win_wua.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/version.py
  - tests/unit/states/grains_test.py
  - tests/unit/states/test_archive.py
2017-04-13 10:14:51 -06:00
Ch3LL
60724980ec
fix test_fstype test for mac 2017-04-13 12:04:20 -04:00
Mike Place
92b5f03beb Merge pull request #40551 from terminalmage/issue39868
Fix four issues in archive.extracted state
2017-04-12 12:37:51 -06:00
Daniel Wallace
b0bd99c26d add comment and unit test 2017-04-11 21:08:06 -06:00
Mike Place
4af8d08e43 Merge pull request #40581 from terminalmage/release_notes
Make scheduled change to osmajorrrelease grain, clean up Nitrogen release notes
2017-04-11 16:49:15 -06:00
rallytime
cd0adb82d6 Spelling fix 2017-04-11 13:35:38 -06:00
rallytime
36f7a6481b Remove blacklisted loader usage of dunder variables 2017-04-11 12:16:15 -06:00
Erik Johnson
20f856f038 Update unit tests for numeric osmajorrelease 2017-04-11 12:36:36 -05:00
rallytime
67d08f60ff Fixup fileclient_test file to conform to new standards 2017-04-10 14:09:41 -06:00
rallytime
2cd0c5e4ec Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - doc/topics/cloud/azurearm.rst
  - salt/cloud/clouds/vultrpy.py
  - salt/modules/aptpkg.py
  - salt/modules/dockermod.py
  - tests/unit/modules/dockerng_test.py
  - tests/unit/modules/test_pillar.py
2017-04-10 14:09:25 -06:00
Erik Johnson
5ea1f607b0 Fix mocking in unit tests 2017-04-10 13:57:39 -05:00
rallytime
5a419b8aae Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/modules/pillar.py
2017-04-07 11:23:41 -06:00
Erik Johnson
f8bc423ef9 Merge pull request #40563 from terminalmage/merge-2016.3-2016.11
Merge-forward 2016.3 -> 2016.11
2017-04-07 10:08:19 -05:00
Erik Johnson
0c608d7417 Add client_args_mock back to test
I removed this incorrectly in resolving a merge conflict.
2017-04-07 08:50:45 -05:00
Nicole Thomas
ae13de622a Merge pull request #40451 from isbm/isbm-fileclient-testcase-2016.11
Fileclient testcase (2016.11)
2017-04-06 13:53:30 -06:00
Mike Place
56363bc41c Merge pull request #40462 from cachedout/state_expect_minions
Fix orch state when no minions return
2017-04-06 11:58:14 -06:00
Erik Johnson
cb4db56eb5 Allow pillar.get to merge list as well as dictionaries
This also gets rid of the exception that used to be raised when the
default was not of the proper type, and instead skips merging in those
cases.
2017-04-06 12:24:22 -05:00
Mike Place
60750a1619
Fix test 2017-04-06 10:48:27 -06:00
Erik Johnson
a6d68f50fe Merge remote-tracking branch 'upstream/2016.3' into merge-2016.3-2016.11 2017-04-06 10:15:47 -05:00
Pedro Algarvio
843e218572
Remove unmocked patching 2017-04-05 23:17:36 +01:00
Bo Maryniuk
aba94495a5 Lintfix (Py3 code compat) 2017-04-05 22:56:29 +02:00
Nicole Thomas
4d7871e4d7 Merge pull request #40494 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-04-05 14:15:05 -06:00
rallytime
71f3c73150 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/template.py
  - salt/utils/pycrypto.py
  - tests/integration/modules/test_state.py
  - tests/unit/states/test_artifactory.py
  - tests/unit/test_template.py
2017-04-05 13:02:14 -06:00
Nicole Thomas
59db716817 Merge pull request #40510 from twangboy/deprecate_win_update
Add deprecation warnings to win_update state and execution modules
2017-04-05 11:47:56 -06:00
Mike Place
ee5f891002 Merge pull request #40523 from s0undt3ch/features/py3
[WIP] A Little House Keeping and Addressing Py3 test suite leakage
2017-04-05 10:58:32 -06:00
twangboy
70b61dda39 Fix unit tests, spell Fluorine correctly 2017-04-04 23:42:36 -06:00
Erik Johnson
78b4798b1b Update compile_template test to use StringIO 2017-04-04 15:41:43 -05:00
Erik Johnson
a6183d93d3 Preserve windows newlines in salt.template.compile_template()
Test included.
2017-04-04 15:41:43 -05:00
Mike Place
8da27c9e1d Merge pull request #40306 from terminalmage/issue40279
Don't use context caching for gathering systemd services
2017-04-04 14:36:38 -06:00
Mike Place
0ed385210f Merge pull request #40465 from rallytime/fix-37699
Artifactory Execution & State Module: Fixup Error Handling
2017-04-04 14:12:21 -06:00
Mike Place
778c1c94bd Merge pull request #40522 from carlpett/vault-fix-master-minion
Salt-vault: Fix handling of None-grains
2017-04-04 13:33:56 -06:00
Pedro Algarvio
7b713d9256
Use the more portable helper skip_if_not_root. 2017-04-04 18:58:21 +01:00
Pedro Algarvio
dcf0a55daf
Use the test run temporary path, not the system temporary path 2017-04-04 18:58:21 +01:00
Pedro Algarvio
de9ccbdb43
Fix mocked test 2017-04-04 18:58:21 +01:00
Pedro Algarvio
61003bca0a
Take care of resource leakage on tests 2017-04-04 18:58:20 +01:00
Pedro Algarvio
e6f43b46c0
Import from the original modules 2017-04-04 18:58:20 +01:00
Pedro Algarvio
4a43d00d80
Proper mocking 2017-04-04 18:58:19 +01:00
Pedro Algarvio
2ee6d5d589
Import from the original modules not tests.integration 2017-04-04 18:58:19 +01:00
Pedro Algarvio
4853952f1f
Use a temporary config 2017-04-04 18:04:38 +01:00
Pedro Algarvio
785698d2ce
Import for the original module 2017-04-04 18:04:38 +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
Mike Place
6056ee302a Merge pull request #40339 from s0undt3ch/features/py3-pt2
[WIP] Move unit tests which were in integration tests - More py3 and mocking fixes
2017-04-04 10:21:46 -06:00
Nicole Thomas
579794dd64 Remove extra blank line for lint 2017-04-04 10:20:31 -06:00
Calle Pettersson
c5d33ba065 Salt-vault: Fix handling of None-grains 2017-04-04 16:50:35 +02:00
Eric Radman
3299f5b2ea Add mocks to allow keyboard tests to function on non-Linux systems 2017-04-03 22:11:38 -04:00
Mike Place
17808e7181 Merge pull request #40480 from terminalmage/docker-auth-handling
Improved Docker auth handling and other misc. Docker improvements
2017-04-03 16:44:48 -06:00
Mike Place
55fa3c12fa Merge pull request #39874 from kiorky/fixup_fail_rc
Make returncode friendly to onfail requisites
2017-04-03 15:28:50 -06:00
Erik Johnson
c526e8c7b0 Improved Docker auth handling and other misc. Docker improvements
This commit changes how we handle Docker authentication. We no longer
try to auth when pushing/pulling images. This was initially done based
on a misunderstanding of how authentication was handled in docker-py.
docker-py will automagically use the base64-encoded username/password
combination stored in config.json if present, so we don't need to auth
at all for push or pull, docker-py will handle all of that. We just need
to make sure that we get the auth info into the config.json. To do this
I have added a login() function to the execution module, which uses the
Docker CLI to authenticate (with output_loglevel set to "quiet" to
suppress any logging of the credentials). The CLI is used in this
instance because docker-py provides no interface by which to persist a
login in the config.json; it can read from the file, but is not designed
to *write* to it. Rather than trying to write to this file ourselves,
and potentially breaking it when (not *if*) Docker decides to change the
internal format of the JSON data structure, using the CLI is a way of
future-proofing the authentication logic.

Context caching of the docker-py client instance has also been removed.
Context caching was used based on the same incorrect understanding of
how docker-py handles authentication, and sought to avoid repeated login
attempts. As that is no longer a concern, there is no need to cache the
client instance in the context dunder because we don't really gain a
performance benefit from it.

The _image_wrapper() function has been removed, as it no longer serves
any purpose, and the image-specific code in it that was still needed
has been absorbed into the _client_wrapper() helper. The functions which
used the _image_wrapper() helper (like push() and pull()) now use
_client_wrapper().

Additionally, the decorators used to enforce a minimum Docker version
(or Docker API version) have been removed. These are not necessary since
docker-py handles raising exceptions when a given feature is not
supported by the effective API version. The _client_wrapper() helper
function now checks for miscellaneous docker exceptions by catching the
docker.errors.DockerException class, which is the base class for the
custom exceptions raised by docker-py, and by doing so catches exceptions
raised due to API version incompatibility (and more).

The list of functions in the top-level docstring has been removed as it
is very out-of-date, and is somewhat superfluous anyway given that we
have for some time now had a list of the functions on the right side of
the page in the documentation.

Other changes:

- Fixed a bug I introduced when I overhauled the
  docker_container.running state, in which a container with no changes
  to be made, which was not running, would be started by the state even
  when test=True was passed.
- Custom registry image names are now properly identified. The colon in
  the hostname of the custom registry was previously causing incorrect
  identification of the image name and tag, when no explicit tag was
  being passed (e.g. localhost:5000/myimage).
- When configuring credentials, the creds for the Docker Hub can be
  configured under a registry named ``hub``. This keeps the user from
  having to figure out the registry URL and configure it in their Pillar
  data, and thus makes using this module easier.
- Removes the email address from the documentation for credential
  configuration. This was probably initially added because docker-py
  accepts it as an argument, but it is entirely ignored for purposes of
  authentication (even by docker-py) and is thus unnecessary. Relic of
  an earlier time in Docker's history, perhaps?
- Fixed RST references to functions which weren't caught when this
  module was renamed to dockermod.py
- Allow filter arguments in docker.networks to be passed as a
  comma-separated list as well as a Python list, in keeping with general
  usage elsewhere in Salt.
2017-04-03 13:29:28 -05:00
Erik Johnson
1e2a04cfc5 Backport auth and custom registry fixes from #40480 to 2016.3 branch 2017-04-03 13:20:53 -05:00
rallytime
24e812add6 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/cache/__init__.py
  - salt/grains/core.py
  - salt/utils/gitfs.py
  - tests/unit/cache/test_localfs.py
  - tests/unit/modules/test_ssh.py
2017-04-03 10:17:11 -06:00
Pedro Algarvio
d198a900a4
Remove unused imports 2017-04-01 19:01:09 +01:00
Pedro Algarvio
d6d3161f80
Use a temporary configuration instead 2017-04-01 19:00:14 +01:00
Pedro Algarvio
9fd126c904
Use a temporary configuration instead 2017-04-01 18:58:03 +01:00
Pedro Algarvio
c6fce40a2a
Use a temporary configuration instead 2017-04-01 18:57:25 +01:00
Pedro Algarvio
e2a5b1bf54
Use a temporary configuration instead 2017-04-01 18:56:46 +01:00
Pedro Algarvio
ec7182a292
Use a temporary configuration instead 2017-04-01 18:55:48 +01:00
Pedro Algarvio
f66eaa45bf
Use a temporary configuration 2017-04-01 14:30:27 +01:00
Pedro Algarvio
2ebd04e7ce
Use a temporary configuration 2017-04-01 14:26:11 +01:00
Pedro Algarvio
4f068f5217
Misplaced test. Use tests.support.unit instead. 2017-04-01 14:23:00 +01:00
Pedro Algarvio
f8d7530a58
Proper mocking. 2017-04-01 14:22:59 +01:00
Pedro Algarvio
a15aa32404
Proper mocking. 2017-04-01 14:22:59 +01:00
Pedro Algarvio
a0245b049f
Proper mocking. 2017-04-01 14:22:59 +01:00
Pedro Algarvio
22b15a134e
Proper mocking. 2017-04-01 14:22:58 +01:00
Pedro Algarvio
06bc81dc3d
Proper mocking. 2017-04-01 14:22:58 +01:00
Pedro Algarvio
3a5ec6bb0a
Minor lint fix 2017-04-01 14:22:58 +01:00
Pedro Algarvio
9a11538b54
Stop using deprecated TestCase methods 2017-04-01 14:22:57 +01:00
Pedro Algarvio
c28f896adb
Py3 compat 2017-04-01 14:22:57 +01:00
Pedro Algarvio
c42b6ff4b5
This just feels wrong 2017-04-01 14:22:56 +01:00
Pedro Algarvio
82eea9057a
Proper mocking 2017-04-01 14:22:56 +01:00
Pedro Algarvio
83db7547e7
Proper mocking. 2017-04-01 14:22:55 +01:00
Pedro Algarvio
9dbdee68ba
Move tests to the right test module 2017-04-01 14:22:54 +01:00
Pedro Algarvio
4ef895e064
Add file to ignored paths 2017-04-01 14:22:54 +01:00
Pedro Algarvio
e72ab757a9
Use random ports. Tests cleanup. 2017-04-01 14:22:54 +01:00
Pedro Algarvio
f9b58aa2e2
This is not an integration test. Skip test.
Skipping tests since I have no clue what is supposed to be tested here
with that `raise Exception(ret)` at the end.
2017-04-01 14:22:53 +01:00
Pedro Algarvio
cde0af757e
Update tests to the new sorting 2017-04-01 14:22:53 +01:00
Pedro Algarvio
dc7169f8bd
Rename decorators in order not to be picked up by pytest as test cases 2017-04-01 14:22:53 +01:00
Pedro Algarvio
da7192014e
Py3 compat 2017-04-01 14:22:52 +01:00
Pedro Algarvio
d05028e88c
These are not integration tests 2017-04-01 14:22:51 +01:00
rallytime
8f084f7056 Update unit test to look for actual string comment 2017-03-31 15:34:24 -06:00
Mike Place
fdb0250c95 Merge pull request #40429 from DSRCorporation/features/39275_memcache
MemCache - a minion data cache booster.
2017-03-31 14:20:59 -06:00
rallytime
55405bcd30 Renamed unit.modules.tuned_test.py to test_tuned.py and updated salttesting imports 2017-03-31 12:23:46 -06:00
Dmitry Kuzmenko
4475d1757d In-memory minion data cache. 2017-03-31 19:38:04 +03:00
rallytime
2d73fca4d0 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/cloud/clouds/vmware.py
  - salt/modules/win_dsc.py
  - salt/modules/win_psget.py
  - tests/unit/utils/vmware_test/test_cluster.py
  - tests/unit/utils/vmware_test/test_common.py
  - tests/unit/utils/vmware_test/test_connection.py
  - tests/unit/utils/vmware_test/test_datacenter.py
  - tests/unit/utils/vmware_test/test_host.py
2017-03-31 10:09:56 -06:00
rallytime
0da4c46b68 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/utils/__init__.py
  - salt/utils/gitfs.py
  - tests/unit/modules/ssh_test.py
2017-03-31 09:59:59 -06:00
Bo Maryniuk
9f9dc6e4e7 Add unit test case for fileclient 2017-03-31 13:40:36 +02:00
rajvidhimar
8d83d482c5 Correct the junos unit tests which mock getattr 2017-03-31 16:19:21 +05:30
Mike Place
c26f4cc76c Merge pull request #40371 from terminalmage/pr-40344
Fix path handling for masterless gitfs on Windows
2017-03-30 16:36:20 -06:00
Mike Place
132d8b7b88 Merge pull request #40376 from nmadhok/2016.11
Backporting changes in vmware cloud driver from develop branch to 2016.11 branch
2017-03-30 16:35:12 -06:00
Mathieu Le Marec - Pasquet
0c7317e6ea Add a flag to mark onfail states as handlable 2017-03-31 00:22:59 +02:00
Mathieu Le Marec - Pasquet
fa2f9cf7bd Make returncode friendly to onfail requisites
Ensure that correctly handled states execution (via onfail)
will return a 0 code if onfail requisites suceed.
2017-03-31 00:22:51 +02:00
Nicole Thomas
fbbe0127f5 Merge pull request #40432 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-03-30 15:57:57 -06:00
Mike Place
9d19bb635c Merge pull request #40428 from rallytime/statemod-test-fix
Update mocking for unit.test_statemod tests
2017-03-30 15:37:10 -06:00
Lukas Raska
24cc9b2a0c [WIP] Refactor Elasticsearch execution and state modules (#40192)
* Add Ingest pipeline methods to Elasticsearch execution module

* Refactor Elasticsearch execution module and properly handle exceptions

* Throw CommandExecutionError in methods applicable for different Elasticsearch versions

* Refactor Elasticsearch states to reflect execution module changes

* Add state for managing Elasticsearch pipelines

* Fix few typos in Elasticsearch module, return None when deleted document doesn't exist

* Implements stats and health methods for Elasticsearch

* Add Elasticsearch methods to open/close index, manage search templates and repositories

* Merge existing Elasticsearch states into single one, add Search Template handling

* Add index alias state for Elasticsearch, fix documentation

* Catch all global exceptions in Elasticsearch states, unit test all of them

* Implement few Unit tests for Elasticsearch execution module, merge fixes into deprecated elastic states

* Implement additional unit tests for Elasticsearch execution module

* Finalize Elasticsearch module documentation
2017-03-30 13:22:58 -06:00
rallytime
1792acedc0 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/template.py
  - tests/unit/modules/dockerng_test.py
2017-03-30 12:32:24 -06:00
rallytime
ebfc7b98ef Update mocking for unit.test_statemod tests 2017-03-30 11:10:01 -06:00
rallytime
762e08634a Skip 2 junos module unit tests: "salt.modules.junos.getattr" patch stacktraces 2017-03-30 10:10:16 -06:00
Dheeraj
77a40a0c44 Lint fixes 2017-03-30 10:31:16 +05:30
Dheeraj
8c1adfafd5 More complete fix for 39692
The existing fix did not work if the profile name itself had a dash `-`.
For example - `virtual-guest`. This commit fixes that by using `split('- ')`
rather than `split('-')`. This commit also provides two simple tests for the
`list_()` function to emulate behaviour of both old and new tuned-adm versions

Fixes #39692
2017-03-30 10:31:16 +05:30
Nitin Madhok
dd62310941 Adding unit tests for vmware_test 2017-03-30 00:54:57 -04:00
Nitin Madhok
034ef30f7c Remove old vmware unit tests 2017-03-30 00:53:09 -04:00
rallytime
99c8dcc18e Handle AttributeError for dockerng_mod.docker attempt fails and docker is installed
When we hit that attribute error, we need to set the docker version
variable to a tuple starting with 0 so we can use it in other test
comparisons. If docker is installed, but at a lower version, we will
see this attribute error.

Fixes the test failure on the 2016.11 branch on CentOS 6 VMs.
2017-03-29 10:28:51 -06:00
rallytime
d61b9631c6 Update docker execution module unit tests for develop branch
This test module was updated for both the 2016.11 and develop
branches in different ways. This commits removes some of the
changes that were merged-forward from the 2016.11 branch and
restores the develop branch tests functionality.
2017-03-29 09:07:22 -06:00
rallytime
96259d6c63 Lint fix 2017-03-28 17:12:56 -06:00
rallytime
52edbffc85 Merge branch '2016.11' into 'develop'
Conflicts:
  - doc/ref/cache/all/index.rst
  - doc/topics/cache/index.rst
  - salt/cache/localfs.py
  - salt/modules/boto_rds.py
  - salt/roster/cloud.py
  - salt/states/virtualenv_mod.py
  - tests/integration/states/test_archive.py
  - tests/unit/modules/test_dockermod.py
  - tests/unit/states/dockerng_test.py
2017-03-28 17:09:30 -06:00
Nicole Thomas
2febd05896 Merge pull request #40372 from zer0def/pip-cache-fixes
Fixes related to cache directory argument changes in pip>=6.
2017-03-28 16:48:40 -06:00
rallytime
4f7ac1431e Create a unit test for the _replace_auth_key function in the ssh module
References Pull Request #39855
2017-03-28 16:27:53 -06:00
Erik Johnson
cafa08d8e0 Add ability for salt.utils.path_join to force the use of posixpath
Also remove unused and unnecessary behavior from this function when the
first path component is of single length. An empty first parameter to
this function will normalze to "." and result in an incorrectly-joined
result.
2017-03-28 14:18:29 -05:00
Pedro Algarvio
9383142dcc
The LoaderModuleMixin is the right approach here.
This changes sys.modules instead of mock patching it effectively
changing it while running tests. This should not happen.
2017-03-28 19:04:05 +01:00
Pedro Algarvio
4c17fad6b6
No need to use tests.unit.ModuleTestCase. Proper Mocking. 2017-03-28 19:04:04 +01:00
Pedro Algarvio
e95b7e062c
Proper mocking. Fix tests expectations. Runs on non windows too. 2017-03-28 19:04:03 +01:00
Pedro Algarvio
2b8d26b811
The develop branch no longer targets python 2.6 2017-03-28 19:04:03 +01:00
Pedro Algarvio
845cbabe97
Code cleanup. Proper mocking. 2017-03-28 19:04:03 +01:00
Pedro Algarvio
8560d8a6d3
Proper mocking. Tests are not destructive. 2017-03-28 19:04:03 +01:00
Pedro Algarvio
2dc9e1cfd0
Proper mocking. Py3 Compat. 2017-03-28 19:04:02 +01:00
Pedro Algarvio
4baabcfb1e
Proper mocking. Some additional mocking and fixes. 2017-03-28 19:04:02 +01:00
Pedro Algarvio
da5ee155d1
Proper mocking. If this fails @twangboy, let me known. 2017-03-28 19:04:02 +01:00
Pedro Algarvio
99bc71dc4e
Proper mocking. 2017-03-28 19:04:01 +01:00
Pedro Algarvio
14db38979c
Proper mocking. Py3 Compat. 2017-03-28 19:04:01 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
608402359f
Proper mocking. Windows compat. 2017-03-28 19:02:51 +01:00
Pedro Algarvio
e7768705f9
Allow passing different loader_module_globals per loader_module 2017-03-28 19:02:51 +01:00
Pedro Algarvio
93ad2cc428
Proper mocking. Code is mocked! Runs on non windows too. 2017-03-28 19:02:51 +01:00
Pedro Algarvio
5c13f7b2bb
Proper mocking. 2017-03-28 19:02:50 +01:00
Pedro Algarvio
cb532fb9ef
Code cleanup. Proper mocking. 2017-03-28 19:02:50 +01:00
Pedro Algarvio
f23596cbd1
Proper mocking. Py3 Compat. 2017-03-28 19:02:50 +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
8325a58a35
Proper mocking but I'm lost as to what is actually being tests here 2017-03-28 19:00:53 +01:00
Pedro Algarvio
a894eebf31
Code cleanup. Proper mocking!!! 2017-03-28 19:00:53 +01:00
Pedro Algarvio
5216ff0932
Code cleanup. Proper mocking 2017-03-28 19:00:52 +01:00
Pedro Algarvio
278275cf37
Fix StringVersion and LooseVersion. Add unit tests. 2017-03-28 19:00:52 +01:00
Pedro Algarvio
ea81540cce
Code cleanup. Proper mocking. 2017-03-28 19:00:52 +01:00
Pedro Algarvio
fb9c15ad07
Proper mocking. Code cleanup. 2017-03-28 19:00:52 +01:00
Pedro Algarvio
ccea1fb6a4
Proper mocking. Removed destructive tests decorator.
Creating or deleting files under a temporary directory does not apply as
a destructive test
2017-03-28 19:00:52 +01:00
Pedro Algarvio
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +01:00
Pedro Algarvio
87e9f5e676
Mock patching. The right way. 2017-03-28 19:00:51 +01:00
Pedro Algarvio
b25b26e23d
Cleanup test attributes once finished 2017-03-28 19:00:51 +01:00
Pedro Algarvio
6f79dd6af3
Not an integration test 2017-03-28 19:00:51 +01:00
Pedro Algarvio
993c488ea7
Cleanup attributes 2017-03-28 19:00:50 +01:00
Pedro Algarvio
6b22c6419f
Fixed tests not written for py3
The tests happened to work because py2 does not default to absolute
imports, contrary to py3.
Additionally, with py3 absolute imports we must remove imported libs
from `sys.modules`(not salt loader modules)
2017-03-28 19:00:50 +01:00
Pedro Algarvio
7219a35656
These are not integration tests 2017-03-28 19:00:50 +01:00
Mike Place
d7e745a53a Merge pull request #40281 from terminalmage/rename-docker
Rename docker execution module to avoid shadowing in the loader
2017-03-28 11:06:08 -06:00
Mike Place
d8cabca9a6 Merge pull request #40349 from ferringb/develop
ticket #40348: fix pillar include key nested support
2017-03-28 11:04:19 -06:00
Mike Place
b6032215e9 Merge pull request #40299 from amendlik/saltify-authtest
Saltify authtest
2017-03-28 10:17:02 -06:00
Mike Place
2d2cb5b837 Merge pull request #40333 from gtmanfred/2016.11
fix some test=True comments
2017-03-28 10:11:00 -06:00
Erik Johnson
808ad76419 systemd.py: when getting all services, don't repeat gathering of systemd services
Now that we are not caching these in the context dunder, we should pass
them into this function so that we don't repeat gathering the systemd
services inside _get_sysv_services().

Also, this fixes an incorrect change to the mocking that was apparently
made at some point to the get_all unit test.
2017-03-28 10:52:50 -05:00
Erik Johnson
774a3f1147 Rename docker execution module to avoid shadowing in the loader
With the merging of #39996, salt/modules/docker.py now imports
salt.utils.docker. However, our loader appends the module dir (in
this case salt/modules/) to sys.path temporarily for the length of the
loading process. So, as the docker execution module tries to import
salt.utils.docker, when salt.utils.docker attempts to do an "import
docker", and docker-py is *not* installed, this results in
salt/modules/docker.py (the docker execution module) being loaded in its
place, which results in tracebacks in the minion log.

Renaming the docker execution module keeps this import shadowing from
occurring. Note that we don't need to do this for the placeholder
salt/states/docker.py as it does not import salt.utils.docker.
2017-03-28 10:50:47 -05:00
zer0def
d68067f1d7 Merge remote-tracking branch 'main/2016.11' into pip-cache-fixes 2017-03-28 16:39:19 +02:00
zer0def
4f23a23ca8 Fixed the test_install_download_cache_argument_in_resulting_command to accomodate introduced cache directory argument fixes and renamed it to test_install_download_cache_dir_arguments_in_resulting_command. 2017-03-28 11:53:54 +02:00
Adam Mendlik
6c6e8d17bc Update unit test for Saltify with credential verification 2017-03-27 19:20:38 -06:00
Mike Place
75565df5da Merge pull request #39884 from Juniper/develop
unit tests for junos specific code
2017-03-27 18:35:58 -06:00
Brian Harring
80ebd77d67 ticket 40348: fix pillar include key nested support
Extend pillar include support so that nesting is possible
for the key directive.

Given the following pillar files:

foo1.sls:
include:
- foo:
    key: two:levels

foo2.sls:
foon: blah

After this commit, it'll result in the following pillar data:

two:
  levels:
    foon: blah

Currently, it results in the following data which is far less useful
for usage, and in ability to be addressed:

two:levels:
  foon: blah
2017-03-27 17:19:24 -07:00
Mike Place
e15e65dc9f Merge pull request #40276 from skizunov/develop2
rabbitmq: Do not use `__context__` for persistent globals
2017-03-27 17:37:26 -06:00
Daniel Wallace
5596620dfb fix some test=True comments
Alternatives should say it is setting the symlink to `path` instead of
`current` which it is already set to

ssh_auth.absent should say it is going to remove the key, unless the status is
set to `add`, then it is already absent

Fixes #40322
Fixes #40321
2017-03-27 18:19:52 -05:00
Mike Place
2b7b2f1cb4 Merge pull request #40285 from rallytime/docker-test-fixes
Dockerng unit tests fixes: isolate global variables
2017-03-27 17:05:02 -06:00
rallytime
0f263a52e0 Mock out the get_client_args mocks in the dockerng module tests more aggressively
The tests pass fine when run independently, but when the full unit test suite
runs, the dockerng state tests are setting global values. This change makes the
module tests avoid those problem by relying on its own mocks.
2017-03-27 11:27:52 -06:00
Nicole Thomas
74cc74d784 Merge pull request #40246 from tonybaloney/fix_libcloud_dns_bug
Fix libcloud_dns state module bug
2017-03-27 08:49:13 -06:00
vnitinv
a9acd532d1 fix lint in test_junos.py 2017-03-27 11:33:42 +05:30
rajvidhimar
f629feaabd Take care of import error and add condition to skip tests if PyEZ is not installed 2017-03-26 17:27:32 +05:30
Anthony Shaw
ee0daa1b64
remove unused imports 2017-03-25 11:44:55 +11:00
rallytime
c65d602f60 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/cli/batch.py
2017-03-24 17:11:49 -06:00
Pablo Suárez Hernández
9174e6f281 Fixes testing opts dict for batch unit tests 2017-03-24 17:22:57 +00:00
rallytime
f1352fe253 Add one more dockerng.version mock that was missed previously 2017-03-24 10:57:12 -06:00
vnitinv
146f8abc4c sync with upstream 2017-03-24 12:18:14 +05:30
Anthony Shaw
10c84303db
fix unit tests 2017-03-24 15:13:03 +11:00
Anthony Shaw
605a12dbc0
linting 2017-03-24 14:05:19 +11:00
Sergey Kizunov
64d224ad02 rabbitmq: Do not use __context__ for persistent globals
The rabbitmq module was using `__context__` to store paths of
rabbitmq executables. `__context__` may be cleared but the module
still could remain in use, in which case it would fail to work
correctly. Move the paths of the rabbitmq executables to their own
global variables so that they are not affected by the lifespan of
`__context__`.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2017-03-23 14:46:36 -05:00
Mike Place
e462a04d70 Merge pull request #40200 from DSRCorporation/features/zh864_auth_redesign
E-Auth refactoring
2017-03-23 13:32:20 -06:00
rallytime
0d31d2c4d1 Add a couple more patches for docker.version information 2017-03-23 12:57:46 -06:00
rallytime
a9c5eebaf0 Clean up dockerng unit tests to avoid global variables and fixup some patching 2017-03-23 12:44:57 -06:00
rallytime
62b31d7620 Pylint fixes 2017-03-23 10:00:20 -06:00
Anthony Shaw
1efd5a19fb
linting 2017-03-23 22:12:12 +11:00
Anthony Shaw
065e45188d
fix up tests 2017-03-23 20:18:41 +11:00
rallytime
235a768872 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/returners/influxdb_return.py
  - salt/states/dockerng.py
  - salt/utils/schedule.py
  - tests/unit/modules/test_docker.py
  - tests/unit/states/dockerng_test.py
  - tests/unit/utils/test_schedule.py
2017-03-22 17:44:08 -06:00
Dmitry Kuzmenko
37b35a19c7 Bugs and tests fixes. 2017-03-22 16:00:51 +03:00
rajvidhimar
2868755128 Remove usage of nose in junos unit tests 2017-03-22 17:08:19 +05:30
Erik Johnson
5ad476936d Overhaul Docker support
This does the following:

- Splits states for container/volume/image/network management into four
  separate state modules.

- Preserves backward compatibility by making ``docker.image_present``
  invoke ``docker_image.present``, etc.

- Changes how Salt detects that a container needs to be replaced.
  Instead of comparing each passed argument to the named container's
  configuration, it creates a temporary container, and compares that
  container to the named container. If the two differ, then the older
  container is removed, and the new one is renamed and started, becoming
  the named container.

- Removes the unit tests for container management and replaces them with
  integration tests.

- Adds unit tests for the new salt.utils.docker
2017-03-21 16:53:19 -05:00
rallytime
a6a7538fe4 Pylint fix 2017-03-21 13:39:34 -06:00